SeasonalModelType.java

  1. /* Copyright 2022-2025 Thales Alenia Space
  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.models.earth.weather;

  18. import java.util.HashMap;
  19. import java.util.Map;

  20. /** Type of seasonal model used in Global Pressure Temperature models.
  21.  * @see "Landskron, D. & Böhm, J. J Geod (2018)
  22.  *      VMF3/GPT3: refined discrete and empirical troposphere mapping functions
  23.  *      92: 349. https://doi.org/10.1007/s00190-017-1066-2"
  24.  * @author Luc Maisonobe
  25.  * @since 12.1
  26.  */
  27. public enum SeasonalModelType {

  28.     /** Pressure model. */
  29.     PRESSURE("p"),

  30.     /** Temperature model. */
  31.     TEMPERATURE("T"),

  32.     /** Specific humidity model. */
  33.     QV("Q"),

  34.     /** Temperature gradient model. */
  35.     DT("dT"),

  36.     /** ah coefficient model. */
  37.     AH("h", "a_h"),

  38.     /** aw coefficient model. */
  39.     AW("w", "a_w"),

  40.     /** Water vapor decrease factor model. */
  41.     LAMBDA("lambda"),

  42.     /** Mean temperature weighted with water vapor pressure model. */
  43.     TM("Tm"),

  44.     /** Hydrostatic North gradient coefficient model. */
  45.     GN_H("Gn_h"),

  46.     /** Hydrostatic East gradient coefficient model. */
  47.     GE_H("Ge_h"),

  48.     /** Wet North gradient coefficient model. */
  49.     GN_W("Gn_w"),

  50.     /** Wet East gradient coefficient model. */
  51.     GE_W("Ge_w");

  52.     /** Global suffix that applies to all labels. */
  53.     private static final String SUFFIX = ":a0";

  54.     /** Parsing map. */
  55.     private static final Map<String, SeasonalModelType> LABELS_MAP = new HashMap<>();
  56.     static {
  57.         for (final SeasonalModelType type : values()) {
  58.             for (final String label : type.labels) {
  59.                 LABELS_MAP.put(label + SUFFIX, type);
  60.             }
  61.         }
  62.     }

  63.     /** Labels in grid files headers. */
  64.     private final String[] labels;

  65.     /** Simple constructor.
  66.      * @param labels labels in grid files headers
  67.      */
  68.     SeasonalModelType(final String... labels) {
  69.         this.labels = labels.clone();
  70.     }

  71.     /** Parse a field to get the type.
  72.      * @param field field to parse
  73.      * @return the type corresponding to the field
  74.      * @exception IllegalArgumentException if the field does not correspond to a type
  75.      */
  76.     public static SeasonalModelType parseType(final String field) {
  77.         return LABELS_MAP.get(field);
  78.     }

  79. }