public class EclipseDetector extends AbstractDetector<EclipseDetector>
This class finds eclipse events, i.e. satellite within umbra (total eclipse) or penumbra (partial eclipse).
The occulted body is given through a PVCoordinatesProvider
and its radius in meters. It is modeled as a sphere.
Since v10.0 the occulting body is a OneAxisEllipsoid
, before it was modeled as a sphere.
It was changed to precisely model Solar eclipses by the Earth, especially for Low Earth Orbits.
If you want eclipses by a spherical occulting body, set its flattening to 0. when defining its OneAxisEllipsoid model..
The withUmbra()
or withPenumbra()
methods will tell you if the event is triggered when complete umbra/lighting
is achieved or when entering/living the penumbra zone.
The default behavior is detecting complete umbra/lighting events.
If you want to have both, you'll need to set up two distinct detectors.
The default implementation behavior is to continue
propagation when entering the eclipse and to stop
propagation
when exiting the eclipse.
This can be changed by calling AbstractDetector.withHandler(EventHandler)
after construction.
Propagator.addEventDetector(EventDetector)
DEFAULT_MAX_ITER, DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
Modifier | Constructor and Description |
---|---|
protected |
EclipseDetector(AdaptableInterval maxCheck,
double threshold,
int maxIter,
EventHandler handler,
OccultationEngine occultationEngine,
double margin,
boolean totalEclipse)
Protected constructor with full parameters.
|
|
EclipseDetector(ExtendedPVCoordinatesProvider occulted,
double occultedRadius,
OneAxisEllipsoid occulting)
Build a new eclipse detector.
|
|
EclipseDetector(OccultationEngine occultationEngine)
Build a new eclipse detector.
|
Modifier and Type | Method and Description |
---|---|
protected EclipseDetector |
create(AdaptableInterval newMaxCheck,
double newThreshold,
int nawMaxIter,
EventHandler newHandler)
Build a new instance.
|
double |
g(SpacecraftState s)
Compute the value of the switching function.
|
double |
getMargin()
Get the angular margin used for eclipse detection.
|
OccultationEngine |
getOccultationEngine()
Get the occultation engine.
|
boolean |
getTotalEclipse()
Get the total eclipse detection flag.
|
EclipseDetector |
withMargin(double newMargin)
Setup a margin to angle detection.
|
EclipseDetector |
withPenumbra()
Setup the detector to penumbra detection.
|
EclipseDetector |
withUmbra()
Setup the detector to full umbra detection.
|
getHandler, getMaxCheckInterval, getMaxIterationCount, getThreshold, init, isForward, withHandler, withMaxCheck, withMaxCheck, withMaxIter, withThreshold
public EclipseDetector(ExtendedPVCoordinatesProvider occulted, double occultedRadius, OneAxisEllipsoid occulting)
The new instance is a total eclipse (umbra) detector with default
values for maximal checking interval (AbstractDetector.DEFAULT_MAXCHECK
)
and convergence threshold (AbstractDetector.DEFAULT_THRESHOLD
).
occulted
- the body to be occultedoccultedRadius
- the radius of the body to be occulted (m)occulting
- the occulting bodypublic EclipseDetector(OccultationEngine occultationEngine)
The new instance is a total eclipse (umbra) detector with default
values for maximal checking interval (AbstractDetector.DEFAULT_MAXCHECK
)
and convergence threshold (AbstractDetector.DEFAULT_THRESHOLD
).
occultationEngine
- occultation engineprotected EclipseDetector(AdaptableInterval maxCheck, double threshold, int maxIter, EventHandler handler, OccultationEngine occultationEngine, double margin, boolean totalEclipse)
This constructor is not public as users are expected to use the builder
API with the various withXxx()
methods to set up the instance
in a readable manner without using a huge amount of parameters.
maxCheck
- maximum checking intervalthreshold
- convergence threshold (s)maxIter
- maximum number of iterations in the event time searchhandler
- event handler to call at event occurrencesoccultationEngine
- occultation enginemargin
- to apply to eclipse angle (rad)totalEclipse
- umbra (true) or penumbra (false) detection flagprotected EclipseDetector create(AdaptableInterval newMaxCheck, double newThreshold, int nawMaxIter, EventHandler newHandler)
create
in class AbstractDetector<EclipseDetector>
newMaxCheck
- maximum checking interval (s)newThreshold
- convergence threshold (s)nawMaxIter
- maximum number of iterations in the event time searchnewHandler
- event handler to call at event occurrencespublic EclipseDetector withUmbra()
This will override a penumbra/umbra flag if it has been configured previously.
withPenumbra()
public EclipseDetector withPenumbra()
This will override a penumbra/umbra flag if it has been configured previously.
withUmbra()
public EclipseDetector withMargin(double newMargin)
A positive margin implies eclipses are "larger" hence entry occurs earlier and exit occurs later than a detector with 0 margin.
newMargin
- angular margin to apply to eclipse detection (rad)public double getMargin()
public OccultationEngine getOccultationEngine()
public boolean getTotalEclipse()
public double g(SpacecraftState s)
g
in interface EventDetector
g
in class AbstractDetector<EclipseDetector>
s
- the current state information: date, kinematics, attitudeCopyright © 2002-2023 CS GROUP. All rights reserved.