Commit 9c5bb21e authored by mvanel's avatar mvanel
Browse files

- Renamed CovarianceMatrix into RTNCovariance

- Added Vector3D getter in Relative Metadata and State Vector
- Added RealMatrix getter in RTNCovariance
- Added units for getter and setter
parent 2770917c
Pipeline #1850 passed with stages
in 28 minutes and 19 seconds
......@@ -40,40 +40,40 @@ public class Units {
/** m⁴ unit. */
public static final Unit M4 = Unit.parse("m⁴");
/** Meters par second units. */
/** Meters per second units. */
public static final Unit M_PER_S = Unit.parse("m/s");
/** Meters par second square units. */
/** Meters per square second units. */
public static final Unit M_PER_S2 = Unit.parse("m/s²");
/** Meters square par second units. */
/** Square meters per second units. */
public static final Unit M2_PER_S = Unit.parse("m²/s");
/** Meters square par second units. */
/** Square meters per square second units. */
public static final Unit M2_PER_S2 = Unit.parse("m²/s²");
/** Meters square par second units. */
/** Square meters per cube second units. */
public static final Unit M2_PER_S3 = Unit.parse("m²/s³");
/** Meters square par second units. */
/** Square meters per s⁴ units. */
public static final Unit M2_PER_S4 = Unit.parse("m²/s⁴");
/** Meters par kilograms units. */
/** per kilograms units. */
public static final Unit M2_PER_KG = Unit.parse("m²/kg");
/** Meters cubic par kilograms units. */
/** per kilograms units. */
public static final Unit M3_PER_KG = Unit.parse("m³/kg");
/** m⁴ par kilograms units. */
/** m⁴ per kilograms units. */
public static final Unit M4_PER_KG = Unit.parse("m⁴/kg");
/** m⁴ par kilograms square units. */
/** m⁴ per square kilograms units. */
public static final Unit M4_PER_KG2 = Unit.parse("m⁴/kg²");
/** Meters cubic par kilograms second units. */
/** Cubic meters per kilograms second units. */
public static final Unit M3_PER_KGS = Unit.parse("m³/(kg.s)");
/** Meters cubic par kilograms (second square) units. */
/** Cubic meters per kilograms (square second) units. */
public static final Unit M3_PER_KGS2 = Unit.parse("m³/(kg.s²)");
/** #/year unit. */
......@@ -82,13 +82,13 @@ public class Units {
/** Square kilometers units. */
public static final Unit KM2 = Unit.parse("km²");
/** Kilometers par second units. */
/** Kilometers per second units. */
public static final Unit KM_PER_S = Unit.parse("km/s");
/** Kilometers par square second units. */
/** Kilometers per square second units. */
public static final Unit KM_PER_S2 = Unit.parse("km/s²");
/** Square kilometers par second units. */
/** Square kilometers per second units. */
public static final Unit KM2_PER_S = Unit.parse("km²/s");
/** Square kilometers per square second units. */
......@@ -118,7 +118,7 @@ public class Units {
/** Hertz per second unit. */
public static final Unit HZ_PER_S = Unit.parse("Hz/s");
/** Watt par kilograms units. */
/** Watt per kilograms units. */
public static final Unit W_PER_KG = Unit.parse("W/kg");
/** Private constructor for a utility class.
......
......@@ -72,7 +72,7 @@ public class AdditionalParameters extends CommentsContainer {
/**
* Get the actual area of the object.
* @return the object area
* @return the object area (in m²)
*/
public double getAreaPC() {
return areaPC;
......@@ -80,7 +80,7 @@ public class AdditionalParameters extends CommentsContainer {
/**
* Set the actual area of the object.
* @param areaPC area value to be set
* @param areaPC area (in m²) value to be set
*/
public void setAreaPC(final double areaPC) {
refuseFurtherComments();
......@@ -89,7 +89,7 @@ public class AdditionalParameters extends CommentsContainer {
/**
* Get the effective area of the object exposed to atmospheric drag.
* @return the object area exposed to atmospheric drag
* @return the object area (in m²) exposed to atmospheric drag
*/
public double getAreaDRG() {
return areaDRG;
......@@ -97,7 +97,7 @@ public class AdditionalParameters extends CommentsContainer {
/**
* Set the effective area of the object exposed to atmospheric drag.
* @param areaDRG area value to be set
* @param areaDRG area (in m²) value to be set
*/
public void setAreaDRG(final double areaDRG) {
refuseFurtherComments();
......@@ -106,7 +106,7 @@ public class AdditionalParameters extends CommentsContainer {
/**
* Get the effective area of the object exposed to solar radiation pressure.
* @return the object area exposed to solar radiation pressure
* @return the object area (in m²) exposed to solar radiation pressure
*/
public double getAreaSRP() {
return areaSRP;
......@@ -114,7 +114,7 @@ public class AdditionalParameters extends CommentsContainer {
/**
* Set the effective area of the object exposed to solar radiation pressure.
* @param areaSRP area value to be set
* @param areaSRP area (in m²) to be set
*/
public void setAreaSRP(final double areaSRP) {
refuseFurtherComments();
......@@ -123,7 +123,7 @@ public class AdditionalParameters extends CommentsContainer {
/**
* Get the mass of the object.
* @return the mass of the object
* @return the mass (in kg) of the object
*/
public double getMass() {
return mass;
......@@ -131,7 +131,7 @@ public class AdditionalParameters extends CommentsContainer {
/**
* Set the mass of the object.
* @param mass mass of the object to be set
* @param mass mass (in kg) of the object to be set
*/
public void setMass(final double mass) {
refuseFurtherComments();
......@@ -140,7 +140,7 @@ public class AdditionalParameters extends CommentsContainer {
/**
* Get the object’s Cd x A/m used to propagate the state vector and covariance to TCA.
* @return the object’s Cd x A/m
* @return the object’s Cd x A/m (in m²/kg)
*/
public double getCDAreaOverMass() {
return cdAreaOverMass;
......@@ -148,7 +148,7 @@ public class AdditionalParameters extends CommentsContainer {
/**
* Set the object’s Cd x A/m used to propagate the state vector and covariance to TCA.
* @param CDAreaOverMass object’s Cd x A/m value to be set
* @param CDAreaOverMass object’s Cd x A/m (in m²/kg) value to be set
*/
public void setCDAreaOverMass(final double CDAreaOverMass) {
refuseFurtherComments();
......@@ -157,7 +157,7 @@ public class AdditionalParameters extends CommentsContainer {
/**
* Get the object’s Cr x A/m used to propagate the state vector and covariance to TCA.
* @return the object’s Cr x A/m
* @return the object’s Cr x A/m (in m²/kg)
*/
public double getCRAreaOverMass() {
return crAreaOverMass;
......@@ -165,7 +165,7 @@ public class AdditionalParameters extends CommentsContainer {
/**
* Set the object’s Cr x A/m used to propagate the state vector and covariance to TCA.
* @param CRAreaOverMass object’s Cr x A/m value to be set
* @param CRAreaOverMass object’s Cr x A/m (in m²/kg) value to be set
*/
public void setCRAreaOverMass(final double CRAreaOverMass) {
refuseFurtherComments();
......@@ -174,7 +174,7 @@ public class AdditionalParameters extends CommentsContainer {
/**
* Get the object’s acceleration due to in-track thrust used to propagate the state vector and covariance to TCA.
* @return the object’s acceleration due to in-track thrust
* @return the object’s acceleration (in m/s²) due to in-track thrust
*/
public double getThrustAcceleration() {
return thrustAcceleration;
......@@ -182,7 +182,7 @@ public class AdditionalParameters extends CommentsContainer {
/**
* Set the object’s acceleration due to in-track thrust used to propagate the state vector and covariance to TCA.
* @param thrustAcceleration object’s acceleration due to in-track thrust
* @param thrustAcceleration object’s acceleration (in m/s²) due to in-track thrust
*/
public void setThrustAcceleration(final double thrustAcceleration) {
refuseFurtherComments();
......@@ -190,18 +190,20 @@ public class AdditionalParameters extends CommentsContainer {
}
/**
* Get the amount of energy being removed from the object’s orbit by atmospheric drag. This value is an average calculated during the OD.
* @return the amount of energy being removed from the object’s orbit by atmospheric drag
* Get the amount of energy being removed from the object’s orbit by atmospheric drag. This value is an average
* calculated during the OD. SEDR = Specific Energy Dissipation Rate.
* @return the amount of energy (in W/kg) being removed from the object’s orbit by atmospheric drag
*/
public double getSEDR() {
public double getSedr() {
return sedr;
}
/**
* Set the amount of energy being removed from the object’s orbit by atmospheric drag. This value is an average calculated during the OD.
* @param SEDR amount of energy being removed from the object’s orbit by atmospheric drag
* Set the amount of energy being removed from the object’s orbit by atmospheric drag. This value is an average
* calculated during the OD. SEDR = Specific Energy Dissipation Rate.
* @param SEDR amount of energy (in W/kg) being removed from the object’s orbit by atmospheric drag
*/
public void setSEDR(final double SEDR) {
public void setSedr(final double SEDR) {
refuseFurtherComments();
this.sedr = SEDR;
}
......
......@@ -54,7 +54,7 @@ public enum AdditionalParametersKey {
container::setThrustAcceleration)),
/** The amount of energy being removed from the object’s orbit by atmospheric drag. This value is an average calculated during the OD. */
SEDR((token, context, container) -> token.processAsDouble(Units.W_PER_KG, context.getParsedUnitsBehavior(),
container::setSEDR));
container::setSedr));
/** Processing method. */
private final TokenProcessor processor;
......
......@@ -41,7 +41,7 @@ public class CdmData implements Data {
private final StateVector stateVectorBlock;
/** Spacecraft parameters block. */
private final CovarianceMatrix covarianceMatrixBlock;
private final RTNCovariance covarianceMatrixBlock;
/** Simple constructor.
* @param commentsBlock general comments block
......@@ -54,7 +54,7 @@ public class CdmData implements Data {
final ODParameters ODparametersBlock,
final AdditionalParameters additionalParametersBlock,
final StateVector stateVectorBlock,
final CovarianceMatrix covarianceMatrixBlock) {
final RTNCovariance covarianceMatrixBlock) {
this.commentsBlock = commentsBlock;
this.ODparametersBlock = ODparametersBlock;
this.additionalParametersBlock = additionalParametersBlock;
......@@ -106,7 +106,7 @@ public class CdmData implements Data {
/** Get the covariance matrix logical block.
* @return covariance matrix block
*/
public CovarianceMatrix getCovarianceMatrixBlock() {
public RTNCovariance getCovarianceMatrixBlock() {
return covarianceMatrixBlock;
}
......
......@@ -395,8 +395,8 @@ public class CdmMetadata extends Metadata {
* @return the reference frame
*/
public Frame getFrame() {
if (orbitCenter.getBody() == null) {
throw new OrekitException(OrekitMessages.NO_DATA_LOADED_FOR_CELESTIAL_BODY, orbitCenter.getName());
if (orbitCenter == null || orbitCenter.getBody() == null) {
throw new OrekitException(OrekitMessages.NO_DATA_LOADED_FOR_CELESTIAL_BODY, "No Orbit center name");
}
if (refFrame.asFrame() == null) {
throw new OrekitException(OrekitMessages.CCSDS_INVALID_FRAME, refFrame.getName());
......
......@@ -89,7 +89,7 @@ public class CdmParser extends AbstractConstituentParser<Cdm, CdmParser> {
private StateVector stateVector;
/** CDM covariance matrix logical block being read. */
private CovarianceMatrix covMatrix;
private RTNCovariance covMatrix;
/** Processor for global message structure. */
private ProcessingState structureProcessor;
......@@ -141,7 +141,7 @@ public class CdmParser extends AbstractConstituentParser<Cdm, CdmParser> {
commentsBlock = new CommentsContainer();
reset(fileFormat, structureProcessor);
} else {
structureProcessor = new KvnStructureProcessingState(this); // should never be called
structureProcessor = new KvnStructureProcessingState(this);
reset(fileFormat, new CdmHeaderProcessingState(this));
}
}
......@@ -213,9 +213,9 @@ public class CdmParser extends AbstractConstituentParser<Cdm, CdmParser> {
/** {@inheritDoc} */
@Override
public boolean prepareData() {
// stateVector and CovarianceMatrix blocks are 2 mandatory data blocks
// stateVector and RTNCovariance blocks are 2 mandatory data blocks
stateVector = new StateVector();
covMatrix = new CovarianceMatrix();
covMatrix = new RTNCovariance();
commentsBlock = new CommentsContainer();
anticipateNext(getFileFormat() == FileFormat.XML ? this::processXmlSubStructureToken : this::processGeneralCommentToken);
return true;
......@@ -506,7 +506,7 @@ public class CdmParser extends AbstractConstituentParser<Cdm, CdmParser> {
anticipateNext(getFileFormat() == FileFormat.XML ? this::processXmlSubStructureToken : this::processMetadataToken);
try {
return token.getName() != null &&
CovarianceMatrixKey.valueOf(token.getName()).process(token, context, covMatrix);
RTNCovarianceKey.valueOf(token.getName()).process(token, context, covMatrix);
} catch (IllegalArgumentException iae) {
// token has not been recognized
return false;
......
......@@ -19,6 +19,7 @@ package org.orekit.files.ccsds.ndm.cdm;
import java.util.ArrayList;
import java.util.List;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
import org.orekit.files.ccsds.definitions.TimeSystem;
......@@ -126,7 +127,7 @@ public class CdmRelativeMetadata {
/**
* Get the norm of relative position vector at TCA.
* @return the miss distance
* @return the miss distance (in m)
*/
public double getMissDistance() {
return missDistance;
......@@ -134,7 +135,7 @@ public class CdmRelativeMetadata {
/**
* Set the norm of relative position vector at TCA.
* @param missDistance the miss distance to be set
* @param missDistance the miss distance to be set (in m)
*/
public void setMissDistance(final double missDistance) {
this.missDistance = missDistance;
......@@ -142,7 +143,7 @@ public class CdmRelativeMetadata {
/**
* Get the norm of relative velocity vector at TCA.
* @return the relative speed at TCA
* @return the relative speed at TCA (in m/s)
*/
public double getRelativeSpeed() {
return relativeSpeed;
......@@ -150,103 +151,73 @@ public class CdmRelativeMetadata {
/**
* Set the norm of relative velocity vector at TCA.
* @param relativeSpeed the relative speed at TCA to be set
* @param relativeSpeed the relative speed (in m/s) at TCA to be set
*/
public void setRelativeSpeed(final double relativeSpeed) {
this.relativeSpeed = relativeSpeed;
}
/**
* Get the R component of Object2’s position relative to Object1’s in RTN frame.
* @return the R component of Object2’s position relative to Object1’s
* Get the Object2’s velocity vector relative to Object1's at TCA in RTN frame, getX for R component,
* getY for T component, getZ for N component.
* @return the relative speed vector at TCA (in m/s)
*/
public double getRelativePositionR() {
return relativePositionR;
public Vector3D getRelativeSpeedVector() {
return new Vector3D(relativeVelocityR, relativeVelocityT, relativeVelocityN);
}
/**
* Set the R component of Object2’s position relative to Object1’s in RTN frame.
* @param relativePositionR the R component of Object2’s position relative to Object1’s
* Get the Object2’s position vector relative to Object1's at TCA in RTN frame, getX for R component,
* getY for T component, getZ for N component.
* @return the relative position vector at TCA (in m)
*/
public void setRelativePositionR(final double relativePositionR) {
this.relativePositionR = relativePositionR;
public Vector3D getRelativePositionVector() {
return new Vector3D(relativePositionR, relativePositionT, relativePositionN);
}
/**
* Get the T component of Object2’s position relative to Object1’s in RTN frame.
* @return the T component of Object2’s position relative to Object1’s
* Set the R component of Object2’s position relative to Object1’s in RTN frame.
* @param relativePositionR the R component (in m) of Object2’s position relative to Object1’s
*/
public double getRelativePositionT() {
return relativePositionT;
public void setRelativePositionR(final double relativePositionR) {
this.relativePositionR = relativePositionR;
}
/**
* Set the T component of Object2’s position relative to Object1’s in RTN frame.
* @param relativePositionT the T component of Object2’s position relative to Object1’s
* @param relativePositionT the T component (in m) of Object2’s position relative to Object1’s
*/
public void setRelativePositionT(final double relativePositionT) {
this.relativePositionT = relativePositionT;
}
/**
* Get the N component of Object2’s position relative to Object1’s in RTN frame.
* @return the N component of Object2’s position relative to Object1’s
*/
public double getRelativePositionN() {
return relativePositionN;
}
/**
* Set the N component of Object2’s position relative to Object1’s in RTN frame.
* @param relativePositionN the N component of Object2’s position relative to Object1’s
* @param relativePositionN the N component (in m) of Object2’s position relative to Object1’s
*/
public void setRelativePositionN(final double relativePositionN) {
this.relativePositionN = relativePositionN;
}
/**
* Get the R component of Object2’s velocity relative to Object1’s in RTN frame.
* @return the R component of Object2’s velocity relative to Object1’s
*/
public double getRelativeVelocityR() {
return relativeVelocityR;
}
/**
* Set the R component of Object2’s velocity relative to Object1’s in RTN frame.
* @param relativeVelocityR the R component of Object2’s velocity relative to Object1’s
* @param relativeVelocityR the R component (in m/s) of Object2’s velocity relative to Object1’s
*/
public void setRelativeVelocityR(final double relativeVelocityR) {
this.relativeVelocityR = relativeVelocityR;
}
/**
* Get the T component of Object2’s velocity relative to Object1’s in RTN frame.
* @return the T component of Object2’s velocity relative to Object1’s
*/
public double getRelativeVelocityT() {
return relativeVelocityT;
}
/**
* Set the T component of Object2’s velocity relative to Object1’s in RTN frame.
* @param relativeVelocityT the T component of Object2’s velocity relative to Object1’s
* @param relativeVelocityT the T component (in m/s) of Object2’s velocity relative to Object1’s
*/
public void setRelativeVelocityT(final double relativeVelocityT) {
this.relativeVelocityT = relativeVelocityT;
}
/**
* Get the N component of Object2’s velocity relative to Object1’s in RTN frame.
* @return the N component of Object2’s velocity relative to Object1’s
*/
public double getRelativeVelocityN() {
return relativeVelocityN;
}
/**
* Set the N component of Object2’s velocity relative to Object1’s in RTN frame.
* @param relativeVelocityN the N component of Object2’s velocity relative to Object1’s
* @param relativeVelocityN the N component (in m/s) of Object2’s velocity relative to Object1’s
*/
public void setRelativeVelocityN(final double relativeVelocityN) {
this.relativeVelocityN = relativeVelocityN;
......@@ -318,7 +289,7 @@ public class CdmRelativeMetadata {
/**
* Get the R or T (depending on if RTN or TVN is selected) component size of the screening volume in the corresponding frame.
* @return first component size of the screening volume
* @return first component size of the screening volume (in m)
*/
public double getScreenVolumeX() {
return screenVolumeX;
......@@ -326,7 +297,7 @@ public class CdmRelativeMetadata {
/**
* Set the R or T (depending on if RTN or TVN is selected) component size of the screening volume in the corresponding frame.
* @param screenVolumeX first component size of the screening volume
* @param screenVolumeX first component size of the screening volume (in m)
*/
public void setScreenVolumeX(final double screenVolumeX) {
this.screenVolumeX = screenVolumeX;
......@@ -334,7 +305,7 @@ public class CdmRelativeMetadata {
/**
* Get the T or V (depending on if RTN or TVN is selected) component size of the screening volume in the corresponding frame.
* @return second component size of the screening volume
* @return second component size of the screening volume (in m)
*/
public double getScreenVolumeY() {
return screenVolumeY;
......@@ -342,7 +313,7 @@ public class CdmRelativeMetadata {
/**
* Set the T or V (depending on if RTN or TVN is selected) component size of the screening volume in the corresponding frame.
* @param screenVolumeY second component size of the screening volume
* @param screenVolumeY second component size of the screening volume (in m)
*/
public void setScreenVolumeY(final double screenVolumeY) {
this.screenVolumeY = screenVolumeY;
......@@ -350,7 +321,7 @@ public class CdmRelativeMetadata {
/**
* Get the N component size of the screening volume in the corresponding frame.
* @return third component size of the screening volume
* @return third component size of the screening volume (in m)
*/
public double getScreenVolumeZ() {
return screenVolumeZ;
......@@ -358,7 +329,7 @@ public class CdmRelativeMetadata {
/**
* Set the N component size of the screening volume in the corresponding frame.
* @param screenVolumeZ third component size of the screening volume
* @param screenVolumeZ third component size of the screening volume (in m)
*/
public void setScreenVolumeZ(final double screenVolumeZ) {
this.screenVolumeZ = screenVolumeZ;
......@@ -438,20 +409,16 @@ public class CdmRelativeMetadata {
}
}
/** Set the Time System that: for OPM, is used for metadata, state vector,
* maneuver and covariance data, for OMM, is used for metadata, orbit state
* and covariance data, for OEM, is used for metadata, ephemeris and
* covariance data.
/** Set the Time System that: for CDM, is used for relative metadata, metadata,
* OD parameters, state vector. In CDM all date are given in UTC.
* @param timeSystem the time system to be set
*/
public void setTimeSystem(final TimeSystem timeSystem) {
this.timeSystem = timeSystem;
}
/** Get the Time System that: for OPM, is used for metadata, state vector,
* maneuver and covariance data, for OMM, is used for metadata, orbit state
* and covariance data, for OEM, is used for metadata, ephemeris and
* covariance data.
/** Get the Time System that: for CDM, is used for relative metadata, metadata,
* OD parameters, state vector. In CDM all date are given in UTC.
* @return the time system
*/
public TimeSystem getTimeSystem() {
......
......@@ -52,7 +52,7 @@ public class ODParameters extends CommentsContainer {
/** The percentage of residuals accepted in the OD of the object (from 0 to 100). */
private double residualsAccepted;
/** 2-axis / 3-axis inertia cross product entry. */
/** The weighted Root Mean Square (RMS) of the residuals from a batch least squares OD. */
private double weightedRMS;
/** Simple constructor.
......@@ -107,7 +107,7 @@ public class ODParameters extends CommentsContainer {
/**
* Get the recommended OD time span calculated for the object.
* @return the recommended OD time span calculated for the object
* @return the recommended OD time span (in days) calculated for the object
*/
public double getRecommendedODSpan() {
return recommendedODSpan;
......@@ -115,7 +115,7 @@ public class ODParameters extends CommentsContainer {
/**
* Set the recommended OD time span calculated for the object.
* @param recommendedODSpan recommended OD time span calculated for the object
* @param recommendedODSpan recommended OD time span (in days) calculated for the object
*/
public void setRecommendedODSpan(final double recommendedODSpan) {
refuseFurtherComments();
......@@ -124,7 +124,7 @@ public class ODParameters extends CommentsContainer {
/**
* Get the actual OD time based on the observations available and the RECOMMENDED_OD_SPAN.
* @return the actual OD time
* @return the actual OD time (in days)
*/
public double getActualODSpan() {
return actualODSpan;
......@@ -132,7 +132,7 @@ public class ODParameters extends CommentsContainer {
/**
* Set the actual OD time based on the observations available and the RECOMMENDED_OD_SPAN.
* @param actualODSpan the actual OD time
* @param actualODSpan the actual OD time (in days)
*/
public void setActualODSpan(final double actualODSpan) {
refuseFurtherComments();
......
......@@ -21,150 +21,150 @@ import org.orekit.files.ccsds.utils.ContextBinding;
import org.orekit.files.ccsds.utils.lexical.ParseToken;
import org.orekit.files.ccsds.utils.lexical.TokenType;
/** Keys for {@link CovarianceMatrix CDM covariance matrix} entries.
/** Keys for {@link RTNCovariance CDM covariance matrix} entries.