org.orekit.propagation.sampling
Class AdaptedStepHandler

java.lang.Object
  extended by org.orekit.propagation.sampling.AdaptedStepHandler
All Implemented Interfaces:
Serializable, StepHandler, ModeHandler, OrekitStepInterpolator

public class AdaptedStepHandler
extends Object
implements OrekitStepInterpolator, StepHandler, ModeHandler, Serializable

Adapt an OrekitStepHandler to commons-math StepHandler interface.

Author:
Luc Maisonobe
See Also:
Serialized Form

Constructor Summary
AdaptedStepHandler(OrekitStepHandler handler)
          Build an instance.
 
Method Summary
 AdaptedStepHandler copy()
          Copy this.
 AbsoluteDate getCurrentDate()
          Get the current grid date.
 AbsoluteDate getInterpolatedDate()
          Get the interpolated date.
 SpacecraftState getInterpolatedState()
          Get the interpolated state.
 AbsoluteDate getPreviousDate()
          Get the previous grid date.
 void handleStep(StepInterpolator interpolator, boolean isLast)
          Handle the last accepted step
 void init(double t0, double[] y0, double t)
          Initialize step handler at the start of an ODE integration.
 void initialize(OrbitType orbit, PositionAngle angle, AttitudeProvider attitudeProviderForces, AttitudeProvider attitudeProviderEvents, Map<String,AdditionalStateInfo> additionalStateInfos, boolean activateHandlers, AbsoluteDate reference, Frame frame, double mu)
          Initialize the mode handler.
 boolean isForward()
          Check is integration direction is forward in date.
 void setInterpolatedDate(AbsoluteDate date)
          Set the interpolated date.
 void setReference(AbsoluteDate newReference)
          Define new reference date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdaptedStepHandler

public AdaptedStepHandler(OrekitStepHandler handler)
Build an instance.

Parameters:
handler - underlying handler to wrap
Method Detail

initialize

public void initialize(OrbitType orbit,
                       PositionAngle angle,
                       AttitudeProvider attitudeProviderForces,
                       AttitudeProvider attitudeProviderEvents,
                       Map<String,AdditionalStateInfo> additionalStateInfos,
                       boolean activateHandlers,
                       AbsoluteDate reference,
                       Frame frame,
                       double mu)
Initialize the mode handler.

Specified by:
initialize in interface ModeHandler
Parameters:
orbit - orbit type
angle - position angle type
attitudeProviderForces - attitude provider for forces computation
attitudeProviderEvents - attitude provider for events computation
additionalStateInfos - additional states informations
activateHandlers - if handlers shall be active
reference - reference date
frame - reference frame
mu - central body attraction coefficient

init

public void init(double t0,
                 double[] y0,
                 double t)
Initialize step handler at the start of an ODE integration.

This method is called once at the start of the integration. It may be used by the step handler to initialize some internal data if needed.

Specified by:
init in interface StepHandler
Parameters:
t0 - start value of the independent time variable
y0 - array containing the start value of the state vector
t - target time for the integration

handleStep

public void handleStep(StepInterpolator interpolator,
                       boolean isLast)
Handle the last accepted step

Specified by:
handleStep in interface StepHandler
Parameters:
interpolator - interpolator for the last accepted step. For efficiency purposes, the various integrators reuse the same object on each call, so if the instance wants to keep it across all calls (for example to provide at the end of the integration a continuous model valid throughout the integration range, as the ContinuousOutputModel class does), it should build a local copy using the clone method of the interpolator and store this copy. Keeping only a reference to the interpolator and reusing it will result in unpredictable behavior (potentially crashing the application).
isLast - true if the step is the last one

getCurrentDate

public AbsoluteDate getCurrentDate()
Get the current grid date.

Specified by:
getCurrentDate in interface OrekitStepInterpolator
Returns:
current grid date

getPreviousDate

public AbsoluteDate getPreviousDate()
Get the previous grid date.

Specified by:
getPreviousDate in interface OrekitStepInterpolator
Returns:
previous grid date

getInterpolatedDate

public AbsoluteDate getInterpolatedDate()
Get the interpolated date.

If setInterpolatedDate has not been called, the date returned is the same as getCurrentDate.

Specified by:
getInterpolatedDate in interface OrekitStepInterpolator
Returns:
interpolated date
See Also:
setInterpolatedDate(AbsoluteDate), getInterpolatedState()

setInterpolatedDate

public void setInterpolatedDate(AbsoluteDate date)
Set the interpolated date.

It is possible to set the interpolation date outside of the current step range, but accuracy will decrease as date is farther.

Specified by:
setInterpolatedDate in interface OrekitStepInterpolator
Parameters:
date - interpolated date to set
See Also:
getInterpolatedDate(), getInterpolatedState()

getInterpolatedState

public SpacecraftState getInterpolatedState()
                                     throws OrekitException
Get the interpolated state.

Specified by:
getInterpolatedState in interface OrekitStepInterpolator
Returns:
interpolated state at the current interpolation date
Throws:
OrekitException - if state cannot be interpolated or converted
See Also:
getInterpolatedDate(), setInterpolatedDate(AbsoluteDate)

isForward

public boolean isForward()
Check is integration direction is forward in date.

Specified by:
isForward in interface OrekitStepInterpolator
Returns:
true if integration is forward in date

copy

public AdaptedStepHandler copy()

Copy this.

Following attributes are deeply copied:

Following attributes reference is passed (no deep copy):

Returns:
copy of this

setReference

public void setReference(AbsoluteDate newReference)
Define new reference date.

To be called by NumericalPropagator only.

Specified by:
setReference in interface ModeHandler
Parameters:
newReference - new reference date


Copyright © 2016 CNES. All Rights Reserved.