Package org.orekit.time
Class AbstractTimeInterpolator<T extends TimeStamped>
- java.lang.Object
-
- org.orekit.time.AbstractTimeInterpolator<T>
-
- Type Parameters:
T
- interpolated time stamped type
- All Implemented Interfaces:
TimeInterpolator<T>
- Direct Known Subclasses:
AbsolutePVCoordinatesHermiteInterpolator
,AbstractOrbitInterpolator
,AbstractStateCovarianceInterpolator
,AttitudeInterpolator
,SP3CoordinateHermiteInterpolator
,SpacecraftStateInterpolator
,TimeStampedAngularCoordinatesHermiteInterpolator
,TimeStampedDoubleHermiteInterpolator
,TimeStampedPVCoordinatesHermiteInterpolator
public abstract class AbstractTimeInterpolator<T extends TimeStamped> extends Object implements TimeInterpolator<T>
Abstract class for time interpolator.- Author:
- Vincent Cucchietti
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
AbstractTimeInterpolator.InterpolationData
Nested class used to store interpolation data.
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_EXTRAPOLATION_THRESHOLD_SEC
Default extrapolation time threshold: 1ms.static int
DEFAULT_INTERPOLATION_POINTS
Default number of interpolation points.
-
Constructor Summary
Constructors Constructor Description AbstractTimeInterpolator(int interpolationPoints, double extrapolationThreshold)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addOptionalSubInterpolatorIfDefined(TimeInterpolator<? extends TimeStamped> subInterpolator, List<TimeInterpolator<? extends TimeStamped>> subInterpolators)
Add all lowest level sub interpolators to the sub interpolator list.static void
checkInterpolatorCompatibilityWithSampleSize(TimeInterpolator<? extends TimeStamped> interpolator, int sampleSize)
Method checking if given interpolator is compatible with given sample size.static <T extends TimeStamped>
AbsoluteDategetCentralDate(AbsoluteDate date, AbsoluteDate minDate, AbsoluteDate maxDate, double threshold)
Get the central date to use to find neighbors while taking into account extrapolation threshold.static <T extends TimeStamped>
AbsoluteDategetCentralDate(AbsoluteDate date, ImmutableTimeStampedCache<T> cachedSamples, double threshold)
Get the central date to use to find neighbors while taking into account extrapolation threshold.double
getExtrapolationThreshold()
Get the extrapolation threshold.int
getNbInterpolationPoints()
Get the number of interpolation points.List<TimeInterpolator<? extends TimeStamped>>
getSubInterpolators()
Get all lowest level interpolators implemented by this instance, otherwise return a list with this instance only.protected double
getTimeParameter(AbsoluteDate interpolatingTime, AbsoluteDate previousDate, AbsoluteDate nextDate)
Get the time parameter which lies between [0:1] by normalizing the difference between interpolating time and previous date by the Δt between tabulated values.T
interpolate(AbsoluteDate interpolationDate, Collection<T> sample)
Get an interpolated instance.T
interpolate(AbsoluteDate interpolationDate, Stream<T> sample)
Get an interpolated instance.protected abstract T
interpolate(AbstractTimeInterpolator.InterpolationData interpolationData)
Interpolate instance from given interpolation data.
-
-
-
Field Detail
-
DEFAULT_EXTRAPOLATION_THRESHOLD_SEC
public static final double DEFAULT_EXTRAPOLATION_THRESHOLD_SEC
Default extrapolation time threshold: 1ms.- See Also:
- Constant Field Values
-
DEFAULT_INTERPOLATION_POINTS
public static final int DEFAULT_INTERPOLATION_POINTS
Default number of interpolation points.- See Also:
- Constant Field Values
-
-
Method Detail
-
checkInterpolatorCompatibilityWithSampleSize
public static void checkInterpolatorCompatibilityWithSampleSize(TimeInterpolator<? extends TimeStamped> interpolator, int sampleSize)
Method checking if given interpolator is compatible with given sample size.- Parameters:
interpolator
- interpolatorsampleSize
- sample size
-
interpolate
public T interpolate(AbsoluteDate interpolationDate, Stream<T> sample)
Get an interpolated instance.- Specified by:
interpolate
in interfaceTimeInterpolator<T extends TimeStamped>
- Parameters:
interpolationDate
- interpolation datesample
- time stamped sample- Returns:
- a new instance, interpolated at specified date
- See Also:
TimeStamped
,AbsoluteDate
-
interpolate
public T interpolate(AbsoluteDate interpolationDate, Collection<T> sample)
Get an interpolated instance..- Specified by:
interpolate
in interfaceTimeInterpolator<T extends TimeStamped>
- Parameters:
interpolationDate
- interpolation datesample
- time stamped sample- Returns:
- a new instance, interpolated at specified date
-
getCentralDate
public static <T extends TimeStamped> AbsoluteDate getCentralDate(AbsoluteDate date, ImmutableTimeStampedCache<T> cachedSamples, double threshold)
Get the central date to use to find neighbors while taking into account extrapolation threshold.- Type Parameters:
T
- type of element- Parameters:
date
- interpolation datecachedSamples
- cached samplesthreshold
- extrapolation threshold- Returns:
- central date to use to find neighbors
- Since:
- 12.0.1
-
getCentralDate
public static <T extends TimeStamped> AbsoluteDate getCentralDate(AbsoluteDate date, AbsoluteDate minDate, AbsoluteDate maxDate, double threshold)
Get the central date to use to find neighbors while taking into account extrapolation threshold.- Type Parameters:
T
- type of element- Parameters:
date
- interpolation dateminDate
- earliest date in the sample.maxDate
- latest date in the sample.threshold
- extrapolation threshold- Returns:
- central date to use to find neighbors
- Since:
- 12.0.1
-
getSubInterpolators
public List<TimeInterpolator<? extends TimeStamped>> getSubInterpolators()
Get all lowest level interpolators implemented by this instance, otherwise return a list with this instance only.An example would be the spacecraft state interpolator which can use different interpolators for each of its attributes (orbit, absolute position-velocity-acceleration coordinates, mass...). In this case, it would return the list of all of these interpolators (or possibly all of their sub-interpolators if they were to use multiple interpolators themselves).
- Specified by:
getSubInterpolators
in interfaceTimeInterpolator<T extends TimeStamped>
- Returns:
- list of interpolators
-
getNbInterpolationPoints
public int getNbInterpolationPoints()
Get the number of interpolation points. In the specific case where this interpolator contains multiple sub-interpolators, this method will return the maximum number of interpolation points required among all sub-interpolators.- Specified by:
getNbInterpolationPoints
in interfaceTimeInterpolator<T extends TimeStamped>
- Returns:
- the number of interpolation points
-
getExtrapolationThreshold
public double getExtrapolationThreshold()
Get the extrapolation threshold.- Specified by:
getExtrapolationThreshold
in interfaceTimeInterpolator<T extends TimeStamped>
- Returns:
- get the extrapolation threshold
-
addOptionalSubInterpolatorIfDefined
protected void addOptionalSubInterpolatorIfDefined(TimeInterpolator<? extends TimeStamped> subInterpolator, List<TimeInterpolator<? extends TimeStamped>> subInterpolators)
Add all lowest level sub interpolators to the sub interpolator list.- Parameters:
subInterpolator
- optional sub interpolator to addsubInterpolators
- list of sub interpolators
-
interpolate
protected abstract T interpolate(AbstractTimeInterpolator.InterpolationData interpolationData)
Interpolate instance from given interpolation data.- Parameters:
interpolationData
- interpolation data- Returns:
- interpolated instance from given interpolation data.
-
getTimeParameter
protected double getTimeParameter(AbsoluteDate interpolatingTime, AbsoluteDate previousDate, AbsoluteDate nextDate)
Get the time parameter which lies between [0:1] by normalizing the difference between interpolating time and previous date by the Δt between tabulated values.- Parameters:
interpolatingTime
- time at which we want to interpolate a value (between previous and next tabulated dates)previousDate
- previous tabulated value datenextDate
- next tabulated value date- Returns:
- time parameter which lies between [0:1]
-
-