Class MagneticFieldDetector
- java.lang.Object
-
- org.orekit.propagation.events.AbstractDetector<MagneticFieldDetector>
-
- org.orekit.propagation.events.MagneticFieldDetector
-
- All Implemented Interfaces:
EventDetector
public class MagneticFieldDetector extends AbstractDetector<MagneticFieldDetector>
Detector for South-Atlantic anomaly frontier crossing.The detector is based on the value of the earth magnetic field at see level at the satellite latitude and longitude.
- Author:
- Romaric Her
-
-
Field Summary
-
Fields inherited from class org.orekit.propagation.events.AbstractDetector
DEFAULT_MAX_ITER, DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
-
-
Constructor Summary
Constructors Constructor Description MagneticFieldDetector(double maxCheck, double threshold, double limit, GeoMagneticFieldFactory.FieldModel type, OneAxisEllipsoid body, boolean seaLevel)
Build a detector.MagneticFieldDetector(double maxCheck, double threshold, double limit, GeoMagneticFieldFactory.FieldModel type, OneAxisEllipsoid body, boolean seaLevel, DataContext dataContext)
Build a detector.MagneticFieldDetector(double limit, GeoMagneticFieldFactory.FieldModel type, OneAxisEllipsoid body)
Build a new detector.MagneticFieldDetector(double limit, GeoMagneticFieldFactory.FieldModel type, OneAxisEllipsoid body, boolean seaLevel)
Build a new detector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MagneticFieldDetector
create(double newMaxCheck, double newThreshold, int newMaxIter, EventHandler<? super MagneticFieldDetector> newHandler)
Build a new instance.double
g(SpacecraftState s)
Compute the value of the detection function.void
init(SpacecraftState s0, AbsoluteDate t)
Initialize event handler at the start of a propagation.-
Methods inherited from class org.orekit.propagation.events.AbstractDetector
eventOccurred, getHandler, getMaxCheckInterval, getMaxIterationCount, getThreshold, isForward, resetState, withHandler, withMaxCheck, withMaxIter, withThreshold
-
-
-
-
Constructor Detail
-
MagneticFieldDetector
@DefaultDataContext public MagneticFieldDetector(double limit, GeoMagneticFieldFactory.FieldModel type, OneAxisEllipsoid body) throws OrekitIllegalArgumentException
Build a new detector.The new instance uses default values for maximal checking interval (
AbstractDetector.DEFAULT_MAXCHECK
) and convergence threshold (AbstractDetector.DEFAULT_THRESHOLD
).This method uses the
default data context
.- Parameters:
limit
- the threshold value of magnetic field at see level, in nano Teslastype
- the magnetic field modelbody
- the body- Throws:
OrekitIllegalArgumentException
- if orbit type isOrbitType.CARTESIAN
- See Also:
MagneticFieldDetector(double, double, double, GeoMagneticFieldFactory.FieldModel, OneAxisEllipsoid, boolean, DataContext)
-
MagneticFieldDetector
@DefaultDataContext public MagneticFieldDetector(double limit, GeoMagneticFieldFactory.FieldModel type, OneAxisEllipsoid body, boolean seaLevel) throws OrekitIllegalArgumentException
Build a new detector.The new instance uses default values for maximal checking interval (
AbstractDetector.DEFAULT_MAXCHECK
) and convergence threshold (AbstractDetector.DEFAULT_THRESHOLD
).This method uses the
default data context
.- Parameters:
limit
- the threshold value of magnetic field at see level, in nano Teslastype
- the magnetic field modelbody
- the bodyseaLevel
- true if the magnetic field intensity is computed at the sea level, false if it is computed at satellite altitude- Throws:
OrekitIllegalArgumentException
- if orbit type isOrbitType.CARTESIAN
- See Also:
MagneticFieldDetector(double, double, double, GeoMagneticFieldFactory.FieldModel, OneAxisEllipsoid, boolean, DataContext)
-
MagneticFieldDetector
@DefaultDataContext public MagneticFieldDetector(double maxCheck, double threshold, double limit, GeoMagneticFieldFactory.FieldModel type, OneAxisEllipsoid body, boolean seaLevel) throws OrekitIllegalArgumentException
Build a detector.This method uses the
default data context
.- Parameters:
maxCheck
- maximal checking interval (s)threshold
- convergence threshold (s)limit
- the threshold value of magnetic field at see level, in nano Teslastype
- the magnetic field modelbody
- the bodyseaLevel
- true if the magnetic field intensity is computed at the sea level, false if it is computed at satellite altitude- Throws:
OrekitIllegalArgumentException
- if orbit type isOrbitType.CARTESIAN
- See Also:
MagneticFieldDetector(double, double, double, GeoMagneticFieldFactory.FieldModel, OneAxisEllipsoid, boolean, DataContext)
-
MagneticFieldDetector
public MagneticFieldDetector(double maxCheck, double threshold, double limit, GeoMagneticFieldFactory.FieldModel type, OneAxisEllipsoid body, boolean seaLevel, DataContext dataContext) throws OrekitIllegalArgumentException
Build a detector.- Parameters:
maxCheck
- maximal checking interval (s)threshold
- convergence threshold (s)limit
- the threshold value of magnetic field at see level, in nano Teslastype
- the magnetic field modelbody
- the bodyseaLevel
- true if the magnetic field intensity is computed at the sea level, false if it is computed at satellite altitudedataContext
- used to look up the magnetic field model.- Throws:
OrekitIllegalArgumentException
- if orbit type isOrbitType.CARTESIAN
- Since:
- 10.1
-
-
Method Detail
-
create
protected MagneticFieldDetector create(double newMaxCheck, double newThreshold, int newMaxIter, EventHandler<? super MagneticFieldDetector> newHandler)
Build a new instance.- Specified by:
create
in classAbstractDetector<MagneticFieldDetector>
- Parameters:
newMaxCheck
- maximum checking interval (s)newThreshold
- convergence threshold (s)newMaxIter
- maximum number of iterations in the event time searchnewHandler
- event handler to call at event occurrences- Returns:
- a new instance of the appropriate sub-type
-
init
public void init(SpacecraftState s0, AbsoluteDate t)
Initialize event handler at the start of a propagation.This method is called once at the start of the propagation. It may be used by the event handler to initialize some internal data if needed.
The default implementation does nothing
This implementation sets the direction of propagation and initializes the event handler. If a subclass overrides this method it should call
super.init(s0, t)
.- Specified by:
init
in interfaceEventDetector
- Overrides:
init
in classAbstractDetector<MagneticFieldDetector>
- Parameters:
s0
- initial statet
- target time for the integration
-
g
public double g(SpacecraftState s)
Compute the value of the detection function.The value is the angle difference between the spacecraft and the fixed angle to be crossed, with some sign tweaks to ensure continuity. These tweaks imply the
increasing
flag in events detection becomes irrelevant here! As an example, the angle always increase in a Keplerian orbit, but this g function will increase and decrease so it will cross the zero value once per orbit, in increasing and decreasing directions on alternate orbits..- Specified by:
g
in interfaceEventDetector
- Specified by:
g
in classAbstractDetector<MagneticFieldDetector>
- Parameters:
s
- the current state information: date, kinematics, attitude- Returns:
- angle difference between the spacecraft and the fixed angle, with some sign tweaks to ensure continuity
-
-