SensorToGroundMapping.java

  1. /* Copyright 2013-2022 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.rugged.adjustment.measurements;

  18. import java.util.Collections;
  19. import java.util.Map;
  20. import java.util.Set;

  21. import org.orekit.bodies.GeodeticPoint;
  22. import org.orekit.rugged.linesensor.SensorPixel;

  23. /** Container for mapping between sensor pixels and ground points.
  24.  * @see SensorMapping
  25.  * @author Luc Maisonobe
  26.  * @author Lucie Labat-Allee
  27.  * @author Guylaine Prat
  28.  * @since 2.0
  29.  */
  30. public class SensorToGroundMapping {

  31.     /** Default name for Rugged. */
  32.     private static final String RUGGED = "Rugged";

  33.     /** Name of the sensor to which mapping applies. */
  34.     private final String sensorName;

  35.     /** Mapping from sensor to ground. */
  36.     private final SensorMapping<GeodeticPoint> groundMapping;


  37.     /** Build a new instance (with default Rugged name).
  38.      * @param sensorName name of the sensor to which mapping applies
  39.      */
  40.     public SensorToGroundMapping(final String sensorName) {
  41.         this(RUGGED, sensorName);
  42.     }

  43.     /** Build a new instance with a specific Rugged name.
  44.      * @param ruggedName name of the Rugged to which mapping applies
  45.      * @param sensorName name of the sensor to which mapping applies
  46.      */
  47.     public SensorToGroundMapping(final String ruggedName, final String sensorName) {

  48.         this.sensorName     = sensorName;
  49.         this.groundMapping = new SensorMapping<>(sensorName, ruggedName);
  50.     }

  51.     /** Get the name of the sensor to which mapping applies.
  52.      * @return name of the sensor to which mapping applies
  53.      */
  54.     public String getSensorName() {
  55.         return sensorName;
  56.     }

  57.     /** Get the name of the Rugged to which mapping applies.
  58.      * @return name of the Rugged to which mapping applies
  59.      */
  60.     public String getRuggedName() {
  61.         return this.groundMapping.getRuggedName();
  62.     }

  63.     /** Add a mapping between one sensor pixel and one ground point.
  64.      * @param pixel sensor pixel
  65.      * @param groundPoint ground point corresponding to the sensor pixel
  66.      */
  67.     public void addMapping(final SensorPixel pixel, final GeodeticPoint groundPoint) {
  68.         groundMapping.addMapping(pixel, groundPoint);
  69.     }

  70.     /** Get all the mapping entries.
  71.      * @return an unmodifiable view of all mapping entries
  72.      */
  73.     public Set<Map.Entry<SensorPixel, GeodeticPoint>> getMapping() {
  74.         return Collections.unmodifiableSet(groundMapping.getMapping());
  75.     }
  76. }