Commit 3d4107ea authored by Luc Maisonobe's avatar Luc Maisonobe

Merge branch 'issue-366' into develop

parents 4b5c7307 ff80c506
......@@ -26,6 +26,7 @@ import org.orekit.forces.radiation.RadiationSensitive;
import org.orekit.forces.radiation.SolarRadiationPressure;
import org.orekit.propagation.SpacecraftState;
import org.orekit.propagation.events.EventDetector;
import org.orekit.utils.ExtendedPVCoordinatesProvider;
import org.orekit.utils.PVCoordinatesProvider;
/** Solar radiation pressure contribution to the
......@@ -52,6 +53,9 @@ public class DSSTSolarRadiationPressure extends AbstractGaussianContribution {
/** Threshold for shadow equation. */
private static final double S_ZERO = 1.0e-6;
/** Prefix for the coefficient keys. */
private static final String PREFIX = "DSST-SRP-";
/** Sun model. */
private final PVCoordinatesProvider sun;
......@@ -76,13 +80,41 @@ public class DSSTSolarRadiationPressure extends AbstractGaussianContribution {
* </p>
*
* @param cr satellite radiation pressure coefficient (assuming total specular reflection)
* @param area cross sectionnal area of satellite
* @param area cross sectional area of satellite
* @param sun Sun model
* @param equatorialRadius central body equatorial radius (for shadow computation)
* @deprecated as of 9.2 replaced by {@link #DSSTSolarRadiationPressure(double, double,
* ExtendedPVCoordinatesProvider, double)}
*/
@Deprecated
public DSSTSolarRadiationPressure(final double cr, final double area,
final PVCoordinatesProvider sun,
final double equatorialRadius) {
final PVCoordinatesProvider sun,
final double equatorialRadius) {
this(D_REF, P_REF, cr, area, sun, equatorialRadius);
}
/**
* Simple constructor with default reference values and spherical spacecraft.
* <p>
* When this constructor is used, the reference values are:
* </p>
* <ul>
* <li>d<sub>ref</sub> = 149597870000.0 m</li>
* <li>p<sub>ref</sub> = 4.56 10<sup>-6</sup> N/m²</li>
* </ul>
* <p>
* The spacecraft has a spherical shape.
* </p>
*
* @param cr satellite radiation pressure coefficient (assuming total specular reflection)
* @param area cross sectional area of satellite
* @param sun Sun model
* @param equatorialRadius central body equatorial radius (for shadow computation)
* @since 9.2
*/
public DSSTSolarRadiationPressure(final double cr, final double area,
final ExtendedPVCoordinatesProvider sun,
final double equatorialRadius) {
this(D_REF, P_REF, cr, area, sun, equatorialRadius);
}
......@@ -99,13 +131,67 @@ public class DSSTSolarRadiationPressure extends AbstractGaussianContribution {
* @param sun Sun model
* @param equatorialRadius central body equatorial radius (for shadow computation)
* @param spacecraft spacecraft model
* @deprecated as of 9.2 replaced by {{@link #DSSTSolarRadiationPressure(ExtendedPVCoordinatesProvider,
* double, RadiationSensitive)}
*/
public DSSTSolarRadiationPressure(final PVCoordinatesProvider sun,
final double equatorialRadius,
final RadiationSensitive spacecraft) {
final double equatorialRadius,
final RadiationSensitive spacecraft) {
this(D_REF, P_REF, sun, equatorialRadius, spacecraft);
}
/**
* Simple constructor with default reference values, but custom spacecraft.
* <p>
* When this constructor is used, the reference values are:
* </p>
* <ul>
* <li>d<sub>ref</sub> = 149597870000.0 m</li>
* <li>p<sub>ref</sub> = 4.56 10<sup>-6</sup> N/m²</li>
* </ul>
*
* @param sun Sun model
* @param equatorialRadius central body equatorial radius (for shadow computation)
* @param spacecraft spacecraft model
* @since 9.2
*/
public DSSTSolarRadiationPressure(final ExtendedPVCoordinatesProvider sun,
final double equatorialRadius,
final RadiationSensitive spacecraft) {
this(D_REF, P_REF, sun, equatorialRadius, spacecraft);
}
/**
* Constructor with customizable reference values but spherical spacecraft.
* <p>
* Note that reference solar radiation pressure <code>pRef</code> in N/m² is linked
* to solar flux SF in W/m² using formula pRef = SF/c where c is the speed of light
* (299792458 m/s). So at 1UA a 1367 W/m² solar flux is a 4.56 10<sup>-6</sup>
* N/m² solar radiation pressure.
* </p>
*
* @param dRef reference distance for the solar radiation pressure (m)
* @param pRef reference solar radiation pressure at dRef (N/m²)
* @param cr satellite radiation pressure coefficient (assuming total specular reflection)
* @param area cross sectional area of satellite
* @param sun Sun model
* @param equatorialRadius central body equatorial radius (for shadow computation)
* @deprecated as of 9.2 replaced by {@link #DSSTSolarRadiationPressure(double, double,
* double, double, ExtendedPVCoordinatesProvider, double)
*/
@Deprecated
public DSSTSolarRadiationPressure(final double dRef, final double pRef,
final double cr, final double area,
final PVCoordinatesProvider sun,
final double equatorialRadius) {
// cR being the DSST SRP coef and assuming a spherical spacecraft,
// the conversion is:
// cR = 1 + (1 - kA) * (1 - kR) * 4 / 9
// with kA arbitrary sets to 0
this(dRef, pRef, sun, equatorialRadius, new IsotropicRadiationSingleCoefficient(area, cr));
}
/**
* Constructor with customizable reference values but spherical spacecraft.
* <p>
......@@ -118,14 +204,15 @@ public class DSSTSolarRadiationPressure extends AbstractGaussianContribution {
* @param dRef reference distance for the solar radiation pressure (m)
* @param pRef reference solar radiation pressure at dRef (N/m²)
* @param cr satellite radiation pressure coefficient (assuming total specular reflection)
* @param area cross sectionnal area of satellite
* @param area cross sectional area of satellite
* @param sun Sun model
* @param equatorialRadius central body equatrial radius (for shadow computation)
* @param equatorialRadius central body equatorial radius (for shadow computation)
* @since 9.2
*/
public DSSTSolarRadiationPressure(final double dRef, final double pRef,
final double cr, final double area,
final PVCoordinatesProvider sun,
final double equatorialRadius) {
final double cr, final double area,
final ExtendedPVCoordinatesProvider sun,
final double equatorialRadius) {
// cR being the DSST SRP coef and assuming a spherical spacecraft,
// the conversion is:
......@@ -146,15 +233,48 @@ public class DSSTSolarRadiationPressure extends AbstractGaussianContribution {
* @param dRef reference distance for the solar radiation pressure (m)
* @param pRef reference solar radiation pressure at dRef (N/m²)
* @param sun Sun model
* @param equatorialRadius central body equatrial radius (for shadow computation)
* @param equatorialRadius central body equatorial radius (for shadow computation)
* @param spacecraft spacecraft model
* @deprecated as of 9.2 replaced by {@link #DSSTSolarRadiationPressure(double, double,
* ExtendedPVCoordinatesProvider, double, RadiationSensitive)
*/
@Deprecated
public DSSTSolarRadiationPressure(final double dRef, final double pRef,
final PVCoordinatesProvider sun, final double equatorialRadius,
final RadiationSensitive spacecraft) {
//Call to the constructor from superclass using the numerical SRP model as ForceModel
super(PREFIX, GAUSS_THRESHOLD,
new SolarRadiationPressure(dRef, pRef, sun, equatorialRadius, spacecraft));
this.sun = sun;
this.ae = equatorialRadius;
this.spacecraft = spacecraft;
}
/**
* Complete constructor.
* <p>
* Note that reference solar radiation pressure <code>pRef</code> in N/m² is linked
* to solar flux SF in W/m² using formula pRef = SF/c where c is the speed of light
* (299792458 m/s). So at 1UA a 1367 W/m² solar flux is a 4.56 10<sup>-6</sup>
* N/m² solar radiation pressure.
* </p>
*
* @param dRef reference distance for the solar radiation pressure (m)
* @param pRef reference solar radiation pressure at dRef (N/m²)
* @param sun Sun model
* @param equatorialRadius central body equatorial radius (for shadow computation)
* @param spacecraft spacecraft model
* @since 9.2
*/
public DSSTSolarRadiationPressure(final double dRef, final double pRef,
final PVCoordinatesProvider sun, final double equatorialRadius,
final RadiationSensitive spacecraft) {
final ExtendedPVCoordinatesProvider sun,
final double equatorialRadius,
final RadiationSensitive spacecraft) {
//Call to the constructor from superclass using the numerical SRP model as ForceModel
super("DSST-SRP-", GAUSS_THRESHOLD,
super(PREFIX, GAUSS_THRESHOLD,
new SolarRadiationPressure(dRef, pRef, sun, equatorialRadius, spacecraft));
this.sun = sun;
......
......@@ -17,6 +17,7 @@
package org.orekit.utils;
import org.hipparchus.Field;
import org.hipparchus.RealFieldElement;
import org.orekit.errors.OrekitException;
import org.orekit.frames.Frame;
......@@ -29,6 +30,15 @@ import org.orekit.time.FieldAbsoluteDate;
*/
public interface ExtendedPVCoordinatesProvider extends PVCoordinatesProvider {
/** Convert to a {@link FieldPVCoordinatesProvider} with a specific type.
* @param <T> the type of the field elements
* @param field field for the argument and value
* @return converted function
*/
default <T extends RealFieldElement<T>> FieldPVCoordinatesProvider<T> toFieldPVCoordinatesProvider(Field<T> field) {
return this::getPVCoordinates;
}
/** Get the {@link FieldPVCoordinates} of the body in the selected frame.
* @param date current date
* @param frame the frame where to define the position
......
......@@ -21,12 +21,16 @@
</properties>
<body>
<release version="9.2" date="TBD" description="TBD">
<action dev="luc" type="fix">
Fixed missing eclipse detectors in field version of Solar radiation pressure.
Fixes issue #366.
</action>
<action dev="evan" type="fix">
Fixed issue where EventHandler.init() was never called.
Fixes issue #471.
</action>
<action dev="luc" type="fix">
Fixed error in relative humidity units in Marini-Marray tropospheric model.
Fixed error in relative humidity units in Marini-Murray tropospheric model.
Fixes issue #352.
</action>
<action dev="luc" type="fix">
......
......@@ -72,6 +72,7 @@ import org.orekit.time.FieldAbsoluteDate;
import org.orekit.time.TimeComponents;
import org.orekit.time.TimeScalesFactory;
import org.orekit.utils.Constants;
import org.orekit.utils.ExtendedPVCoordinatesProvider;
import org.orekit.utils.FieldPVCoordinates;
import org.orekit.utils.IERSConventions;
import org.orekit.utils.PVCoordinates;
......@@ -133,7 +134,7 @@ public class SolarRadiationPressureTest extends AbstractLegacyForceModelTest {
Orbit orbit = new KeplerianOrbit(1.0e11, 0.1, 0.2, 0.3, 0.4, 0.5, PositionAngle.TRUE,
CelestialBodyFactory.getSolarSystemBarycenter().getInertiallyOrientedFrame(),
date, Constants.JPL_SSD_SUN_GM);
PVCoordinatesProvider sun = CelestialBodyFactory.getSun();
ExtendedPVCoordinatesProvider sun = CelestialBodyFactory.getSun();
SolarRadiationPressure srp =
new SolarRadiationPressure(sun, Constants.SUN_RADIUS,
(RadiationSensitive) new IsotropicRadiationClassicalConvention(50.0, 0.5, 0.5));
......@@ -161,7 +162,7 @@ public class SolarRadiationPressureTest extends AbstractLegacyForceModelTest {
Orbit orbit = new EquinoctialOrbit(42164000, 10e-3, 10e-3,
FastMath.tan(0.001745329)*FastMath.cos(2*FastMath.PI/3), FastMath.tan(0.001745329)*FastMath.sin(2*FastMath.PI/3),
0.1, PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
PVCoordinatesProvider sun = CelestialBodyFactory.getSun();
ExtendedPVCoordinatesProvider sun = CelestialBodyFactory.getSun();
OneAxisEllipsoid earth =
new OneAxisEllipsoid(6378136.46, 1.0 / 298.25765,
FramesFactory.getITRF(IERSConventions.IERS_2010, true));
......@@ -534,7 +535,7 @@ public class SolarRadiationPressureTest extends AbstractLegacyForceModelTest {
0.1, PositionAngle.TRUE, FramesFactory.getEME2000(), date, mu);
final double period = orbit.getKeplerianPeriod();
Assert.assertEquals(86164, period, 1);
PVCoordinatesProvider sun = CelestialBodyFactory.getSun();
ExtendedPVCoordinatesProvider sun = CelestialBodyFactory.getSun();
// creation of the force model
OneAxisEllipsoid earth =
......@@ -636,7 +637,7 @@ public class SolarRadiationPressureTest extends AbstractLegacyForceModelTest {
NP.setOrbitType(type);
NP.setInitialState(iSR);
PVCoordinatesProvider sun = CelestialBodyFactory.getSun();
ExtendedPVCoordinatesProvider sun = CelestialBodyFactory.getSun();
// creation of the force model
OneAxisEllipsoid earth =
......@@ -792,7 +793,7 @@ public class SolarRadiationPressureTest extends AbstractLegacyForceModelTest {
NumericalPropagator NP = new NumericalPropagator(RIntegrator);
NP.setInitialState(iSR);
PVCoordinatesProvider sun = CelestialBodyFactory.getSun();
ExtendedPVCoordinatesProvider sun = CelestialBodyFactory.getSun();
// creation of the force model
OneAxisEllipsoid earth =
......@@ -867,7 +868,7 @@ public class SolarRadiationPressureTest extends AbstractLegacyForceModelTest {
NP.setOrbitType(type);
NP.setInitialState(iSR);
PVCoordinatesProvider sun = CelestialBodyFactory.getSun();
ExtendedPVCoordinatesProvider sun = CelestialBodyFactory.getSun();
// creation of the force model
OneAxisEllipsoid earth =
......
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