DcbStation.java

  1. /* Copyright 2002-2024 CS GROUP
  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.sinex;

  18. import java.util.HashMap;

  19. import org.orekit.gnss.SatelliteSystem;

  20. /**
  21.  * Class based on DCB, used to store the data parsed in {@link SinexLoader}
  22.  * for Differential Code Biases computed for stations.
  23.  * <p>
  24.  * Satellites and stations have differentiated classes as stations might have multiple satellite systems.
  25.  * The data are stored in a Map of DCB, identified by the {@link SatelliteSystem}
  26.  * </p>
  27.  * @author Louis Aucouturier
  28.  * @since 12.0
  29.  */
  30. public class DcbStation {

  31.     /** Site code. */
  32.     private String siteCode;

  33.     /** DCB description container. */
  34.     private DcbDescription description;

  35.     /** Map containing DCB objects as a function of the satellite system. */
  36.     private HashMap<SatelliteSystem, Dcb> dcbMap;

  37.     /**
  38.      * Simple constructor.
  39.      * @param siteCode the site code (station identifier)
  40.      */
  41.     public DcbStation(final String siteCode) {
  42.         this.siteCode    = siteCode;
  43.         this.description = null;
  44.         this.dcbMap      = new HashMap<SatelliteSystem, Dcb>();
  45.     }

  46.     /**
  47.      * Get the site code (station identifier).
  48.      *
  49.      * @return the site code
  50.      */
  51.     public String getSiteCode() {
  52.         return siteCode;
  53.     }

  54.     /**
  55.      * Get the data contained in "DCB/DESCRIPTION" block of the Sinex file.
  56.      * <p>
  57.      * This block gives important parameters from the analysis and defines
  58.      * the fields in the block ’BIAS/SOLUTION’
  59.      * </p>
  60.      * @return the "DCB/DESCRIPTION" parameters.
  61.      */
  62.     public DcbDescription getDescription() {
  63.         return description;
  64.     }

  65.     /**
  66.      * Set the data contained in "DCB/DESCRIPTION" block of the Sinex file.
  67.      *
  68.      * @param description the "DCB/DESCRIPTION" parameters to set
  69.      */
  70.     public void setDescription(final DcbDescription description) {
  71.         this.description = description;
  72.     }

  73.     /**
  74.      * Get the DCB data for a given satellite system.
  75.      *
  76.      * @param satelliteSystem satellite system
  77.      * @return the DCB data corresponding to the satellite system
  78.      *         (can be null is no DCB available)
  79.      */
  80.     public Dcb getDcbData(final SatelliteSystem satelliteSystem) {
  81.         return dcbMap.get(satelliteSystem);
  82.     }

  83.     /**
  84.      * Add the DCB data corresponding to a satellite system.
  85.      * <p>
  86.      * If the instance previously contained DCB data for the satellite system, the old value is replaced.
  87.      * </p>
  88.      * @param satelliteSystem satellite system for which the DCB is added
  89.      * @param dcb DCB data
  90.      */
  91.     public void addDcb(final SatelliteSystem satelliteSystem, final Dcb dcb) {
  92.         dcbMap.put(satelliteSystem, dcb);
  93.     }

  94.     /**
  95.      * Get the satellite systems available for the station.
  96.      *
  97.      * @return a Set containing all SatelliteSystems available for DCB computation.
  98.      */
  99.     public Iterable<SatelliteSystem> getAvailableSatelliteSystems() {
  100.         return dcbMap.keySet();
  101.     }

  102. }