SpacecraftParameters.java

  1. /* Copyright 2002-2025 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.ccsds.ndm.odm;

  18. import org.orekit.files.ccsds.section.CommentsContainer;
  19. import org.orekit.files.ccsds.section.Data;

  20. /** Container for spacecraft parameters.
  21.  * <p>
  22.  * Beware that the Orekit getters and setters all rely on SI units. The parsers
  23.  * and writers take care of converting these SI units into CCSDS mandatory units.
  24.  * The {@link org.orekit.utils.units.Unit Unit} class provides useful
  25.  * {@link org.orekit.utils.units.Unit#fromSI(double) fromSi} and
  26.  * {@link org.orekit.utils.units.Unit#toSI(double) toSI} methods in case the callers
  27.  * already use CCSDS units instead of the API SI units. The general-purpose
  28.  * {@link org.orekit.utils.units.Unit Unit} class (without an 's') and the
  29.  * CCSDS-specific {@link org.orekit.files.ccsds.definitions.Units Units} class
  30.  * (with an 's') also provide some predefined units. These predefined units and the
  31.  * {@link org.orekit.utils.units.Unit#fromSI(double) fromSi} and
  32.  * {@link org.orekit.utils.units.Unit#toSI(double) toSI} conversion methods are indeed
  33.  * what the parsers and writers use for the conversions.
  34.  * </p>
  35.  * @author sports
  36.  * @since 6.1
  37.  */
  38. public class SpacecraftParameters extends CommentsContainer implements Data {

  39.     /** Spacecraft mass. */
  40.     private double mass;

  41.     /** Solar radiation pressure area (m^2). */
  42.     private double solarRadArea;

  43.     /** Solar radiation pressure coefficient. */
  44.     private double solarRadCoeff;

  45.     /** Drag area (m^2). */
  46.     private double dragArea;

  47.     /** Drag coefficient. */
  48.     private double dragCoeff;

  49.     /** Create an empty state data set.
  50.      */
  51.     public SpacecraftParameters() {
  52.         mass          = Double.NaN;
  53.         solarRadArea  = Double.NaN;
  54.         solarRadCoeff = Double.NaN;
  55.         dragArea      = Double.NaN;
  56.         dragCoeff     = Double.NaN;
  57.     }

  58.     /** {@inheritDoc} */
  59.     @Override
  60.     public void validate(final double version) {
  61.         checkNotNaN(mass, SpacecraftParametersKey.MASS.name());
  62.     }

  63.     /** Get the spacecraft mass.
  64.      * @return the spacecraft mass
  65.      */
  66.     public double getMass() {
  67.         return mass;
  68.     }

  69.     /** Set the spacecraft mass.
  70.      * @param mass the spacecraft mass to be set
  71.      */
  72.     public void setMass(final double mass) {
  73.         refuseFurtherComments();
  74.         this.mass = mass;
  75.     }

  76.     /** Get the solar radiation pressure area.
  77.      * @return the solar radiation pressure area
  78.      */
  79.     public double getSolarRadArea() {
  80.         return solarRadArea;
  81.     }

  82.     /** Set the solar radiation pressure area.
  83.      * @param solarRadArea the area to be set
  84.      */
  85.     public void setSolarRadArea(final double solarRadArea) {
  86.         refuseFurtherComments();
  87.         this.solarRadArea = solarRadArea;
  88.     }

  89.     /** Get the solar radiation pressure coefficient.
  90.      * @return the solar radiation pressure coefficient
  91.      */
  92.     public double getSolarRadCoeff() {
  93.         return solarRadCoeff;
  94.     }

  95.     /** Get the solar radiation pressure coefficient.
  96.      * @param solarRadCoeff the coefficient to be set
  97.      */
  98.     public void setSolarRadCoeff(final double solarRadCoeff) {
  99.         refuseFurtherComments();
  100.         this.solarRadCoeff = solarRadCoeff;
  101.     }

  102.     /** Get the drag area.
  103.      * @return the drag area
  104.      */
  105.     public double getDragArea() {
  106.         return dragArea;
  107.     }

  108.     /** Set the drag area.
  109.      * @param dragArea the area to be set
  110.      */
  111.     public void setDragArea(final double dragArea) {
  112.         refuseFurtherComments();
  113.         this.dragArea = dragArea;
  114.     }

  115.     /** Get the drag coefficient.
  116.      * @return the drag coefficient
  117.      */
  118.     public double getDragCoeff() {
  119.         return dragCoeff;
  120.     }

  121.     /** Set the drag coefficient.
  122.      * @param dragCoeff the coefficient to be set
  123.      */
  124.     public void setDragCoeff(final double dragCoeff) {
  125.         refuseFurtherComments();
  126.         this.dragCoeff = dragCoeff;
  127.     }

  128. }