Commit 20258360 authored by Evan Ward's avatar Evan Ward

Merge 'origin/develop' into release-10.0

parents 857aece3 5235e1b7
......@@ -36,6 +36,12 @@
<action dev="evan" type="fix" issue="566">
Make ITRFVersionLoader public.
</action>
<action dev="bryan" type="fix" issue="564">
Fixed private argument of getLLimits() abstract method.
</action>
<action dev="bryan" type="fix" issue="565">
Fixed static loading of UTC for GLONASS reference epoch.
</action>
<action dev="luc" type="fix" issue="547">
Added a tile/sampling aiming direction that diverts singularity outside of a
area of interest. This is mainly useful when sampling areas of interest that
......
......@@ -272,7 +272,7 @@ public abstract class AbstractGaussianContribution implements DSSTForceModel {
final AbstractGaussianContributionContext context = initializeStep(auxiliaryElements, parameters);
double[] meanElementRate = new double[6];
// Computes the limits for the integral
final double[] ll = getLLimits(state, context);
final double[] ll = getLLimits(state, auxiliaryElements);
// Computes integrated mean element rates if Llow < Lhigh
if (ll[0] < ll[1]) {
meanElementRate = getMeanElementRate(state, integrator, ll[0], ll[1], context, parameters);
......@@ -303,7 +303,7 @@ public abstract class AbstractGaussianContribution implements DSSTForceModel {
T[] meanElementRate = MathArrays.buildArray(field, 6);
// Computes the limits for the integral
final T[] ll = getLLimits(state, context);
final T[] ll = getLLimits(state, auxiliaryElements);
// Computes integrated mean element rates if Llow < Lhigh
if (ll[0].getReal() < ll[1].getReal()) {
meanElementRate = getMeanElementRate(state, integrator, ll[0], ll[1], context, parameters);
......@@ -326,20 +326,20 @@ public abstract class AbstractGaussianContribution implements DSSTForceModel {
/** Compute the limits in L, the true longitude, for integration.
*
* @param state current state information: date, kinematics, attitude
* @param context container for attributes
* @param auxiliaryElements auxiliary elements related to the current orbit
* @return the integration limits in L
*/
protected abstract double[] getLLimits(SpacecraftState state, AbstractGaussianContributionContext context);
protected abstract double[] getLLimits(SpacecraftState state, AuxiliaryElements auxiliaryElements);
/** Compute the limits in L, the true longitude, for integration.
*
* @param <T> type of the elements
* @param state current state information: date, kinematics, attitude
* @param context container for attributes
* @param auxiliaryElements auxiliary elements related to the current orbit
* @return the integration limits in L
*/
protected abstract <T extends RealFieldElement<T>> T[] getLLimits(FieldSpacecraftState<T> state,
FieldAbstractGaussianContributionContext<T> context);
FieldAuxiliaryElements<T> auxiliaryElements);
/** Computes the mean equinoctial elements rates da<sub>i</sub> / dt.
*
......@@ -469,10 +469,10 @@ public abstract class AbstractGaussianContribution implements DSSTForceModel {
final AbstractGaussianContributionContext context = initializeStep(auxiliaryElements, parameters);
// Compute rhoj and sigmaj
final double[][] currentRhoSigmaj = computeRhoSigmaCoefficients(meanState.getDate(), context);
final double[][] currentRhoSigmaj = computeRhoSigmaCoefficients(meanState.getDate(), auxiliaryElements);
// Generate the Cij and Sij coefficients
final FourierCjSjCoefficients fourierCjSj = new FourierCjSjCoefficients(meanState, JMAX, context, parameters);
final FourierCjSjCoefficients fourierCjSj = new FourierCjSjCoefficients(meanState, JMAX, auxiliaryElements, parameters);
// Generate the Uij and Vij coefficients
final UijVijCoefficients uijvij = new UijVijCoefficients(currentRhoSigmaj, fourierCjSj, JMAX);
......@@ -506,7 +506,7 @@ public abstract class AbstractGaussianContribution implements DSSTForceModel {
final T[][] currentRhoSigmaj = computeRhoSigmaCoefficients(meanState.getDate(), context, field);
// Generate the Cij and Sij coefficients
final FieldFourierCjSjCoefficients<T> fourierCjSj = new FieldFourierCjSjCoefficients<>(meanState, JMAX, context, parameters, field);
final FieldFourierCjSjCoefficients<T> fourierCjSj = new FieldFourierCjSjCoefficients<>(meanState, JMAX, auxiliaryElements, parameters, field);
// Generate the Uij and Vij coefficients
final FieldUijVijCoefficients<T> uijvij = new FieldUijVijCoefficients<>(currentRhoSigmaj, fourierCjSj, JMAX, field);
......@@ -525,11 +525,10 @@ public abstract class AbstractGaussianContribution implements DSSTForceModel {
* σ<sub>j</sub> = (1+jB)(-b)<sup>j</sup>S<sub>j</sub>(k, h) <br/>
* </p>
* @param date current date
* @param context container for attributes
* @param auxiliaryElements auxiliary elements related to the current orbit
* @return computed coefficients
*/
private double[][] computeRhoSigmaCoefficients(final AbsoluteDate date, final AbstractGaussianContributionContext context) {
final AuxiliaryElements auxiliaryElements = context.getAuxiliaryElements();
private double[][] computeRhoSigmaCoefficients(final AbsoluteDate date, final AuxiliaryElements auxiliaryElements) {
final double[][] currentRhoSigmaj = new double[2][3 * JMAX + 1];
final CjSjCoefficient cjsjKH = new CjSjCoefficient(auxiliaryElements.getK(), auxiliaryElements.getH());
final double b = 1. / (1 + auxiliaryElements.getB());
......@@ -1779,11 +1778,11 @@ public abstract class AbstractGaussianContribution implements DSSTForceModel {
/** Standard constructor.
* @param state the current state
* @param jMax maximum value for j
* @param context container for attributes
* @param auxiliaryElements auxiliary elements related to the current orbit
* @param parameters values of the force model parameters
*/
FourierCjSjCoefficients(final SpacecraftState state, final int jMax,
final AbstractGaussianContributionContext context, final double[] parameters) {
final AuxiliaryElements auxiliaryElements, final double[] parameters) {
//Initialise the fields
this.jMax = jMax;
......@@ -1794,7 +1793,7 @@ public abstract class AbstractGaussianContribution implements DSSTForceModel {
sCoef = new double[rows][6];
//Compute the coefficients
computeCoefficients(state, context, parameters);
computeCoefficients(state, auxiliaryElements, parameters);
}
/**
......@@ -1804,15 +1803,15 @@ public abstract class AbstractGaussianContribution implements DSSTForceModel {
* as D<sub>i</sub><sup>m</sup> is always 0.
* </p>
* @param state the current state
* @param context container for attributes
* @param auxiliaryElements auxiliary elements related to the current orbit
* @param parameters values of the force model parameters
*/
private void computeCoefficients(final SpacecraftState state,
final AbstractGaussianContributionContext context,
final AuxiliaryElements auxiliaryElements,
final double[] parameters) {
// Computes the limits for the integral
final double[] ll = getLLimits(state, context);
final double[] ll = getLLimits(state, auxiliaryElements);
// Computes integrated mean element rates if Llow < Lhigh
if (ll[0] < ll[1]) {
//Compute 1 / PI
......@@ -1892,12 +1891,12 @@ public abstract class AbstractGaussianContribution implements DSSTForceModel {
/** Standard constructor.
* @param state the current state
* @param jMax maximum value for j
* @param context container for attributes
* @param auxiliaryElements auxiliary elements related to the current orbit
* @param parameters values of the force model parameters
* @param field field used by default
*/
FieldFourierCjSjCoefficients(final FieldSpacecraftState<T> state, final int jMax,
final FieldAbstractGaussianContributionContext<T> context,
final FieldAuxiliaryElements<T> auxiliaryElements,
final T[] parameters,
final Field<T> field) {
//Initialise the fields
......@@ -1909,7 +1908,7 @@ public abstract class AbstractGaussianContribution implements DSSTForceModel {
sCoef = MathArrays.buildArray(field, rows, 6);
//Compute the coefficients
computeCoefficients(state, context, parameters, field);
computeCoefficients(state, auxiliaryElements, parameters, field);
}
/**
......@@ -1919,18 +1918,18 @@ public abstract class AbstractGaussianContribution implements DSSTForceModel {
* as D<sub>i</sub><sup>m</sup> is always 0.
* </p>
* @param state the current state
* @param context container for attributes
* @param auxiliaryElements auxiliary elements related to the current orbit
* @param parameters values of the force model parameters
* @param field field used by default
*/
private void computeCoefficients(final FieldSpacecraftState<T> state,
final FieldAbstractGaussianContributionContext<T> context,
final FieldAuxiliaryElements<T> auxiliaryElements,
final T[] parameters,
final Field<T> field) {
// Zero
final T zero = field.getZero();
// Computes the limits for the integral
final T[] ll = getLLimits(state, context);
final T[] ll = getLLimits(state, auxiliaryElements);
// Computes integrated mean element rates if Llow < Lhigh
if (ll[0].getReal() < ll[1].getReal()) {
//Compute 1 / PI
......
......@@ -116,10 +116,7 @@ public class DSSTAtmosphericDrag extends AbstractGaussianContribution {
}
/** {@inheritDoc} */
protected double[] getLLimits(final SpacecraftState state, final AbstractGaussianContributionContext context) {
// AuxiliaryElements auxiliary elements related to the current orbit
final AuxiliaryElements auxiliaryElements = context.getAuxiliaryElements();
protected double[] getLLimits(final SpacecraftState state, final AuxiliaryElements auxiliaryElements) {
final double perigee = auxiliaryElements.getSma() * (1. - auxiliaryElements.getEcc());
......@@ -141,14 +138,11 @@ public class DSSTAtmosphericDrag extends AbstractGaussianContribution {
/** {@inheritDoc} */
protected <T extends RealFieldElement<T>> T[] getLLimits(final FieldSpacecraftState<T> state,
final FieldAbstractGaussianContributionContext<T> context) {
final FieldAuxiliaryElements<T> auxiliaryElements) {
final Field<T> field = state.getDate().getField();
final T zero = field.getZero();
// AuxiliaryElements auxiliary elements related to the current orbit
final FieldAuxiliaryElements<T> auxiliaryElements = context.getFieldAuxiliaryElements();
final T[] tab = MathArrays.buildArray(field, 2);
final T perigee = auxiliaryElements.getSma().multiply(auxiliaryElements.getEcc().negate().add(1.));
......
......@@ -209,10 +209,7 @@ public class DSSTSolarRadiationPressure extends AbstractGaussianContribution {
}
/** {@inheritDoc} */
protected double[] getLLimits(final SpacecraftState state, final AbstractGaussianContributionContext context) {
// AuxiliaryElements auxiliary elements related to the current orbit
final AuxiliaryElements auxiliaryElements = context.getAuxiliaryElements();
protected double[] getLLimits(final SpacecraftState state, final AuxiliaryElements auxiliaryElements) {
// Default bounds without shadow [-PI, PI]
final double[] ll = {-FastMath.PI + MathUtils.normalizeAngle(state.getLv(), 0),
......@@ -302,10 +299,7 @@ public class DSSTSolarRadiationPressure extends AbstractGaussianContribution {
/** {@inheritDoc} */
protected <T extends RealFieldElement<T>> T[] getLLimits(final FieldSpacecraftState<T> state,
final FieldAbstractGaussianContributionContext<T> context) {
// AuxiliaryElements auxiliary elements related to the current orbit
final FieldAuxiliaryElements<T> auxiliaryElements = context.getFieldAuxiliaryElements();
final FieldAuxiliaryElements<T> auxiliaryElements) {
final Field<T> field = state.getDate().getField();
final T zero = field.getZero();
......
......@@ -138,6 +138,13 @@ public class AbsoluteDate
public static final AbsoluteDate BEIDOU_EPOCH =
new AbsoluteDate(DateComponents.BEIDOU_EPOCH, TimeComponents.H00, TimeScalesFactory.getBDT());
/** Reference epoch for GLONASS four-year interval number: 1996-01-01T00:00:00 GLONASS time.
* <p>By convention, TGLONASS = UTC + 3 hours.</p>
*/
public static final AbsoluteDate GLONASS_EPOCH =
new AbsoluteDate(DateComponents.GLONASS_EPOCH,
new TimeComponents(29.0), TimeScalesFactory.getTAI()).shiftedBy(-10800.0);
/** J2000.0 Reference epoch: 2000-01-01T12:00:00 Terrestrial Time (<em>not</em> UTC).
* @see #createJulianEpoch(double)
* @see #createBesselianEpoch(double)
......@@ -396,20 +403,6 @@ public class AbsoluteDate
this.offset = offset;
}
/**
* Reference epoch for GLONASS four-year interval number: 1996-01-01T00:00:00 GLONASS
* time.
*
* <p> This is a method instead of a field like the other epochs because GLONASS
* depends on UTC so therefore calling this method requires that leap seconds are
* loaded.
*
* @return the GLONASS epoch.
*/
public static AbsoluteDate getGlonassEpoch() {
return LazyLeapHolder.GLONASS_EPOCH;
}
/** Get the reference epoch in seconds from 2000-01-01T12:00:00 TAI.
* <p>
* This method is reserved for internal used (for example by {@link FieldAbsoluteDate}).
......@@ -1037,21 +1030,4 @@ public class AbsoluteDate
return getComponents(timeZone).toString(minuteDuration);
}
/**
* Lazy loader for all fields that require leap seconds. As long as the user doesn't
* need one of these fields then they can use AbsoluteDate without loading leap
* seconds first.
*/
private static class LazyLeapHolder {
/**
* Reference epoch for GLONASS four-year interval number: 1996-01-01T00:00:00
* GLONASS time.
*/
public static final AbsoluteDate GLONASS_EPOCH = new AbsoluteDate(
DateComponents.GLONASS_EPOCH,
TimeComponents.H00,
TimeScalesFactory.getGLONASS());
}
}
......@@ -287,7 +287,7 @@ based on a classical fixed step Runge-Kutta integrator provided
by the underlying Hipparchus library.
double stepSize = 10;
FirstOrderIntegrator integrator = new ClassicalRungeKuttaIntegrator(stepSize);
AbstractIntegrator integrator = new ClassicalRungeKuttaIntegrator(stepSize);
NumericalPropagator propagator = new NumericalPropagator(integrator);
The initial state is set for this propagator:
......
......@@ -45,7 +45,8 @@ public class AbsoluteDateTest {
Assert.assertEquals(935280019000l, AbsoluteDate.GALILEO_EPOCH.toDate(tai).getTime());
Assert.assertEquals(315964819000l, AbsoluteDate.GPS_EPOCH.toDate(tai).getTime());
Assert.assertEquals(315964819000l, AbsoluteDate.QZSS_EPOCH.toDate(tai).getTime());
Assert.assertEquals(1136073633000l, AbsoluteDate.BEIDOU_EPOCH.toDate(tai).getTime());
Assert.assertEquals(1136073633000l, AbsoluteDate.BEIDOU_EPOCH.toDate(tai).getTime());
Assert.assertEquals(820443629000l, AbsoluteDate.GLONASS_EPOCH.toDate(tai).getTime());
Assert.assertEquals(946728000000l, AbsoluteDate.J2000_EPOCH.toDate(tt).getTime());
}
......@@ -67,6 +68,8 @@ public class AbsoluteDateTest {
AbsoluteDate.QZSS_EPOCH.toString(TimeScalesFactory.getUTC()));
Assert.assertEquals("2006-01-01T00:00:00.000",
AbsoluteDate.BEIDOU_EPOCH.toString(TimeScalesFactory.getUTC()));
Assert.assertEquals("1995-12-31T21:00:00.000",
AbsoluteDate.GLONASS_EPOCH.toString(TimeScalesFactory.getUTC()));
Assert.assertEquals("2000-01-01T12:00:00.000",
AbsoluteDate.J2000_EPOCH.toString(TimeScalesFactory.getTT()));
Assert.assertEquals("1970-01-01T00:00:00.000",
......
......@@ -28,6 +28,15 @@ public class GLONASSScaleTest {
private GLONASSScale glonass;
@Test
public void testT0() {
TimeScale scale = TimeScalesFactory.getGLONASS();
Assert.assertEquals("GLONASS", scale.toString());
AbsoluteDate t0 =
new AbsoluteDate(new DateComponents(1996, 1, 1), TimeComponents.H00, scale);
Assert.assertEquals(AbsoluteDate.GLONASS_EPOCH, t0);
}
@Test
public void testArbitrary() {
AbsoluteDate tGLONASS =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment