1   /* Copyright 2024-2025 The Johns Hopkins University Applied Physics Laboratory
2    * Licensed to CS GROUP (CS) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * CS licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.orekit.files.iirv.terms;
18  
19  import org.orekit.files.iirv.terms.base.DoubleValuedIIRVTerm;
20  
21  /**
22   * 8-character dimensionless solar reflectivity coefficient.
23   * <p>
24   * s = "-" for negative sign or blank for positive sign,
25   * assumed decimal point is six places from the right. May contain all zeros if not used.
26   * <p>
27   * Units: dimensionless
28   * <p>
29   * Valid values
30   * <ul>
31   * <li>-99.99999 to 99.99999</li>
32   * <li>"<code>sxxxxxxx</code>: <code>s</code>: ' ' (ASCII space) or '-', <code>x</code>: Any integer 0-9</li>
33   * </ul>
34   *
35   * @author Nick LaFarge
36   * @since 13.0
37   */
38  public class SolarReflectivityCoefficientTerm extends DoubleValuedIIRVTerm {
39  
40      /** SolarReflectivityCoefficientTerm contains all zeros when not used. */
41      public static final SolarReflectivityCoefficientTerm UNUSED = new SolarReflectivityCoefficientTerm(0);
42  
43      /** The length of the IIRV term within the message. */
44      public static final int SOLAR_REFLECTIVITY_COEFFICIENT_TERM_LENGTH = 8;
45  
46      /** Regular expression that ensures the validity of string values for this term. */
47      public static final String SOLAR_REFLECTIVITY_COEFFICIENT_TERM_PATTERN = "( |-)\\d{7}";
48  
49      /** Number of characters before the end of the string the decimal place occurs. */
50      public static final int N_CHARS_AFTER_DECIMAL_PLACE = 6;
51  
52      /**
53       * Constructor.
54       * <p>
55       * See {@link DoubleValuedIIRVTerm#DoubleValuedIIRVTerm(String, String, int, int, boolean)}
56       *
57       * @param value value of the solar reflectivity coefficient term (dimensionless)
58       */
59      public SolarReflectivityCoefficientTerm(final String value) {
60          super(SOLAR_REFLECTIVITY_COEFFICIENT_TERM_PATTERN,
61              value,
62              SOLAR_REFLECTIVITY_COEFFICIENT_TERM_LENGTH,
63              N_CHARS_AFTER_DECIMAL_PLACE,
64              true);
65      }
66  
67      /**
68       * Constructor.
69       * <p>
70       * See {@link DoubleValuedIIRVTerm#DoubleValuedIIRVTerm(String, double, int, int, boolean)}
71       *
72       * @param value value of the solar reflectivity coefficient term (dimensionless).
73       */
74      public SolarReflectivityCoefficientTerm(final double value) {
75          super(SOLAR_REFLECTIVITY_COEFFICIENT_TERM_PATTERN,
76              value,
77              SOLAR_REFLECTIVITY_COEFFICIENT_TERM_LENGTH,
78              N_CHARS_AFTER_DECIMAL_PLACE,
79              true);
80      }
81  }