Commit 6ef49f6e authored by Luc Maisonobe's avatar Luc Maisonobe

Enforce passing units to Generator.writeEntry.

parent 41165b24
......@@ -66,18 +66,18 @@ class ApmQuaternionWriter extends AbstractWriter {
// quaternion
final Quaternion q = quaternion.getQuaternion();
generator.writeEntry(ApmQuaternionKey.Q1.name(), Unit.ONE.fromSI(q.getQ1()), true);
generator.writeEntry(ApmQuaternionKey.Q2.name(), Unit.ONE.fromSI(q.getQ2()), true);
generator.writeEntry(ApmQuaternionKey.Q3.name(), Unit.ONE.fromSI(q.getQ3()), true);
generator.writeEntry(ApmQuaternionKey.QC.name(), Unit.ONE.fromSI(q.getQ0()), true);
generator.writeEntry(ApmQuaternionKey.Q1.name(), q.getQ1(), Unit.ONE, true);
generator.writeEntry(ApmQuaternionKey.Q2.name(), q.getQ2(), Unit.ONE, true);
generator.writeEntry(ApmQuaternionKey.Q3.name(), q.getQ3(), Unit.ONE, true);
generator.writeEntry(ApmQuaternionKey.QC.name(), q.getQ0(), Unit.ONE, true);
// quaternion derivative
if (quaternion.hasRates()) {
final Quaternion qDot = quaternion.getQuaternionDot();
generator.writeEntry(ApmQuaternionKey.Q1_DOT.name(), Unit.ONE.fromSI(qDot.getQ1()), true);
generator.writeEntry(ApmQuaternionKey.Q2_DOT.name(), Unit.ONE.fromSI(qDot.getQ2()), true);
generator.writeEntry(ApmQuaternionKey.Q3_DOT.name(), Unit.ONE.fromSI(qDot.getQ3()), true);
generator.writeEntry(ApmQuaternionKey.QC_DOT.name(), Unit.ONE.fromSI(qDot.getQ0()), true);
generator.writeEntry(ApmQuaternionKey.Q1_DOT.name(), qDot.getQ1(), Unit.ONE, true);
generator.writeEntry(ApmQuaternionKey.Q2_DOT.name(), qDot.getQ2(), Unit.ONE, true);
generator.writeEntry(ApmQuaternionKey.Q3_DOT.name(), qDot.getQ3(), Unit.ONE, true);
generator.writeEntry(ApmQuaternionKey.QC_DOT.name(), qDot.getQ0(), Unit.ONE, true);
}
}
......
......@@ -77,16 +77,16 @@ class EulerWriter extends AbstractWriter {
// if we don't have rates, at least we need angles
// (we may have only rates, as orientation is already given by mandatory quaternion)
final boolean needsAngles = !euler.hasRates();
generator.writeEntry(seq.charAt(0) + ANGLE, Unit.DEGREE.fromSI(angles[0]), needsAngles);
generator.writeEntry(seq.charAt(1) + ANGLE, Unit.DEGREE.fromSI(angles[1]), needsAngles);
generator.writeEntry(seq.charAt(2) + ANGLE, Unit.DEGREE.fromSI(angles[2]), needsAngles);
generator.writeEntry(seq.charAt(0) + ANGLE, angles[0], Unit.DEGREE, needsAngles);
generator.writeEntry(seq.charAt(1) + ANGLE, angles[1], Unit.DEGREE, needsAngles);
generator.writeEntry(seq.charAt(2) + ANGLE, angles[2], Unit.DEGREE, needsAngles);
// rates
if (euler.hasRates()) {
final double[] rates = euler.getRotationRates();
generator.writeEntry(seq.charAt(0) + RATE, Units.DEG_PER_S.fromSI(rates[0]), true);
generator.writeEntry(seq.charAt(1) + RATE, Units.DEG_PER_S.fromSI(rates[1]), true);
generator.writeEntry(seq.charAt(2) + RATE, Units.DEG_PER_S.fromSI(rates[2]), true);
generator.writeEntry(seq.charAt(0) + RATE, rates[0], Units.DEG_PER_S, true);
generator.writeEntry(seq.charAt(1) + RATE, rates[1], Units.DEG_PER_S, true);
generator.writeEntry(seq.charAt(2) + RATE, rates[2], Units.DEG_PER_S, true);
}
}
......
......@@ -59,16 +59,16 @@ class ManeuverWriter extends AbstractWriter {
// time
generator.writeEntry(ManeuverKey.MAN_EPOCH_START.name(), timeConverter, maneuver.getEpochStart(), true);
generator.writeEntry(ManeuverKey.MAN_DURATION.name(), Unit.SECOND.fromSI(maneuver.getDuration()), true);
generator.writeEntry(ManeuverKey.MAN_DURATION.name(), maneuver.getDuration(), Unit.SECOND, true);
// frame
generator.writeEntry(ManeuverKey.MAN_REF_FRAME.name(), maneuver.getRefFrameString(), false);
// torque
final Vector3D torque = maneuver.getTorque();
generator.writeEntry(ManeuverKey.MAN_TOR_1.name(), Units.N_M.fromSI(torque.getX()), true);
generator.writeEntry(ManeuverKey.MAN_TOR_2.name(), Units.N_M.fromSI(torque.getY()), true);
generator.writeEntry(ManeuverKey.MAN_TOR_3.name(), Units.N_M.fromSI(torque.getZ()), true);
generator.writeEntry(ManeuverKey.MAN_TOR_1.name(), torque.getX(), Units.N_M, true);
generator.writeEntry(ManeuverKey.MAN_TOR_2.name(), torque.getY(), Units.N_M, true);
generator.writeEntry(ManeuverKey.MAN_TOR_3.name(), torque.getZ(), Units.N_M, true);
}
......
......@@ -57,12 +57,12 @@ class SpacecraftParametersWriter extends AbstractWriter {
}
// inertia matrix
generator.writeEntry(SpacecraftParametersKey.I11.name(), Units.KG_M2.fromSI(spacecraftParameters.getI11()), true);
generator.writeEntry(SpacecraftParametersKey.I22.name(), Units.KG_M2.fromSI(spacecraftParameters.getI22()), true);
generator.writeEntry(SpacecraftParametersKey.I33.name(), Units.KG_M2.fromSI(spacecraftParameters.getI33()), true);
generator.writeEntry(SpacecraftParametersKey.I12.name(), Units.KG_M2.fromSI(spacecraftParameters.getI12()), true);
generator.writeEntry(SpacecraftParametersKey.I13.name(), Units.KG_M2.fromSI(spacecraftParameters.getI13()), true);
generator.writeEntry(SpacecraftParametersKey.I23.name(), Units.KG_M2.fromSI(spacecraftParameters.getI23()), true);
generator.writeEntry(SpacecraftParametersKey.I11.name(), spacecraftParameters.getI11(), Units.KG_M2, true);
generator.writeEntry(SpacecraftParametersKey.I22.name(), spacecraftParameters.getI22(), Units.KG_M2, true);
generator.writeEntry(SpacecraftParametersKey.I33.name(), spacecraftParameters.getI33(), Units.KG_M2, true);
generator.writeEntry(SpacecraftParametersKey.I12.name(), spacecraftParameters.getI12(), Units.KG_M2, true);
generator.writeEntry(SpacecraftParametersKey.I13.name(), spacecraftParameters.getI13(), Units.KG_M2, true);
generator.writeEntry(SpacecraftParametersKey.I23.name(), spacecraftParameters.getI23(), Units.KG_M2, true);
}
......
......@@ -59,15 +59,15 @@ class SpinStabilizedWriter extends AbstractWriter {
true);
// spin
generator.writeEntry(SpinStabilizedKey.SPIN_ALPHA.name(), Unit.DEGREE.fromSI(spinStabilized.getSpinAlpha()), true);
generator.writeEntry(SpinStabilizedKey.SPIN_DELTA.name(), Unit.DEGREE.fromSI(spinStabilized.getSpinDelta()), true);
generator.writeEntry(SpinStabilizedKey.SPIN_ANGLE.name(), Unit.DEGREE.fromSI(spinStabilized.getSpinAngle()), true);
generator.writeEntry(SpinStabilizedKey.SPIN_ANGLE_VEL.name(), Units.DEG_PER_S.fromSI(spinStabilized.getSpinAngleVel()), true);
generator.writeEntry(SpinStabilizedKey.SPIN_ALPHA.name(), spinStabilized.getSpinAlpha(), Unit.DEGREE, true);
generator.writeEntry(SpinStabilizedKey.SPIN_DELTA.name(), spinStabilized.getSpinDelta(), Unit.DEGREE, true);
generator.writeEntry(SpinStabilizedKey.SPIN_ANGLE.name(), spinStabilized.getSpinAngle(), Unit.DEGREE, true);
generator.writeEntry(SpinStabilizedKey.SPIN_ANGLE_VEL.name(), spinStabilized.getSpinAngleVel(), Units.DEG_PER_S, true);
// nutation
generator.writeEntry(SpinStabilizedKey.NUTATION.name(), Unit.DEGREE.fromSI(spinStabilized.getNutation()), false);
generator.writeEntry(SpinStabilizedKey.NUTATION_PER.name(), Unit.SECOND.fromSI(spinStabilized.getNutationPeriod()), false);
generator.writeEntry(SpinStabilizedKey.NUTATION_PHASE.name(), Unit.DEGREE.fromSI(spinStabilized.getNutationPhase()), false);
generator.writeEntry(SpinStabilizedKey.NUTATION.name(), spinStabilized.getNutation(), Unit.DEGREE, false);
generator.writeEntry(SpinStabilizedKey.NUTATION_PER.name(), spinStabilized.getNutationPeriod(), Unit.SECOND, false);
generator.writeEntry(SpinStabilizedKey.NUTATION_PHASE.name(), spinStabilized.getNutationPhase(), Unit.DEGREE, false);
}
......
......@@ -53,28 +53,28 @@ public class CartesianCovarianceWriter extends AbstractWriter {
// covariance block
generator.writeComments(covariance.getComments());
// note that there are no epochs in the OPM/OMM covariance matrices (but there are epochs in OEM covariance matrices)
generator.writeEntry(CartesianCovarianceKey.COV_REF_FRAME.name(), covariance.getReferenceFrame().getName(), false);
generator.writeEntry(CartesianCovarianceKey.CX_X.name(), Units.KM2.fromSI(matrix.getEntry(0, 0)), true);
generator.writeEntry(CartesianCovarianceKey.CY_X.name(), Units.KM2.fromSI(matrix.getEntry(1, 0)), true);
generator.writeEntry(CartesianCovarianceKey.CY_Y.name(), Units.KM2.fromSI(matrix.getEntry(1, 1)), true);
generator.writeEntry(CartesianCovarianceKey.CZ_X.name(), Units.KM2.fromSI(matrix.getEntry(2, 0)), true);
generator.writeEntry(CartesianCovarianceKey.CZ_Y.name(), Units.KM2.fromSI(matrix.getEntry(2, 1)), true);
generator.writeEntry(CartesianCovarianceKey.CZ_Z.name(), Units.KM2.fromSI(matrix.getEntry(2, 2)), true);
generator.writeEntry(CartesianCovarianceKey.CX_DOT_X.name(), Units.KM2_PER_S.fromSI(matrix.getEntry(3, 0)), true);
generator.writeEntry(CartesianCovarianceKey.CX_DOT_Y.name(), Units.KM2_PER_S.fromSI(matrix.getEntry(3, 1)), true);
generator.writeEntry(CartesianCovarianceKey.CX_DOT_Z.name(), Units.KM2_PER_S.fromSI(matrix.getEntry(3, 2)), true);
generator.writeEntry(CartesianCovarianceKey.CX_DOT_X_DOT.name(), Units.KM2_PER_S2.fromSI(matrix.getEntry(3, 3)), true);
generator.writeEntry(CartesianCovarianceKey.CY_DOT_X.name(), Units.KM2_PER_S.fromSI(matrix.getEntry(4, 0)), true);
generator.writeEntry(CartesianCovarianceKey.CY_DOT_Y.name(), Units.KM2_PER_S.fromSI(matrix.getEntry(4, 1)), true);
generator.writeEntry(CartesianCovarianceKey.CY_DOT_Z.name(), Units.KM2_PER_S.fromSI(matrix.getEntry(4, 2)), true);
generator.writeEntry(CartesianCovarianceKey.CY_DOT_X_DOT.name(), Units.KM2_PER_S2.fromSI(matrix.getEntry(4, 3)), true);
generator.writeEntry(CartesianCovarianceKey.CY_DOT_Y_DOT.name(), Units.KM2_PER_S2.fromSI(matrix.getEntry(4, 4)), true);
generator.writeEntry(CartesianCovarianceKey.CZ_DOT_X.name(), Units.KM2_PER_S.fromSI(matrix.getEntry(5, 0)), true);
generator.writeEntry(CartesianCovarianceKey.CZ_DOT_Y.name(), Units.KM2_PER_S.fromSI(matrix.getEntry(5, 1)), true);
generator.writeEntry(CartesianCovarianceKey.CZ_DOT_Z.name(), Units.KM2_PER_S.fromSI(matrix.getEntry(5, 2)), true);
generator.writeEntry(CartesianCovarianceKey.CZ_DOT_X_DOT.name(), Units.KM2_PER_S2.fromSI(matrix.getEntry(5, 3)), true);
generator.writeEntry(CartesianCovarianceKey.CZ_DOT_Y_DOT.name(), Units.KM2_PER_S2.fromSI(matrix.getEntry(5, 4)), true);
generator.writeEntry(CartesianCovarianceKey.CZ_DOT_Z_DOT.name(), Units.KM2_PER_S2.fromSI(matrix.getEntry(5, 5)), true);
generator.writeEntry(CartesianCovarianceKey.COV_REF_FRAME.name(), covariance.getReferenceFrame().getName(), false);
generator.writeEntry(CartesianCovarianceKey.CX_X.name(), matrix.getEntry(0, 0), Units.KM2, true);
generator.writeEntry(CartesianCovarianceKey.CY_X.name(), matrix.getEntry(1, 0), Units.KM2, true);
generator.writeEntry(CartesianCovarianceKey.CY_Y.name(), matrix.getEntry(1, 1), Units.KM2, true);
generator.writeEntry(CartesianCovarianceKey.CZ_X.name(), matrix.getEntry(2, 0), Units.KM2, true);
generator.writeEntry(CartesianCovarianceKey.CZ_Y.name(), matrix.getEntry(2, 1), Units.KM2, true);
generator.writeEntry(CartesianCovarianceKey.CZ_Z.name(), matrix.getEntry(2, 2), Units.KM2, true);
generator.writeEntry(CartesianCovarianceKey.CX_DOT_X.name(), matrix.getEntry(3, 0), Units.KM2_PER_S, true);
generator.writeEntry(CartesianCovarianceKey.CX_DOT_Y.name(), matrix.getEntry(3, 1), Units.KM2_PER_S, true);
generator.writeEntry(CartesianCovarianceKey.CX_DOT_Z.name(), matrix.getEntry(3, 2), Units.KM2_PER_S, true);
generator.writeEntry(CartesianCovarianceKey.CX_DOT_X_DOT.name(), matrix.getEntry(3, 3), Units.KM2_PER_S2, true);
generator.writeEntry(CartesianCovarianceKey.CY_DOT_X.name(), matrix.getEntry(4, 0), Units.KM2_PER_S, true);
generator.writeEntry(CartesianCovarianceKey.CY_DOT_Y.name(), matrix.getEntry(4, 1), Units.KM2_PER_S, true);
generator.writeEntry(CartesianCovarianceKey.CY_DOT_Z.name(), matrix.getEntry(4, 2), Units.KM2_PER_S, true);
generator.writeEntry(CartesianCovarianceKey.CY_DOT_X_DOT.name(), matrix.getEntry(4, 3), Units.KM2_PER_S2, true);
generator.writeEntry(CartesianCovarianceKey.CY_DOT_Y_DOT.name(), matrix.getEntry(4, 4), Units.KM2_PER_S2, true);
generator.writeEntry(CartesianCovarianceKey.CZ_DOT_X.name(), matrix.getEntry(5, 0), Units.KM2_PER_S, true);
generator.writeEntry(CartesianCovarianceKey.CZ_DOT_Y.name(), matrix.getEntry(5, 1), Units.KM2_PER_S, true);
generator.writeEntry(CartesianCovarianceKey.CZ_DOT_Z.name(), matrix.getEntry(5, 2), Units.KM2_PER_S, true);
generator.writeEntry(CartesianCovarianceKey.CZ_DOT_X_DOT.name(), matrix.getEntry(5, 3), Units.KM2_PER_S2, true);
generator.writeEntry(CartesianCovarianceKey.CZ_DOT_Y_DOT.name(), matrix.getEntry(5, 4), Units.KM2_PER_S2, true);
generator.writeEntry(CartesianCovarianceKey.CZ_DOT_Z_DOT.name(), matrix.getEntry(5, 5), Units.KM2_PER_S2, true);
}
......
......@@ -52,25 +52,15 @@ public class SpacecraftParametersWriter extends AbstractWriter {
generator.writeComments(spacecraftParameters.getComments());
// mass
generator.writeEntry(SpacecraftParametersKey.MASS.name(),
Unit.KILOGRAM.fromSI(spacecraftParameters.getMass()),
false);
generator.writeEntry(SpacecraftParametersKey.MASS.name(), spacecraftParameters.getMass(), Unit.KILOGRAM, false);
// solar parameters
generator.writeEntry(SpacecraftParametersKey.SOLAR_RAD_AREA.name(),
Units.M2.fromSI(spacecraftParameters.getSolarRadArea()),
false);
generator.writeEntry(SpacecraftParametersKey.SOLAR_RAD_COEFF.name(),
Unit.ONE.fromSI(spacecraftParameters.getSolarRadCoeff()),
false);
generator.writeEntry(SpacecraftParametersKey.SOLAR_RAD_AREA.name(), spacecraftParameters.getSolarRadArea(), Units.M2, false);
generator.writeEntry(SpacecraftParametersKey.SOLAR_RAD_COEFF.name(), spacecraftParameters.getSolarRadCoeff(), Unit.ONE, false);
// drag parameters
generator.writeEntry(SpacecraftParametersKey.DRAG_AREA.name(),
Units.M2.fromSI(spacecraftParameters.getDragArea()),
false);
generator.writeEntry(SpacecraftParametersKey.DRAG_COEFF.name(),
Unit.ONE.fromSI(spacecraftParameters.getDragCoeff()),
false);
generator.writeEntry(SpacecraftParametersKey.DRAG_AREA.name(), spacecraftParameters.getDragArea(), Units.M2, false);
generator.writeEntry(SpacecraftParametersKey.DRAG_COEFF.name(), spacecraftParameters.getDragCoeff(), Unit.ONE, false);
}
......
......@@ -58,12 +58,12 @@ public class StateVectorWriter extends AbstractWriter {
final TimeStampedPVCoordinates pv = stateVector.toTimeStampedPVCoordinates();
generator.writeComments(stateVector.getComments());
generator.writeEntry(StateVectorKey.EPOCH.name(), timeConverter, pv.getDate(), true);
generator.writeEntry(StateVectorKey.X.name(), Unit.KILOMETRE.fromSI(pv.getPosition().getX()), true);
generator.writeEntry(StateVectorKey.Y.name(), Unit.KILOMETRE.fromSI(pv.getPosition().getY()), true);
generator.writeEntry(StateVectorKey.Z.name(), Unit.KILOMETRE.fromSI(pv.getPosition().getZ()), true);
generator.writeEntry(StateVectorKey.X_DOT.name(), Unit.KILOMETRE.fromSI(pv.getVelocity().getX()), true);
generator.writeEntry(StateVectorKey.Y_DOT.name(), Unit.KILOMETRE.fromSI(pv.getVelocity().getY()), true);
generator.writeEntry(StateVectorKey.Z_DOT.name(), Unit.KILOMETRE.fromSI(pv.getVelocity().getZ()), true);
generator.writeEntry(StateVectorKey.X.name(), pv.getPosition().getX(), Unit.KILOMETRE, true);
generator.writeEntry(StateVectorKey.Y.name(), pv.getPosition().getY(), Unit.KILOMETRE, true);
generator.writeEntry(StateVectorKey.Z.name(), pv.getPosition().getZ(), Unit.KILOMETRE, true);
generator.writeEntry(StateVectorKey.X_DOT.name(), pv.getVelocity().getX(), Unit.KILOMETRE, true);
generator.writeEntry(StateVectorKey.Y_DOT.name(), pv.getVelocity().getY(), Unit.KILOMETRE, true);
generator.writeEntry(StateVectorKey.Z_DOT.name(), pv.getVelocity().getZ(), Unit.KILOMETRE, true);
// note that OPM format does not use X_DDOT, Y_DDOT, Z_DDOT, they are used only in OEM format
}
......
......@@ -71,9 +71,9 @@ class CovarianceHistoryWriter extends AbstractWriter {
generator.writeEntry(CovarianceHistoryMetadataKey.COV_FRAME_EPOCH.name(), timeConverter, metadata.getCovFrameEpoch(), false);
// scaling
generator.writeEntry(CovarianceHistoryMetadataKey.COV_SCALE_MIN.name(), Unit.ONE.fromSI(metadata.getCovScaleMin()), false);
generator.writeEntry(CovarianceHistoryMetadataKey.COV_SCALE_MAX.name(), Unit.ONE.fromSI(metadata.getCovScaleMax()), false);
generator.writeEntry(CovarianceHistoryMetadataKey.COV_CONFIDENCE.name(), Unit.PERCENT.fromSI(metadata.getCovConfidence()), false);
generator.writeEntry(CovarianceHistoryMetadataKey.COV_SCALE_MIN.name(), metadata.getCovScaleMin(), Unit.ONE, false);
generator.writeEntry(CovarianceHistoryMetadataKey.COV_SCALE_MAX.name(), metadata.getCovScaleMax(), Unit.ONE, false);
generator.writeEntry(CovarianceHistoryMetadataKey.COV_CONFIDENCE.name(), metadata.getCovConfidence(), Unit.PERCENT, false);
// elements
generator.writeEntry(CovarianceHistoryMetadataKey.COV_TYPE.name(), metadata.getCovType(), false);
......
......@@ -78,16 +78,16 @@ class ManeuverHistoryWriter extends AbstractWriter {
generator.writeEntry(ManeuverHistoryMetadataKey.GRAV_ASSIST_NAME.name(), metadata.getGravitationalAssist().getName(), false);
// duty cycle
generator.writeEntry(ManeuverHistoryMetadataKey.DC_TYPE.name(), metadata.getDcType(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_WIN_OPEN.name(), timeConverter, metadata.getDcWindowOpen(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_WIN_CLOSE.name(), timeConverter, metadata.getDcWindowClose(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_MIN_CYCLES.name(), metadata.getDcMinCycles(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_MAX_CYCLES.name(), metadata.getDcMaxCycles(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_EXEC_START.name(), timeConverter, metadata.getDcExecStart(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_EXEC_STOP.name(), timeConverter, metadata.getDcExecStop(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_REF_TIME.name(), timeConverter, metadata.getDcRefTime(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_TIME_PULSE_DURATION.name(), Unit.SECOND.fromSI(metadata.getDcTimePulseDuration()), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_TIME_PULSE_PERIOD.name(), Unit.SECOND.fromSI(metadata.getDcTimePulsePeriod()), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_TYPE.name(), metadata.getDcType(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_WIN_OPEN.name(), timeConverter, metadata.getDcWindowOpen(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_WIN_CLOSE.name(), timeConverter, metadata.getDcWindowClose(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_MIN_CYCLES.name(), metadata.getDcMinCycles(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_MAX_CYCLES.name(), metadata.getDcMaxCycles(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_EXEC_START.name(), timeConverter, metadata.getDcExecStart(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_EXEC_STOP.name(), timeConverter, metadata.getDcExecStop(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_REF_TIME.name(), timeConverter, metadata.getDcRefTime(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_TIME_PULSE_DURATION.name(), metadata.getDcTimePulseDuration(), Unit.SECOND, false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_TIME_PULSE_PERIOD.name(), metadata.getDcTimePulsePeriod(), Unit.SECOND, false);
if (metadata.getDcRefDir() != null) {
final StringBuilder value = new StringBuilder();
value.append(AccurateFormatter.format(Unit.ONE.fromSI(metadata.getDcRefDir().getX())));
......@@ -102,8 +102,8 @@ class ManeuverHistoryWriter extends AbstractWriter {
metadata.getDcBodyFrame().toString().replace(' ', '_'),
false);
}
generator.writeEntry(ManeuverHistoryMetadataKey.DC_PA_START_ANGLE.name(), Unit.DEGREE.fromSI(metadata.getDcPhaseStartAngle()), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_PA_STOP_ANGLE.name(), Unit.DEGREE.fromSI(metadata.getDcPhaseStopAngle()), false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_PA_START_ANGLE.name(), metadata.getDcPhaseStartAngle(), Unit.DEGREE, false);
generator.writeEntry(ManeuverHistoryMetadataKey.DC_PA_STOP_ANGLE.name(), metadata.getDcPhaseStopAngle(), Unit.DEGREE, false);
// elements
final List<ManeuverFieldType> types = metadata.getManComposition();
......
......@@ -137,10 +137,8 @@ class OcmMetadataWriter extends AbstractWriter {
metadata.getOcmDataElements(), false);
// other times
generator.writeEntry(OcmMetadataKey.SCLK_OFFSET_AT_EPOCH.name(),
Unit.SECOND.fromSI(metadata.getSclkOffsetAtEpoch()), false);
generator.writeEntry(OcmMetadataKey.SCLK_SEC_PER_SI_SEC.name(),
Unit.SECOND.fromSI(metadata.getSclkSecPerSISec()), false);
generator.writeEntry(OcmMetadataKey.SCLK_OFFSET_AT_EPOCH.name(), metadata.getSclkOffsetAtEpoch(), Unit.SECOND, false);
generator.writeEntry(OcmMetadataKey.SCLK_SEC_PER_SI_SEC.name(), metadata.getSclkSecPerSISec(), Unit.SECOND, false);
generator.writeEntry(OcmMetadataKey.PREVIOUS_MESSAGE_EPOCH.name(), timeConverter,
metadata.getPreviousMessageEpoch(), false);
generator.writeEntry(OcmMetadataKey.NEXT_MESSAGE_EPOCH.name(), timeConverter,
......@@ -149,12 +147,9 @@ class OcmMetadataWriter extends AbstractWriter {
metadata.getStartTime(), false);
generator.writeEntry(OcmMetadataKey.STOP_TIME.name(), timeConverter,
metadata.getStopTime(), false);
generator.writeEntry(OcmMetadataKey.TIME_SPAN.name(),
Unit.DAY.fromSI(metadata.getTimeSpan()), false);
generator.writeEntry(OcmMetadataKey.TAIMUTC_AT_TZERO.name(),
Unit.SECOND.fromSI(metadata.getTaimutcT0()), false);
generator.writeEntry(OcmMetadataKey.UT1MUTC_AT_TZERO.name(),
Unit.SECOND.fromSI(metadata.getUt1mutcT0()), false);
generator.writeEntry(OcmMetadataKey.TIME_SPAN.name(), metadata.getTimeSpan(), Unit.DAY, false);
generator.writeEntry(OcmMetadataKey.TAIMUTC_AT_TZERO.name(), metadata.getTaimutcT0(), Unit.SECOND, false);
generator.writeEntry(OcmMetadataKey.UT1MUTC_AT_TZERO.name(), metadata.getUt1mutcT0(), Unit.SECOND, false);
// data sources
generator.writeEntry(OcmMetadataKey.EOP_SOURCE.name(),
......
......@@ -60,27 +60,27 @@ class OrbitDeterminationWriter extends AbstractWriter {
generator.writeEntry(OrbitDeterminationKey.OD_METHOD.name(), od.getMethod().getName(), false);
// time
generator.writeEntry(OrbitDeterminationKey.OD_EPOCH.name(), timeConverter, od.getEpoch(), false);
generator.writeEntry(OrbitDeterminationKey.DAYS_SINCE_FIRST_OBS.name(), Unit.DAY.fromSI(od.getTimeSinceFirstObservation()), false);
generator.writeEntry(OrbitDeterminationKey.DAYS_SINCE_LAST_OBS.name(), Unit.DAY.fromSI(od.getTimeSinceLastObservation()), false);
generator.writeEntry(OrbitDeterminationKey.RECOMMENDED_OD_SPAN.name(), Unit.DAY.fromSI(od.getRecommendedOdSpan()), false);
generator.writeEntry(OrbitDeterminationKey.ACTUAL_OD_SPAN.name(), Unit.DAY.fromSI(od.getActualOdSpan()), false);
generator.writeEntry(OrbitDeterminationKey.OD_EPOCH.name(), timeConverter, od.getEpoch(), false);
generator.writeEntry(OrbitDeterminationKey.DAYS_SINCE_FIRST_OBS.name(), od.getTimeSinceFirstObservation(), Unit.DAY, false);
generator.writeEntry(OrbitDeterminationKey.DAYS_SINCE_LAST_OBS.name(), od.getTimeSinceLastObservation(), Unit.DAY, false);
generator.writeEntry(OrbitDeterminationKey.RECOMMENDED_OD_SPAN.name(), od.getRecommendedOdSpan(), Unit.DAY, false);
generator.writeEntry(OrbitDeterminationKey.ACTUAL_OD_SPAN.name(), od.getActualOdSpan(), Unit.DAY, false);
// counters
generator.writeEntry(OrbitDeterminationKey.OBS_AVAILABLE.name(), od.getObsAvailable(), false);
generator.writeEntry(OrbitDeterminationKey.OBS_USED.name(), od.getObsUsed(), false);
generator.writeEntry(OrbitDeterminationKey.TRACKS_AVAILABLE.name(), od.getTracksAvailable(), false);
generator.writeEntry(OrbitDeterminationKey.TRACKS_USED.name(), od.getTracksUsed(), false);
generator.writeEntry(OrbitDeterminationKey.MAXIMUM_OBS_GAP.name(), Unit.DAY.fromSI(od.getMaximumObsGap()), false);
generator.writeEntry(OrbitDeterminationKey.OBS_AVAILABLE.name(), od.getObsAvailable(), false);
generator.writeEntry(OrbitDeterminationKey.OBS_USED.name(), od.getObsUsed(), false);
generator.writeEntry(OrbitDeterminationKey.TRACKS_AVAILABLE.name(), od.getTracksAvailable(), false);
generator.writeEntry(OrbitDeterminationKey.TRACKS_USED.name(), od.getTracksUsed(), false);
generator.writeEntry(OrbitDeterminationKey.MAXIMUM_OBS_GAP.name(), od.getMaximumObsGap(), Unit.DAY, false);
// errors
generator.writeEntry(OrbitDeterminationKey.OD_EPOCH_EIGMAJ.name(), Unit.METRE.fromSI(od.getEpochEigenMaj()), false);
generator.writeEntry(OrbitDeterminationKey.OD_EPOCH_EIGMED.name(), Unit.METRE.fromSI(od.getEpochEigenMed()), false);
generator.writeEntry(OrbitDeterminationKey.OD_EPOCH_EIGMIN.name(), Unit.METRE.fromSI(od.getEpochEigenMin()), false);
generator.writeEntry(OrbitDeterminationKey.OD_MAX_PRED_EIGMAJ.name(), Unit.METRE.fromSI(od.getMaxPredictedEigenMaj()), false);
generator.writeEntry(OrbitDeterminationKey.OD_MIN_PRED_EIGMIN.name(), Unit.METRE.fromSI(od.getMinPredictedEigenMaj()), false);
generator.writeEntry(OrbitDeterminationKey.OD_CONFIDENCE.name(), Unit.PERCENT.fromSI(od.getConfidence()), false);
generator.writeEntry(OrbitDeterminationKey.GDOP.name(), Unit.ONE.fromSI(od.getGdop()), false);
generator.writeEntry(OrbitDeterminationKey.OD_EPOCH_EIGMAJ.name(), od.getEpochEigenMaj(), Unit.METRE, false);
generator.writeEntry(OrbitDeterminationKey.OD_EPOCH_EIGMED.name(), od.getEpochEigenMed(), Unit.METRE, false);
generator.writeEntry(OrbitDeterminationKey.OD_EPOCH_EIGMIN.name(), od.getEpochEigenMin(), Unit.METRE, false);
generator.writeEntry(OrbitDeterminationKey.OD_MAX_PRED_EIGMAJ.name(), od.getMaxPredictedEigenMaj(), Unit.METRE, false);
generator.writeEntry(OrbitDeterminationKey.OD_MIN_PRED_EIGMIN.name(), od.getMinPredictedEigenMaj(), Unit.METRE, false);
generator.writeEntry(OrbitDeterminationKey.OD_CONFIDENCE.name(), od.getConfidence(), Unit.PERCENT, false);
generator.writeEntry(OrbitDeterminationKey.GDOP.name(), od.getGdop(), Unit.ONE, false);
// parameters
generator.writeEntry(OrbitDeterminationKey.SOLVE_N.name(), od.getSolveN(), false);
......@@ -91,8 +91,8 @@ class OrbitDeterminationWriter extends AbstractWriter {
generator.writeEntry(OrbitDeterminationKey.SENSORS.name(), od.getSensors(), false);
// observations
generator.writeEntry(OrbitDeterminationKey.WEIGHTED_RMS.name(), Unit.ONE.fromSI(od.getWeightedRms()), false);
generator.writeEntry(OrbitDeterminationKey.DATA_TYPES.name(), od.getDataTypes(), false);
generator.writeEntry(OrbitDeterminationKey.WEIGHTED_RMS.name(), od.getWeightedRms(), Unit.ONE, false);
generator.writeEntry(OrbitDeterminationKey.DATA_TYPES.name(), od.getDataTypes(), false);
}
......
......@@ -73,8 +73,8 @@ class PerturbationsWriter extends AbstractWriter {
toString();
generator.writeEntry(PerturbationsKey.GRAVITY_MODEL.name(), model, false);
}
generator.writeEntry(PerturbationsKey.EQUATORIAL_RADIUS.name(), Unit.KILOMETRE.fromSI(perturbations.getEquatorialRadius()), false);
generator.writeEntry(PerturbationsKey.GM.name(), Units.KM3_PER_S2.fromSI(perturbations.getGm()), false);
generator.writeEntry(PerturbationsKey.EQUATORIAL_RADIUS.name(), perturbations.getEquatorialRadius(), Unit.KILOMETRE, false);
generator.writeEntry(PerturbationsKey.GM.name(), perturbations.getGm(), Units.KM3_PER_S2, false);
if (perturbations.getNBodyPerturbations() != null && !perturbations.getNBodyPerturbations().isEmpty()) {
final List<String> names = new ArrayList<>();
for (BodyFacade bf : perturbations.getNBodyPerturbations()) {
......@@ -82,11 +82,11 @@ class PerturbationsWriter extends AbstractWriter {
}
generator.writeEntry(PerturbationsKey.N_BODY_PERTURBATIONS.name(), names, false);
}
generator.writeEntry(PerturbationsKey.CENTRAL_BODY_ROTATION.name(), Units.DEG_PER_S.fromSI(perturbations.getCentralBodyRotation()), false);
generator.writeEntry(PerturbationsKey.OBLATE_FLATTENING.name(), Unit.ONE.fromSI(perturbations.getOblateFlattening()), false);
generator.writeEntry(PerturbationsKey.OCEAN_TIDES_MODEL.name(), perturbations.getOceanTidesModel(), false);
generator.writeEntry(PerturbationsKey.SOLID_TIDES_MODEL.name(), perturbations.getSolidTidesModel(), false);
generator.writeEntry(PerturbationsKey.REDUCTION_THEORY.name(), perturbations.getReductionTheory(), false);
generator.writeEntry(PerturbationsKey.CENTRAL_BODY_ROTATION.name(), perturbations.getCentralBodyRotation(), Units.DEG_PER_S, false);
generator.writeEntry(PerturbationsKey.OBLATE_FLATTENING.name(), perturbations.getOblateFlattening(), Unit.ONE, false);
generator.writeEntry(PerturbationsKey.OCEAN_TIDES_MODEL.name(), perturbations.getOceanTidesModel(), false);
generator.writeEntry(PerturbationsKey.SOLID_TIDES_MODEL.name(), perturbations.getSolidTidesModel(), false);
generator.writeEntry(PerturbationsKey.REDUCTION_THEORY.name(), perturbations.getReductionTheory(), false);
// radiation
generator.writeEntry(PerturbationsKey.ALBEDO_MODEL.name(), perturbations.getAlbedoModel(), false);
......@@ -102,20 +102,20 @@ class PerturbationsWriter extends AbstractWriter {
generator.writeEntry(PerturbationsKey.SRP_MODEL.name(), perturbations.getSrpModel(), false);
// data source
generator.writeEntry(PerturbationsKey.SW_DATA_SOURCE.name(), perturbations.getSpaceWeatherSource(), false);
generator.writeEntry(PerturbationsKey.SW_DATA_EPOCH.name(), timeConverter, perturbations.getSpaceWeatherEpoch(), false);
generator.writeEntry(PerturbationsKey.SW_INTERP_METHOD.name(), perturbations.getInterpMethodSW(), false);
generator.writeEntry(PerturbationsKey.FIXED_GEOMAG_KP.name(), Units.NANO_TESLA.fromSI(perturbations.getFixedGeomagneticKp()), false);
generator.writeEntry(PerturbationsKey.FIXED_GEOMAG_AP.name(), Units.NANO_TESLA.fromSI(perturbations.getFixedGeomagneticAp()), false);
generator.writeEntry(PerturbationsKey.FIXED_GEOMAG_DST.name(), Units.NANO_TESLA.fromSI(perturbations.getFixedGeomagneticDst()), false);
generator.writeEntry(PerturbationsKey.FIXED_F10P7.name(), Unit.SOLAR_FLUX_UNIT.fromSI(perturbations.getFixedF10P7()), false);
generator.writeEntry(PerturbationsKey.FIXED_F10P7_MEAN.name(), Unit.SOLAR_FLUX_UNIT.fromSI(perturbations.getFixedF10P7Mean()), false);
generator.writeEntry(PerturbationsKey.FIXED_M10P7.name(), Unit.SOLAR_FLUX_UNIT.fromSI(perturbations.getFixedM10P7()), false);
generator.writeEntry(PerturbationsKey.FIXED_M10P7_MEAN.name(), Unit.SOLAR_FLUX_UNIT.fromSI(perturbations.getFixedM10P7Mean()), false);
generator.writeEntry(PerturbationsKey.FIXED_S10P7.name(), Unit.SOLAR_FLUX_UNIT.fromSI(perturbations.getFixedS10P7()), false);
generator.writeEntry(PerturbationsKey.FIXED_S10P7_MEAN.name(), Unit.SOLAR_FLUX_UNIT.fromSI(perturbations.getFixedS10P7Mean()), false);
generator.writeEntry(PerturbationsKey.FIXED_Y10P7.name(), Unit.SOLAR_FLUX_UNIT.fromSI(perturbations.getFixedY10P7()), false);
generator.writeEntry(PerturbationsKey.FIXED_Y10P7_MEAN.name(), Unit.SOLAR_FLUX_UNIT.fromSI(perturbations.getFixedY10P7Mean()), false);
generator.writeEntry(PerturbationsKey.SW_DATA_SOURCE.name(), perturbations.getSpaceWeatherSource(), false);
generator.writeEntry(PerturbationsKey.SW_DATA_EPOCH.name(), timeConverter, perturbations.getSpaceWeatherEpoch(), false);
generator.writeEntry(PerturbationsKey.SW_INTERP_METHOD.name(), perturbations.getInterpMethodSW(), false);
generator.writeEntry(PerturbationsKey.FIXED_GEOMAG_KP.name(), perturbations.getFixedGeomagneticKp(), Units.NANO_TESLA, false);
generator.writeEntry(PerturbationsKey.FIXED_GEOMAG_AP.name(), perturbations.getFixedGeomagneticAp(), Units.NANO_TESLA, false);
generator.writeEntry(PerturbationsKey.FIXED_GEOMAG_DST.name(), perturbations.getFixedGeomagneticDst(), Units.NANO_TESLA, false);
generator.writeEntry(PerturbationsKey.FIXED_F10P7.name(), perturbations.getFixedF10P7(), Unit.SOLAR_FLUX_UNIT, false);
generator.writeEntry(PerturbationsKey.FIXED_F10P7_MEAN.name(), perturbations.getFixedF10P7Mean(), Unit.SOLAR_FLUX_UNIT, false);
generator.writeEntry(PerturbationsKey.FIXED_M10P7.name(), perturbations.getFixedM10P7(), Unit.SOLAR_FLUX_UNIT, false);
generator.writeEntry(PerturbationsKey.FIXED_M10P7_MEAN.name(), perturbations.getFixedM10P7Mean(), Unit.SOLAR_FLUX_UNIT, false);
generator.writeEntry(PerturbationsKey.FIXED_S10P7.name(), perturbations.getFixedS10P7(), Unit.SOLAR_FLUX_UNIT, false);
generator.writeEntry(PerturbationsKey.FIXED_S10P7_MEAN.name(), perturbations.getFixedS10P7Mean(), Unit.SOLAR_FLUX_UNIT, false);
generator.writeEntry(PerturbationsKey.FIXED_Y10P7.name(), perturbations.getFixedY10P7(), Unit.SOLAR_FLUX_UNIT, false);
generator.writeEntry(PerturbationsKey.FIXED_Y10P7_MEAN.name(), perturbations.getFixedY10P7Mean(), Unit.SOLAR_FLUX_UNIT, false);
}
......
......@@ -60,73 +60,73 @@ class PhysicalPropertiesWriter extends AbstractWriter {
generator.writeEntry(PhysicalPropertiesKey.DOCKED_WITH.name(), phys.getDockedWith(), false);
// drag
generator.writeEntry(PhysicalPropertiesKey.DRAG_CONST_AREA.name(), Units.M2.fromSI(phys.getDragConstantArea()), false);
generator.writeEntry(PhysicalPropertiesKey.DRAG_COEFF_NOM.name(), Unit.ONE.fromSI(phys.getNominalDragCoefficient()), false);
generator.writeEntry(PhysicalPropertiesKey.DRAG_UNCERTAINTY.name(), Unit.PERCENT.fromSI(phys.getDragUncertainty()), false);
generator.writeEntry(PhysicalPropertiesKey.DRAG_CONST_AREA.name(), phys.getDragConstantArea(), Units.M2, false);
generator.writeEntry(PhysicalPropertiesKey.DRAG_COEFF_NOM.name(), phys.getNominalDragCoefficient(), Unit.ONE, false);
generator.writeEntry(PhysicalPropertiesKey.DRAG_UNCERTAINTY.name(), phys.getDragUncertainty(), Unit.PERCENT, false);
// mass
generator.writeEntry(PhysicalPropertiesKey.INITIAL_WET_MASS.name(), Unit.KILOGRAM.fromSI(phys.getInitialWetMass()), false);
generator.writeEntry(PhysicalPropertiesKey.WET_MASS.name(), Unit.KILOGRAM.fromSI(phys.getWetMass()), false);
generator.writeEntry(PhysicalPropertiesKey.DRY_MASS.name(), Unit.KILOGRAM.fromSI(phys.getDryMass()), false);
generator.writeEntry(PhysicalPropertiesKey.INITIAL_WET_MASS.name(), phys.getInitialWetMass(), Unit.KILOGRAM, false);
generator.writeEntry(PhysicalPropertiesKey.WET_MASS.name(), phys.getWetMass(), Unit.KILOGRAM, false);
generator.writeEntry(PhysicalPropertiesKey.DRY_MASS.name(), phys.getDryMass(), Unit.KILOGRAM, false);
// Optimally Enclosing Box
generator.writeEntry(PhysicalPropertiesKey.OEB_PARENT_FRAME.name(), phys.getOebParentFrame().getName(), false);
generator.writeEntry(PhysicalPropertiesKey.OEB_PARENT_FRAME_EPOCH.name(), timeConverter, phys.getOebParentFrameEpoch(), false);
generator.writeEntry(PhysicalPropertiesKey.OEB_Q1.name(), Unit.ONE.fromSI(phys.getOebQ().getQ1()), false);
generator.writeEntry(PhysicalPropertiesKey.OEB_Q2.name(), Unit.ONE.fromSI(phys.getOebQ().getQ2()), false);
generator.writeEntry(PhysicalPropertiesKey.OEB_Q3.name(), Unit.ONE.fromSI(phys.getOebQ().getQ3()), false);
generator.writeEntry(PhysicalPropertiesKey.OEB_QC.name(), Unit.ONE.fromSI(phys.getOebQ().getQ0()), false);
generator.writeEntry(PhysicalPropertiesKey.OEB_MAX.name(), Unit.METRE.fromSI(phys.getOebMax()), false);
generator.writeEntry(PhysicalPropertiesKey.OEB_INT.name(), Unit.METRE.fromSI(phys.getOebIntermediate()), false);
generator.writeEntry(PhysicalPropertiesKey.OEB_MIN.name(), Unit.METRE.fromSI(phys.getOebMin()), false);
generator.writeEntry(PhysicalPropertiesKey.AREA_ALONG_OEB_MAX.name(), Units.M2.fromSI(phys.getOebAreaAlongMax()), false);
generator.writeEntry(PhysicalPropertiesKey.AREA_ALONG_OEB_INT.name(), Units.M2.fromSI(phys.getOebAreaAlongIntermediate()), false);
generator.writeEntry(PhysicalPropertiesKey.AREA_ALONG_OEB_MIN.name(), Units.M2.fromSI(phys.getOebAreaAlongMin()), false);
generator.writeEntry(PhysicalPropertiesKey.OEB_PARENT_FRAME.name(), phys.getOebParentFrame().getName(), false);
generator.writeEntry(PhysicalPropertiesKey.OEB_PARENT_FRAME_EPOCH.name(), timeConverter, phys.getOebParentFrameEpoch(), false);
generator.writeEntry(PhysicalPropertiesKey.OEB_Q1.name(), phys.getOebQ().getQ1(), Unit.ONE, false);
generator.writeEntry(PhysicalPropertiesKey.OEB_Q2.name(), phys.getOebQ().getQ2(), Unit.ONE, false);
generator.writeEntry(PhysicalPropertiesKey.OEB_Q3.name(), phys.getOebQ().getQ3(), Unit.ONE, false);
generator.writeEntry(PhysicalPropertiesKey.OEB_QC.name(), phys.getOebQ().getQ0(), Unit.ONE, false);
generator.writeEntry(PhysicalPropertiesKey.OEB_MAX.name(), phys.getOebMax(), Unit.METRE, false);
generator.writeEntry(PhysicalPropertiesKey.OEB_INT.name(), phys.getOebIntermediate(), Unit.METRE, false);
generator.writeEntry(PhysicalPropertiesKey.OEB_MIN.name(), phys.getOebMin(), Unit.METRE, false);
generator.writeEntry(PhysicalPropertiesKey.AREA_ALONG_OEB_MAX.name(), phys.getOebAreaAlongMax(), Units.M2, false);
generator.writeEntry(PhysicalPropertiesKey.AREA_ALONG_OEB_INT.name(), phys.getOebAreaAlongIntermediate(), Units.M2, false);
generator.writeEntry(PhysicalPropertiesKey.AREA_ALONG_OEB_MIN.name(), phys.getOebAreaAlongMin(), Units.M2, false);
// collision probability