SolarReflectivityCoefficientTerm.java

  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. import org.orekit.files.iirv.terms.base.DoubleValuedIIRVTerm;

  19. /**
  20.  * 8-character dimensionless solar reflectivity coefficient.
  21.  * <p>
  22.  * s = "-" for negative sign or blank for positive sign,
  23.  * assumed decimal point is six places from the right. May contain all zeros if not used.
  24.  * <p>
  25.  * Units: dimensionless
  26.  * <p>
  27.  * Valid values
  28.  * <ul>
  29.  * <li>-99.99999 to 99.99999</li>
  30.  * <li>"<code>sxxxxxxx</code>: <code>s</code>: ' ' (ASCII space) or '-', <code>x</code>: Any integer 0-9</li>
  31.  * </ul>
  32.  *
  33.  * @author Nick LaFarge
  34.  * @since 13.0
  35.  */
  36. public class SolarReflectivityCoefficientTerm extends DoubleValuedIIRVTerm {

  37.     /** SolarReflectivityCoefficientTerm contains all zeros when not used. */
  38.     public static final SolarReflectivityCoefficientTerm UNUSED = new SolarReflectivityCoefficientTerm(0);

  39.     /** The length of the IIRV term within the message. */
  40.     public static final int SOLAR_REFLECTIVITY_COEFFICIENT_TERM_LENGTH = 8;

  41.     /** Regular expression that ensures the validity of string values for this term. */
  42.     public static final String SOLAR_REFLECTIVITY_COEFFICIENT_TERM_PATTERN = "( |-)\\d{7}";

  43.     /** Number of characters before the end of the string the decimal place occurs. */
  44.     public static final int N_CHARS_AFTER_DECIMAL_PLACE = 6;

  45.     /**
  46.      * Constructor.
  47.      * <p>
  48.      * See {@link DoubleValuedIIRVTerm#DoubleValuedIIRVTerm(String, String, int, int, boolean)}
  49.      *
  50.      * @param value value of the solar reflectivity coefficient term (dimensionless)
  51.      */
  52.     public SolarReflectivityCoefficientTerm(final String value) {
  53.         super(SOLAR_REFLECTIVITY_COEFFICIENT_TERM_PATTERN,
  54.             value,
  55.             SOLAR_REFLECTIVITY_COEFFICIENT_TERM_LENGTH,
  56.             N_CHARS_AFTER_DECIMAL_PLACE,
  57.             true);
  58.     }

  59.     /**
  60.      * Constructor.
  61.      * <p>
  62.      * See {@link DoubleValuedIIRVTerm#DoubleValuedIIRVTerm(String, double, int, int, boolean)}
  63.      *
  64.      * @param value value of the solar reflectivity coefficient term (dimensionless).
  65.      */
  66.     public SolarReflectivityCoefficientTerm(final double value) {
  67.         super(SOLAR_REFLECTIVITY_COEFFICIENT_TERM_PATTERN,
  68.             value,
  69.             SOLAR_REFLECTIVITY_COEFFICIENT_TERM_LENGTH,
  70.             N_CHARS_AFTER_DECIMAL_PLACE,
  71.             true);
  72.     }
  73. }