fr.cnes.sirius.patrius.events.sensor
Class SatToSatMutualVisibilityDetector

java.lang.Object
  extended by org.orekit.propagation.events.AbstractDetector
      extended by fr.cnes.sirius.patrius.events.sensor.SatToSatMutualVisibilityDetector
All Implemented Interfaces:
Serializable, EventDetector, MultiEventDetector

public class SatToSatMutualVisibilityDetector
extends AbstractDetector
implements MultiEventDetector

Mutual spacecraft visibility detector : the g function is positive only if each spacecraft is in the main field of view of the other one's sensor. In a single spacecraft propagation mode (Propagator), this event detector shall be used in the propagation of a main spacecraft, and will use internally a given propagator to get the position of the secondary spacecraft.

The default implementation behavior is to continue propagation when entering the visibility zone and to stop propagation when exiting the visibility zone.

This detector could be used in single spacecraft propagation mode, using the following constructors :

or in multi spacecraft propagation mode, using the following constructors : If the wrong constructor is used, an exception will be raised during propagation.

Since:
1.2
Version:
$Id: SatToSatMutualVisibilityDetector.java 17586 2017-05-10 13:29:16Z bignon $
Author:
Thomas Trapier
See Also:
Serialized Form
Concurrency :
not thread-safe
Concurrency comment :
the direct use of a not thread-safe Assembly makes this class not thread-safe itself

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.orekit.propagation.events.EventDetector
EventDetector.Action
 
Field Summary
 
Fields inherited from class org.orekit.propagation.events.AbstractDetector
DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
 
Fields inherited from interface org.orekit.propagation.events.multi.MultiEventDetector
DECREASING, INCREASING, INCREASING_DECREASING
 
Fields inherited from interface org.orekit.propagation.events.EventDetector
DECREASING, INCREASING, INCREASING_DECREASING
 
Constructor Summary
SatToSatMutualVisibilityDetector(SensorModel mainSensorModel, SensorModel secondarySensorModel, Propagator secondSpacecraftPropagator, boolean withMasking, double maxCheck, double threshold)
           Constructor to be used for single spacecraft propagation only (Propagator).
SatToSatMutualVisibilityDetector(SensorModel mainSensorModel, SensorModel secondarySensorModel, Propagator secondSpacecraftPropagator, boolean withMasking, double maxCheck, double threshold, EventDetector.Action entry, EventDetector.Action exit)
          Constructor to be used for single spacecraft propagation only (Propagator).
SatToSatMutualVisibilityDetector(SensorModel mainSensorModel, SensorModel secondarySensorModel, Propagator secondSpacecraftPropagator, boolean withMasking, double maxCheck, double threshold, EventDetector.Action entry, EventDetector.Action exit, boolean removeEntry, boolean removeExit)
          Constructor to be used for single spacecraft propagation only (Propagator).
SatToSatMutualVisibilityDetector(String mainSpacecraftId, String secondarySpacecraftId, SensorModel mainSensorModel, SensorModel secondarySensorModel, boolean withMasking, double maxCheck, double threshold)
          Constructor to be used for multi spacecraft propagation only ( MultiPropagator).
SatToSatMutualVisibilityDetector(String mainSpacecraftId, String secondarySpacecraftId, SensorModel mainSensorModel, SensorModel secondarySensorModel, boolean withMasking, double maxCheck, double threshold, EventDetector.Action entry, EventDetector.Action exit)
          Constructor to be used for multi spacecraft propagation only ( MultiPropagator).
SatToSatMutualVisibilityDetector(String mainSpacecraftId, String secondarySpacecraftId, SensorModel mainSensorModel, SensorModel secondarySensorModel, boolean withMasking, double maxCheck, double threshold, EventDetector.Action entry, EventDetector.Action exit, boolean removeEntry, boolean removeExit)
          Constructor to be used for multi-spacecraft propagation only ( MultiPropagator).
 
Method Summary
 EventDetector.Action eventOccurred(Map<String,SpacecraftState> s, boolean increasing, boolean forward)
          Handle an event and choose what to do next.
 EventDetector.Action eventOccurred(SpacecraftState s, boolean increasing, boolean forward)
          Handle an event and choose what to do next.
 double g(Map<String,SpacecraftState> s)
          Compute the value of the switching function.
 double g(SpacecraftState s)
          Compute the value of the switching function.
 String getInMainSpacecraftId()
          Get the main spacecraft id.
 String getInSecondarySpacecraftId()
          Get the secondary spacecraft id.
 Assembly getMainSpacecraft()
          Get the main assembly to consider.
 Assembly getSecondarySpacecraft()
          Get the secondary assembly to consider.
 SensorModel getSensorMainSpacecraft()
          Get the main spacecraft sensor.
 SensorModel getSensorSecondarySpacecraft()
          Get the secondary spacecraft sensor.
 void init(Map<String,SpacecraftState> s0, AbsoluteDate t)
          Initialize event handler at the start of a propagation.
 void init(SpacecraftState s0, AbsoluteDate t)
          Initialize event handler at the start of a propagation.
 boolean isMaskingCheck()
          Check maskings.
 Map<String,SpacecraftState> resetStates(Map<String,SpacecraftState> oldStates)
          Reset the states (including additional states) prior to continue propagation.
 boolean shouldBeRemoved()
          This method is called after EventDetector.eventOccurred(org.orekit.propagation.SpacecraftState, boolean, boolean) has been triggered.
 
Methods inherited from class org.orekit.propagation.events.AbstractDetector
getMaxCheckInterval, getMaxIterationCount, getSlopeSelection, getThreshold, resetState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.orekit.propagation.events.multi.MultiEventDetector
getMaxCheckInterval, getMaxIterationCount, getSlopeSelection, getThreshold
 

Constructor Detail

SatToSatMutualVisibilityDetector

public SatToSatMutualVisibilityDetector(SensorModel mainSensorModel,
                                        SensorModel secondarySensorModel,
                                        Propagator secondSpacecraftPropagator,
                                        boolean withMasking,
                                        double maxCheck,
                                        double threshold)

Constructor to be used for single spacecraft propagation only (Propagator). Constructor for the mutual spacecraft to spacecraft visibility detector.

The default implementation behavior is to continue propagation when entering the visibility zone and to stop propagation when exiting the visibility zone.

Parameters:
mainSensorModel - the sensor model to consider for the main spacecraft. The secondary sensor model must be its main target !
secondarySensorModel - the sensor model to consider for the secondary spacecraft. The main sensor model must be its main target !
secondSpacecraftPropagator - the propagator for the secondary spacecraft
withMasking - set true to compute maskings of each spacecrafts' sensors : in this case, there is no visibility if one of the masking bodies of both sensors is between the satellites.
maxCheck - maximum checking interval (s)
threshold - convergence threshold (s)

SatToSatMutualVisibilityDetector

public SatToSatMutualVisibilityDetector(SensorModel mainSensorModel,
                                        SensorModel secondarySensorModel,
                                        Propagator secondSpacecraftPropagator,
                                        boolean withMasking,
                                        double maxCheck,
                                        double threshold,
                                        EventDetector.Action entry,
                                        EventDetector.Action exit)
Constructor to be used for single spacecraft propagation only (Propagator). Constructor for the mutual spacecraft to spacecraft visibility detector.

Parameters:
mainSensorModel - the sensor model to consider for the main spacecraft. The secondary sensor model must be its main target !
secondarySensorModel - the sensor model to consider for the secondary spacecraft. The main sensor model must be its main target !
secondSpacecraftPropagator - the propagator for the secondary spacecraft
withMasking - set true to compute maskings of each spacecrafts' sensors : in this case, there is no visibility if one of the masking bodies of both sensors is between the satellites.
maxCheck - maximum checking interval (s)
threshold - convergence threshold (s)
entry - action performed when entering the visibility zone
exit - action performed when exiting the visibility zone

SatToSatMutualVisibilityDetector

public SatToSatMutualVisibilityDetector(SensorModel mainSensorModel,
                                        SensorModel secondarySensorModel,
                                        Propagator secondSpacecraftPropagator,
                                        boolean withMasking,
                                        double maxCheck,
                                        double threshold,
                                        EventDetector.Action entry,
                                        EventDetector.Action exit,
                                        boolean removeEntry,
                                        boolean removeExit)
Constructor to be used for single spacecraft propagation only (Propagator). Constructor for the mutual spacecraft to spacecraft visibility detector.

Parameters:
mainSensorModel - the sensor model to consider for the main spacecraft. The secondary sensor model must be its main target
secondarySensorModel - the sensor model to consider for the secondary spacecraft. The main sensor model must be its main target
secondSpacecraftPropagator - the propagator for the secondary spacecraft
withMasking - true to compute maskings of each spacecrafts' sensors : in this case, there is no visibility if one of the masking bodies of both sensors is between the satellites.
maxCheck - maximum checking interval (s)
threshold - convergence threshold (s)
entry - action performed when entering the visibility zone
exit - action performed when exiting the visibility zone
removeEntry - true if entering the visibility zone
removeExit - true if exiting the visibility zone
Since:
3.1

SatToSatMutualVisibilityDetector

public SatToSatMutualVisibilityDetector(String mainSpacecraftId,
                                        String secondarySpacecraftId,
                                        SensorModel mainSensorModel,
                                        SensorModel secondarySensorModel,
                                        boolean withMasking,
                                        double maxCheck,
                                        double threshold)
Constructor to be used for multi spacecraft propagation only ( MultiPropagator). Constructor for the mutual spacecraft to spacecraft visibility detector.

The default implementation behavior is to continue propagation when entering the visibility zone and to stop propagation when exiting the visibility zone.

Parameters:
mainSpacecraftId - id of the main spacecraft
secondarySpacecraftId - id of the secondary spacecraft
mainSensorModel - the sensor model to consider for the main spacecraft. The secondary sensor model must be its main target !
secondarySensorModel - the sensor model to consider for the secondary spacecraft. The main sensor model must be its main target !
withMasking - set true to compute maskings of each spacecrafts' sensors : in this case, there is no visibility if one of the masking bodies of both sensors is between the satellites.
maxCheck - maximum checking interval (s)
threshold - convergence threshold (s)
Since:
3.0

SatToSatMutualVisibilityDetector

public SatToSatMutualVisibilityDetector(String mainSpacecraftId,
                                        String secondarySpacecraftId,
                                        SensorModel mainSensorModel,
                                        SensorModel secondarySensorModel,
                                        boolean withMasking,
                                        double maxCheck,
                                        double threshold,
                                        EventDetector.Action entry,
                                        EventDetector.Action exit)
Constructor to be used for multi spacecraft propagation only ( MultiPropagator). Constructor for the mutual spacecraft to spacecraft visibility detector.

Parameters:
mainSpacecraftId - id of the main spacecraft
secondarySpacecraftId - id of the secondary spacecraft
mainSensorModel - the sensor model to consider for the main spacecraft. The secondary sensor model must be its main target !
secondarySensorModel - the sensor model to consider for the secondary spacecraft. The main sensor model must be its main target !
withMasking - set true to compute maskings of each spacecrafts' sensors : in this case, there is no visibility if one of the masking bodies of both sensors is between the satellites.
maxCheck - maximum checking interval (s)
threshold - convergence threshold (s)
entry - action performed when entering the visibility zone
exit - action performed when exiting the visibility zone
Since:
3.0

SatToSatMutualVisibilityDetector

public SatToSatMutualVisibilityDetector(String mainSpacecraftId,
                                        String secondarySpacecraftId,
                                        SensorModel mainSensorModel,
                                        SensorModel secondarySensorModel,
                                        boolean withMasking,
                                        double maxCheck,
                                        double threshold,
                                        EventDetector.Action entry,
                                        EventDetector.Action exit,
                                        boolean removeEntry,
                                        boolean removeExit)
Constructor to be used for multi-spacecraft propagation only ( MultiPropagator). Constructor for the mutual spacecraft to spacecraft visibility detector.

Parameters:
mainSpacecraftId - id of the main spacecraft
secondarySpacecraftId - id of the secondary spacecraft
mainSensorModel - the sensor model to consider for the main spacecraft. The secondary sensor model must be its main target
secondarySensorModel - the sensor model to consider for the secondary spacecraft. The main sensor model must be its main target
withMasking - true to compute maskings of each spacecrafts' sensors : in this case, there is no visibility if one of the masking bodies of both sensors is between the satellites.
maxCheck - maximum checking interval (s)
threshold - convergence threshold (s)
entry - action performed when entering the visibility zone
exit - action performed when exiting the visibility zone
removeEntry - true if entering the visibility zone.
removeExit - true if exiting the visibility zone.
Since:
3.1
Method Detail

init

public void init(SpacecraftState s0,
                 AbsoluteDate t)
Description copied from class: AbstractDetector
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.

Specified by:
init in interface EventDetector
Overrides:
init in class AbstractDetector
Parameters:
s0 - initial state
t - target time for the integration

eventOccurred

public EventDetector.Action eventOccurred(SpacecraftState s,
                                          boolean increasing,
                                          boolean forward)
                                   throws OrekitException
Description copied from class: AbstractDetector
Handle an event and choose what to do next.

The scheduling between this method and the OrekitStepHandler method handleStep(interpolator, isLast) is to call this method first and handleStep afterwards. This scheduling allows the propagator to pass true as the isLast parameter to the step handler to make it aware the step will be the last one if this method returns EventDetector.Action.STOP. As the interpolator may be used to navigate back throughout the last step (as OrekitStepNormalizer does for example), user code called by this method and user code called by step handlers may experience apparently out of order values of the independent time variable. As an example, if the same user object implements both this EventDetector interface and the OrekitFixedStepHandler interface, a forward integration may call its eventOccurred method with a state at 2000-01-01T00:00:10 first and call its handleStep method with a state at 2000-01-01T00:00:09 afterwards. Such out of order calls are limited to the size of the integration step for variable step handlers and to the size of the fixed step for fixed step handlers.

Specified by:
eventOccurred in interface EventDetector
Specified by:
eventOccurred in class AbstractDetector
Parameters:
s - the current state information: date, kinematics, attitude for forces and events computation, mass provider, and additional states
increasing - if true, the value of the switching function increases when times increases around event (note that increase is measured with respect to physical time, not with respect to propagation which may go backward in time)
forward - if true, the integration variable (time) increases during integration.
Returns:
one of EventDetector.Action.STOP, EventDetector.Action.RESET_STATE, EventDetector.Action.RESET_DERIVATIVES, EventDetector.Action.CONTINUE
Throws:
OrekitException - if some specific error occurs

g

public double g(SpacecraftState s)
         throws OrekitException
Description copied from class: AbstractDetector
Compute the value of the switching function. This function must be continuous (at least in its roots neighborhood), as the integrator will need to find its roots to locate the events.

Specified by:
g in interface EventDetector
Specified by:
g in class AbstractDetector
Parameters:
s - the current state information: date, kinematics, attitude for forces and events computation, mass provider, and additional states
Returns:
value of the switching function
Throws:
OrekitException - if some specific error occurs

getSensorMainSpacecraft

public SensorModel getSensorMainSpacecraft()
Get the main spacecraft sensor.

Returns:
the main spacecraft sensor.

getMainSpacecraft

public Assembly getMainSpacecraft()
Get the main assembly to consider.

Returns:
the main assembly to consider.

getSensorSecondarySpacecraft

public SensorModel getSensorSecondarySpacecraft()
Get the secondary spacecraft sensor.

Returns:
the secondary spacecraft sensor.

getSecondarySpacecraft

public Assembly getSecondarySpacecraft()
Get the secondary assembly to consider.

Returns:
the secondary assembly to consider

isMaskingCheck

public boolean isMaskingCheck()
Check maskings.

Returns:
true if maskings must be computed

getInMainSpacecraftId

public String getInMainSpacecraftId()
Get the main spacecraft id.

Returns:
the main spacecraft id

getInSecondarySpacecraftId

public String getInSecondarySpacecraftId()
Get the secondary spacecraft id.

Returns:
the secondary spacecraft id

init

public void init(Map<String,SpacecraftState> s0,
                 AbsoluteDate t)
Description copied from interface: MultiEventDetector
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.

Specified by:
init in interface MultiEventDetector
Parameters:
s0 - map of initial states
t - target time for the integration

g

public double g(Map<String,SpacecraftState> s)
         throws OrekitException
Description copied from interface: MultiEventDetector
Compute the value of the switching function.

This function must be continuous (at least in its roots neighborhood), as the integrator will need to find its roots to locate the events.

Specified by:
g in interface MultiEventDetector
Parameters:
s - the current states information: date, kinematics, attitudes for forces and events computation, and additional states for each states
Returns:
value of the switching function
Throws:
OrekitException - if some specific error occurs

eventOccurred

public EventDetector.Action eventOccurred(Map<String,SpacecraftState> s,
                                          boolean increasing,
                                          boolean forward)
                                   throws OrekitException
Description copied from interface: MultiEventDetector
Handle an event and choose what to do next.

The scheduling between this method and the MultiOrekitStepHandler method handleStep is to call this method first and handleStep afterwards. This scheduling allows the propagator to pass true as the isLast parameter to the step handler to make it aware the step will be the last one if this method returns EventDetector.Action.STOP. As the interpolator may be used to navigate back throughout the last step MultiOrekitStepNormalizer does for example), user code called by this method and user code called by step handlers may experience apparently out of order values of the independent time variable. As an example, if the same user object implements both this MultiEventDetector interface and the MultiOrekitFixedStepHandler interface, a forward integration may call its eventOccurred method with a state at 2000-01-01T00:00:10 first and call its handleStep method with a state at 2000-01-01T00:00:09 afterwards. Such out of order calls are limited to the size of the integration step for MultiOrekitStepHandler and to the size of the fixed step for MultiOrekitFixedStepHandler.

Specified by:
eventOccurred in interface MultiEventDetector
Parameters:
s - the current states information: date, kinematics, attitude for forces and events computation, and additional states for each states
increasing - if true, the value of the switching function increases when times increases around event (note that increase is measured with respect to physical time, not with respect to propagation which may go backward in time)
forward - if true, the integration variable (time) increases during integration.
Returns:
one of EventDetector.Action.STOP, EventDetector.Action.RESET_STATE, EventDetector.Action.RESET_DERIVATIVES, EventDetector.Action.CONTINUE
Throws:
OrekitException - if some specific error occurs

resetStates

public Map<String,SpacecraftState> resetStates(Map<String,SpacecraftState> oldStates)
                                        throws OrekitException
Description copied from interface: MultiEventDetector
Reset the states (including additional states) prior to continue propagation.

This method is called after the step handler has returned and before the next step is started, but only when MultiEventDetector.eventOccurred(java.util.Map, boolean, boolean) has itself returned the EventDetector.Action.RESET_STATE indicator. It allows the user to reset the state for the next step, without perturbing the step handler of the finishing step. If the MultiEventDetector.eventOccurred(java.util.Map, boolean, boolean) never returns the EventDetector.Action.RESET_STATE indicator, this function will never be called, and it is safe to simply return null.

Specified by:
resetStates in interface MultiEventDetector
Parameters:
oldStates - old states
Returns:
new states
Throws:
OrekitException - if the states cannot be reseted

shouldBeRemoved

public boolean shouldBeRemoved()
This method is called after EventDetector.eventOccurred(org.orekit.propagation.SpacecraftState, boolean, boolean) has been triggered. It returns true if the current detector should be removed after first event detection. WARNING: this method can be called only once a event has been triggered. Before, the value is not available.

Specified by:
shouldBeRemoved in interface EventDetector
Specified by:
shouldBeRemoved in interface MultiEventDetector
Specified by:
shouldBeRemoved in class AbstractDetector
Returns:
true if the current detector should be removed after first event detection


Copyright © 2017 CNES. All Rights Reserved.