Class AbstractFieldTimeInterpolator<T extends FieldTimeStamped<KK>,KK extends CalculusFieldElement<KK>>
- Type Parameters:
T- interpolated time stamped typeKK- type of the field element
- All Implemented Interfaces:
FieldTimeInterpolator<T,KK>
- Direct Known Subclasses:
AbstractFieldOrbitInterpolator,FieldAbsolutePVCoordinatesHermiteInterpolator,FieldAttitudeInterpolator,FieldClockOffsetHermiteInterpolator,FieldSpacecraftStateInterpolator,TimeStampedFieldAngularCoordinatesHermiteInterpolator,TimeStampedFieldHermiteInterpolator,TimeStampedFieldPVCoordinatesHermiteInterpolator
- Author:
- Vincent Cucchietti
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassNested class used to store interpolation data. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleDefault extrapolation time threshold: 1ms.static final intDefault number of interpolation points. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractFieldTimeInterpolator(int interpolationPoints, double extrapolationThreshold) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected <S extends CalculusFieldElement<S>>
voidaddOptionalSubInterpolatorIfDefined(FieldTimeInterpolator<? extends FieldTimeStamped<S>, S> subInterpolator, List<FieldTimeInterpolator<? extends FieldTimeStamped<S>, S>> subInterpolators) Add all lowest level sub interpolators to the sub interpolator list.static <T extends CalculusFieldElement<T>>
voidcheckInterpolatorCompatibilityWithSampleSize(FieldTimeInterpolator<? extends FieldTimeStamped<T>, T> interpolator, int sampleSize) Method checking if given interpolator is compatible with given sample size.static <KK extends CalculusFieldElement<KK>>
FieldAbsoluteDate<KK> getCentralDate(FieldAbsoluteDate<KK> date, FieldAbsoluteDate<KK> minDate, FieldAbsoluteDate<KK> maxDate, double threshold) Get the central date to use to find neighbors while taking into account extrapolation threshold.static <T extends FieldTimeStamped<KK>,KK extends CalculusFieldElement<KK>>
FieldAbsoluteDate<KK> getCentralDate(FieldAbsoluteDate<KK> date, ImmutableFieldTimeStampedCache<T, KK> cachedSamples, double threshold) Get the central date to use to find neighbors while taking into account extrapolation threshold.doubleGet the extrapolation threshold.intGet the number of interpolation points for this instance only i.e., not taking into account sub-interpolators.intGet the number of interpolation points.List<FieldTimeInterpolator<? extends FieldTimeStamped<KK>, KK>> Get all lowest level interpolators implemented by this instance, otherwise return a list with this instance only.protected KKgetTimeParameter(FieldAbsoluteDate<KK> interpolatingTime, FieldAbsoluteDate<KK> previousDate, FieldAbsoluteDate<KK> 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.protected abstract Tinterpolate(AbstractFieldTimeInterpolator<T, KK>.InterpolationData interpolationData) Interpolate instance from given interpolation data.interpolate(FieldAbsoluteDate<KK> interpolationDate, Collection<T> sample) Get an interpolated instance.interpolate(FieldAbsoluteDate<KK> interpolationDate, Stream<T> sample) Get an interpolated instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.orekit.time.FieldTimeInterpolator
interpolate, interpolate
-
Field Details
-
DEFAULT_EXTRAPOLATION_THRESHOLD_SEC
public static final double DEFAULT_EXTRAPOLATION_THRESHOLD_SECDefault extrapolation time threshold: 1ms.- See Also:
-
DEFAULT_INTERPOLATION_POINTS
public static final int DEFAULT_INTERPOLATION_POINTSDefault number of interpolation points.- See Also:
-
-
Constructor Details
-
AbstractFieldTimeInterpolator
protected AbstractFieldTimeInterpolator(int interpolationPoints, double extrapolationThreshold) Constructor.- Parameters:
interpolationPoints- number of interpolation pointsextrapolationThreshold- extrapolation threshold beyond which the propagation will fail
-
-
Method Details
-
checkInterpolatorCompatibilityWithSampleSize
public static <T extends CalculusFieldElement<T>> void checkInterpolatorCompatibilityWithSampleSize(FieldTimeInterpolator<? extends FieldTimeStamped<T>, T> interpolator, int sampleSize) Method checking if given interpolator is compatible with given sample size.- Type Parameters:
T- type of the field elements- Parameters:
interpolator- interpolatorsampleSize- sample size
-
interpolate
Get an interpolated instance.The stream must yield elements in chronological order. Passing an unsorted stream yields undefined neighbors and may throw
TimeStampedCacheException.The stream must yield elements in chronological order.
- Specified by:
interpolatein interfaceFieldTimeInterpolator<T extends FieldTimeStamped<KK>,KK extends CalculusFieldElement<KK>> - Parameters:
interpolationDate- interpolation datesample- time stamped sample (chronologically sorted)- Returns:
- a new instance, interpolated at specified date
- See Also:
-
interpolate
Get an interpolated instance.The sample must be in chronological order. Passing an unsorted sample yields undefined neighbors and may throw
TimeStampedCacheException.Precondition:
samplemust be sorted in chronological order. Passing an unsorted sample yields undefined neighbors and may throwTimeStampedCacheException.- Specified by:
interpolatein interfaceFieldTimeInterpolator<T extends FieldTimeStamped<KK>,KK extends CalculusFieldElement<KK>> - Parameters:
interpolationDate- interpolation datesample- time stamped sample (chronologically sorted)- Returns:
- a new instance, interpolated at specified date
-
getCentralDate
public static <T extends FieldTimeStamped<KK>,KK extends CalculusFieldElement<KK>> FieldAbsoluteDate<KK> getCentralDate(FieldAbsoluteDate<KK> date, ImmutableFieldTimeStampedCache<T, KK> cachedSamples, double threshold) Get the central date to use to find neighbors while taking into account extrapolation threshold.- Type Parameters:
T- type of time stamped elementKK- type of calculus field element- Parameters:
date- interpolation datecachedSamples- cached samplesthreshold- extrapolation threshold- Returns:
- central date to use to find neighbors
- Since:
- 12.0.1
-
getCentralDate
public static <KK extends CalculusFieldElement<KK>> FieldAbsoluteDate<KK> getCentralDate(FieldAbsoluteDate<KK> date, FieldAbsoluteDate<KK> minDate, FieldAbsoluteDate<KK> maxDate, double threshold) Get the central date to use to find neighbors while taking into account extrapolation threshold.- Type Parameters:
KK- type of calculus field 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
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:
getSubInterpolatorsin interfaceFieldTimeInterpolator<T extends FieldTimeStamped<KK>,KK extends CalculusFieldElement<KK>> - 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:
getNbInterpolationPointsin interfaceFieldTimeInterpolator<T extends FieldTimeStamped<KK>,KK extends CalculusFieldElement<KK>> - Returns:
- the number of interpolation points
-
getInternalNbInterpolationPoints
public int getInternalNbInterpolationPoints()Get the number of interpolation points for this instance only i.e., not taking into account sub-interpolators.- Returns:
- required the number of interpolation points for this instance only i.e., not taking into account sub-interpolators.
-
getExtrapolationThreshold
public double getExtrapolationThreshold()Get the extrapolation threshold.- Specified by:
getExtrapolationThresholdin interfaceFieldTimeInterpolator<T extends FieldTimeStamped<KK>,KK extends CalculusFieldElement<KK>> - Returns:
- get the extrapolation threshold.
-
addOptionalSubInterpolatorIfDefined
protected <S extends CalculusFieldElement<S>> void addOptionalSubInterpolatorIfDefined(FieldTimeInterpolator<? extends FieldTimeStamped<S>, S> subInterpolator, List<FieldTimeInterpolator<? extends FieldTimeStamped<S>, S>> subInterpolators) Add all lowest level sub interpolators to the sub interpolator list.- Type Parameters:
S- type of the field element- Parameters:
subInterpolator- optional sub interpolator to addsubInterpolators- list of sub interpolators
-
interpolate
protected abstract T interpolate(AbstractFieldTimeInterpolator<T, KK>.InterpolationData interpolationData) Interpolate instance from given interpolation data.- Parameters:
interpolationData- interpolation data- Returns:
- interpolated instance from given interpolation data.
-
getTimeParameter
protected KK getTimeParameter(FieldAbsoluteDate<KK> interpolatingTime, FieldAbsoluteDate<KK> previousDate, FieldAbsoluteDate<KK> 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]
-