Package org.orekit.rugged.utils
Class AbsoluteDateArrayHandling
- java.lang.Object
-
- org.orekit.rugged.utils.AbsoluteDateArrayHandling
-
public class AbsoluteDateArrayHandling extends Object
AbsoluteDateArrayHandling consist of additions to AbsoluteDate to handle arrays.- Author:
- Melina Vanel
-
-
Constructor Summary
Constructors Constructor Description AbsoluteDateArrayHandling(AbsoluteDate[] dates)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
durationFrom(AbsoluteDate[] datesForDuration)
Get array with durations between instances dates and corresponding given dates If instance dates = [date1, date2, ..., daten] and argument datesForDuration = [d1, d2, ..., dn] then this function will return [date1 durationFrom d1, date2 durationFrom d2, ..., daten durationFrom dn].AbsoluteDate[]
getDates()
Get instance dates array.double[][]
multipleDurationFrom(AbsoluteDate[] datesForDuration)
Get array with durations between instances dates and given dates If instance dates = [date1, date2, ..., daten] and argument datesForDuration = [d1, d2, ..., dn] then this function will return a matrix [[date1 durationFrom d1, date1 durationFrom d2, ..., date1 durationFrom dn], [date2 durationFrom d1, date2 durationFrom d2, ..., date2 durationFrom dn], [...] [daten durationFrom d1, daten durationFrom d2, ..., date1 durationFrom dn]].AbsoluteDate[][]
multipleShiftedBy(double[] dts)
Get time-shifted dates for several dates or several time shifts.AbsoluteDate[]
shiftedBy(double[] dts)
Get time-shifted dates for several dates and corresponding time shifts.
-
-
-
Constructor Detail
-
AbsoluteDateArrayHandling
public AbsoluteDateArrayHandling(AbsoluteDate[] dates)
Simple constructor.- Parameters:
dates
- is an array of absolute dates on which we want to apply time shift or compute duration
-
-
Method Detail
-
getDates
public AbsoluteDate[] getDates()
Get instance dates array.- Returns:
- dates array
-
multipleShiftedBy
public AbsoluteDate[][] multipleShiftedBy(double[] dts)
Get time-shifted dates for several dates or several time shifts. If instance dates = [date1, date2, ..., daten] and argument dts = [dts1, dts2, ..., dtsn] then this function will return a matrix [[date1 shiftedby dts1, date1 shiftedBy dts2, ..., date1 shiftedBy dtsn], [date2 shiftedby dts1, date2 shiftedBy dts2, ..., date2 shiftedBy dtsn], [...] [daten shiftedby dts1, daten shiftedBy dts2, ..., date1 shiftedBy dtsn]]. If ones want to apply only 1 time shift corresponding to 1 date seeshiftedBy(double[])
.- Parameters:
dts
- time shifts array in seconds we want to apply to dates- Returns:
- a matrix of new dates, shifted with respect to wanted time shifts. If instance dates = [date1, date2, ..., daten] each line correspond to one date (for example date1 shiftedBy all timeshifts (building the different columns))
-
shiftedBy
public AbsoluteDate[] shiftedBy(double[] dts)
Get time-shifted dates for several dates and corresponding time shifts. If instance dates = [date1, date2, ..., daten] and argument dts = [dts1, dts2, ..., dtsn] then this function will return [date1 shiftedby dts1, date2 shiftedBy dts2, ..., daten shiftedBy dtsn]. If several time shift want to be applied on each date seemultipleShiftedBy(double[])
.- Parameters:
dts
- time shifts array in seconds we want to apply to corresponding dates. Warning, must be same length as dates.- Returns:
- an 1D array of new dates, shifted with respect to wanted corresponding time shifts.
-
multipleDurationFrom
public double[][] multipleDurationFrom(AbsoluteDate[] datesForDuration)
Get array with durations between instances dates and given dates If instance dates = [date1, date2, ..., daten] and argument datesForDuration = [d1, d2, ..., dn] then this function will return a matrix [[date1 durationFrom d1, date1 durationFrom d2, ..., date1 durationFrom dn], [date2 durationFrom d1, date2 durationFrom d2, ..., date2 durationFrom dn], [...] [daten durationFrom d1, daten durationFrom d2, ..., date1 durationFrom dn]]. If ones want to compute duration from only 1 date corresponding to 1 instance date seedurationFrom(AbsoluteDate[])
.- Parameters:
datesForDuration
- dates for which we want to compute the duration form instances dates- Returns:
- a matrix of double representing durations from instance dates If instance dates = [date1, date2, ..., daten] each line correspond to one date (for example date1 duration from all given dates in arguments (building the different columns))
-
durationFrom
public double[] durationFrom(AbsoluteDate[] datesForDuration)
Get array with durations between instances dates and corresponding given dates If instance dates = [date1, date2, ..., daten] and argument datesForDuration = [d1, d2, ..., dn] then this function will return [date1 durationFrom d1, date2 durationFrom d2, ..., daten durationFrom dn]. If duration from from all arguments dates wants to be compute on each date seemultipleDurationFrom(AbsoluteDate[])
.- Parameters:
datesForDuration
- dates for which we want to compute the duration form instances dates. Warning must have same length as instance dates.- Returns:
- a array of double representing durations between instance dates and corresponding argument dates
-
-