Class TimeSeriesFunctions
- All Implemented Interfaces:
Constants
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface hec.hecmath.computation.Constants
Constants.LogicTestOperator, Constants.MathOperator, Constants.Notation, Constants.Precedence, Constants.QualityOperator, Constants.QualityTestOperator, Constants.TextOperator, Constants.TextTestOperator, Constants.ValueTestOperator -
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TimeSeriesContainerabs(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerabs(List<ValueContainer> vcl, String c) static TimeSeriesContainerDerive a new time series by computing a running accumulation of the parameter time seriestsc.static TimeSeriesContaineraccumulation(TimeSeriesContainer tsc, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) Derive a new time series by computing a running accumulation of the parameter time seriestsc.static TimeSeriesContaineracos(List<ValueContainer> vcl, Condition c) static TimeSeriesContaineracos(List<ValueContainer> vcl, String c) static TimeSeriesContaineradd(List<ValueContainer> vcl, Condition c) static TimeSeriesContaineradd(List<ValueContainer> vcl, String c) static TimeSeriesContainerasin(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerasin(List<ValueContainer> vcl, String c) static TimeSeriesContaineratan(List<ValueContainer> vcl, Condition c) static TimeSeriesContaineratan(List<ValueContainer> vcl, String c) static intbisearch(double[] xarray, double x, int n) binary search with upper limitstatic intbisearch(int[] xarray, int x, int n) binary search with upper limitstatic TimeSeriesContainerceil(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerceil(List<ValueContainer> vcl, String c) static TimeSeriesContainercenteredMovingAverage(TimeSeriesContainer tsc, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) Perform a centered moving average smoothing of the time series.static List<ValueContainer>static TimeSeriesContainercos(List<ValueContainer> vcl, Condition c) static TimeSeriesContainercos(List<ValueContainer> vcl, String c) static TimeSeriesContainerdifferences(TimeSeriesContainer tsc, boolean time_based, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) Derive a new time series from the differences (time-based or otherwise) of the current time series.static TimeSeriesContainerdivide(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerdivide(List<ValueContainer> vcl, String c) static intdurationMinutes(String durationStr) static TimeSeriesContainerestimateForMissingValues(TimeSeriesContainer tsc, int maxMissingAllowed, boolean accumulation, boolean setQuestioned, boolean estimateRejected, boolean allowUnsafe, boolean warnUnsafe) Linearly interpolate estimates for missing values in the time series.static TimeSeriesContainerexp(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerexp(List<ValueContainer> vcl, String c) static TimeSeriesContainerexponentiation(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerexponentiation(List<ValueContainer> vcl, String c) static intfindInterval(int[] times, int time, int lastIndex) Find interval times array in which "time" lies in and return the index position of the first point.static intfindValidValue(TimeSeriesContainer tsc, int index, boolean lookAfter) find the first valid value index before or after a specified indexstatic intFind the date and time of the first valid time series value.static doubleFind the first valid value in the time series.static TimeSeriesContainerfloor(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerfloor(List<ValueContainer> vcl, String c) static TimeSeriesContainerfmod(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerfmod(List<ValueContainer> vcl, String c) static TimeSeriesContainerforwardMovingAverage(TimeSeriesContainer tsc, int numberToAverageOver) Compute a forward moving average of the time series.static TimeSeriesContainerforwardMovingAverage(TimeSeriesContainer tsc, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) Compute a forward moving average of the time series.static doublegmean(TimeSeriesContainer tsc) Compute the geometric mean value of the time series.static TimeSeriesContainergmean(List<ValueContainer> vcl, Condition c) static TimeSeriesContainergmean(List<ValueContainer> vcl, String c) static doublehmean(TimeSeriesContainer tsc) Compute the harmonic mean value of the time series.static TimeSeriesContainerhmean(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerhmean(List<ValueContainer> vcl, String c) static TimeSeriesContainerinteger_divide(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerinteger_divide(List<ValueContainer> vcl, String c) static doubleintegrate(TimeSeriesContainer tsc, int time0, int time1, String dataType, int functionType, double missingAllowed, intContainer lastIndex, doubleContainer sumTime) integrate or accumulate tsc over the interval time0 to time1static doubleinterpolate(TimeSeriesContainer tsc, int time, String dataType, intContainer lastIndex) static doubleintervalStats(int functionType, TimeSeriesContainer tsc, int time0, int time1, int interval, String dataType, double missingAllowed, intContainer lastIndex, intContainer timeOfOccurrence) Compute max, min and count between time0 and time1 for time series transform.static TimeSeriesContainerinverse(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerinverse(List<ValueContainer> vcl, String c) static booleanprotected static booleanisMissing(TimeSeriesContainer tsc, int index) Determine if the data value intscis missing (missing quality or undefined value) for the index locationindex.static booleanstatic booleanisValid(TimeSeriesContainer tsc, int index) Determine if the data value intscis valid (not missing, rejected, or undefined) for the index locationindex.static doubleCompute the kurtosis coefficient of the time series values.static intFind the date and time of the last valid time series value.static doubleFind the last valid value in the time series.static TimeSeriesContainerlog(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerlog(List<ValueContainer> vcl, String c) static TimeSeriesContainerlog10(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerlog10(List<ValueContainer> vcl, String c) static voidstatic doublemax(TimeSeriesContainer tsc) Find the maximum value of the time series.static doublemax(TimeSeriesContainer tsc, double ceiling) Find the maximum value of the time series below a ceiling.static TimeSeriesContainermax(List<ValueContainer> vcl, Condition c) static TimeSeriesContainermax(List<ValueContainer> vcl, String c) static intFind the date/time of the maximum value of the time series under a ceiling.static intmaxDate(TimeSeriesContainer tsc, double ceiling) Find the date/time of the maximum value of the time series.static doublemean(TimeSeriesContainer tsc) Compute the mean value of the time series.static TimeSeriesContainermean(List<ValueContainer> vcl, Condition c) static TimeSeriesContainermean(List<ValueContainer> vcl, String c) static doublemed(TimeSeriesContainer tsc) Compute the median of the time series values.static TimeSeriesContainermed(List<ValueContainer> vcl, Condition c) static TimeSeriesContainermed(List<ValueContainer> vcl, String c) static doublemin(TimeSeriesContainer tsc) Find the minimum value of the time series.static doublemin(TimeSeriesContainer tsc, double floor) Find the minimum value of the time series above a floor.static TimeSeriesContainermin(List<ValueContainer> vcl, Condition c) static TimeSeriesContainermin(List<ValueContainer> vcl, String c) static intFind the date/time of the minimum value of the time series.static intminDate(TimeSeriesContainer tsc, double floor) Find the date/time of the minimum value of the time series above a floor.static doublemode(TimeSeriesContainer tsc) Compute the mode of the time series values.static TimeSeriesContainermodulo(List<ValueContainer> vcl, Condition c) static TimeSeriesContainermodulo(List<ValueContainer> vcl, String c) static TimeSeriesContainermovingAverage(TimeSeriesContainer tsc, TimeSeriesFunctions.MovingAverageMethod method, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) Derive a new time series by performing a moving average of with the specified method.static TimeSeriesContainermultiply(List<ValueContainer> vcl, Condition c) static TimeSeriesContainermultiply(List<ValueContainer> vcl, String c) static TimeSeriesContainerneg(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerneg(List<ValueContainer> vcl, String c) static intCount the number of invalid (missing or rejected) values in the time series values.static intCount the number of missing (but not rejected) values in the time series values.static intCount the number of questioned values in the time series values.static intCount the number of rejected (but not missing) values in the time series values.static intCount the number of valid (non-missing and non-rejected) values in the time series values.static TimeSeriesContainerolympicSmoothing(TimeSeriesContainer tsc, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) Perform an Olympic smoothing average of the time series.static doublep1(TimeSeriesContainer tsc) Compute the p1 of the time series values.static TimeSeriesContainerp1(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerp1(List<ValueContainer> vcl, String c) static doublep10(TimeSeriesContainer tsc) Compute the p10 of the time series values.static TimeSeriesContainerp10(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerp10(List<ValueContainer> vcl, String c) static doublep2(TimeSeriesContainer tsc) Compute the p2 of the time series values.static TimeSeriesContainerp2(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerp2(List<ValueContainer> vcl, String c) static doublep20(TimeSeriesContainer tsc) Compute the p20 of the time series values.static TimeSeriesContainerp20(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerp20(List<ValueContainer> vcl, String c) static doublep25(TimeSeriesContainer tsc) Compute the p25 of the time series values.static TimeSeriesContainerp25(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerp25(List<ValueContainer> vcl, String c) static doublep5(TimeSeriesContainer tsc) Compute the p5 of the time series values.static TimeSeriesContainerp5(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerp5(List<ValueContainer> vcl, String c) static doublep75(TimeSeriesContainer tsc) Compute the p75 of the time series values.static TimeSeriesContainerp75(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerp75(List<ValueContainer> vcl, String c) static doublep80(TimeSeriesContainer tsc) Compute the p80 of the time series values.static TimeSeriesContainerp80(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerp80(List<ValueContainer> vcl, String c) static doublep90(TimeSeriesContainer tsc) Compute the p90 of the time series values.static TimeSeriesContainerp90(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerp90(List<ValueContainer> vcl, String c) static doublep95(TimeSeriesContainer tsc) Compute the p95 of the time series values.static TimeSeriesContainerp95(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerp95(List<ValueContainer> vcl, String c) static doublep98(TimeSeriesContainer tsc) Compute the p98 of the time series values.static TimeSeriesContainerp98(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerp98(List<ValueContainer> vcl, String c) static doublep99(TimeSeriesContainer tsc) Compute the p99 of the time series values.static TimeSeriesContainerp99(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerp99(List<ValueContainer> vcl, String c) static intparseTimeIntervalString(String timeIntervalStr) static TimeSeriesContainerproduct(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerproduct(List<ValueContainer> vcl, String c) static TimeSeriesContainerresample(TimeSeriesContainer tsc, mil.army.usace.hec.metadata.Interval interval) Create timeseries derived from input in the specified interval.static doublerms(TimeSeriesContainer tsc) Compute the root mean square (quadratic mean) value of the time series.static TimeSeriesContainerrms(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerrms(List<ValueContainer> vcl, String c) static TimeSeriesContainerround(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerround(List<ValueContainer> vcl, String c) static TimeSeriesContainerroundOff(TimeSeriesContainer tsc, int digitsPrecision, int powerOfTensPlace) Derive a new time series with values of the current time series rounded to the specified precision and/or power of tens place.static TimeSeriesContainerscreenWithConstantValue(TimeSeriesContainer tsc, String durationStr, double rejectTolerance, double questionTolerance) Flag values in time series whose values do not change more than a specified amount over a specified duation as questionable or rejected.static TimeSeriesContainerscreenWithConstantValue(TimeSeriesContainer tsc, String durationStr, double missingTolerance, double rejectTolerance, double questionTolerance, double minThreshold, int maxMissing, boolean allowUnsafe, boolean warnUnsafe) Flag values in time series whose values do not change more than a specified amount over a specified duation as questionable or rejected.static TimeSeriesContainerscreenWithConstantValue(TimeSeriesContainer tsc, String durationStr, double rejectTolerance, double questionTolerance, double minThreshold, int maxMissing) Flag values in time series whose values do not change more than a specified amount over a specified duation as questionable or rejected.static TimeSeriesContainerscreenWithConstantValue(TimeSeriesContainer tsc, String durationStr, double rejectTolerance, double questionTolerance, double minThreshold, int maxMissing, boolean allowUnsafe, boolean warnUnsafe) Flag values in time series whose values do not change more than a specified amount over a specified duation as questionable or rejected.static TimeSeriesContainerscreenWithDurationMagnitude(TimeSeriesContainer tsc, String durationStr, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit) Flag values in time series whose accumulation over a specified period lies minimum/maximum limits values as questionable or rejected.static TimeSeriesContainerscreenWithDurationMagnitude(TimeSeriesContainer tsc, String durationStr, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit, boolean allowUnsafe, boolean warnUnsafe) Flag values in time series whose accumulation over a specified period lies minimum/maximum limits values as questionable or rejected.static TimeSeriesContainerscreenWithDurationMagnitude(TimeSeriesContainer tsc, String durationStr, double minMissingLimit, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit, double maxMissingLimit, double percentRequired, boolean allowUnsafe, boolean warnUnsafe) Flag values in time series whose accumulation over a specified period lies minimum/maximum limits values as questionable or rejected.static TimeSeriesContainerscreenWithForwardMovingAverage(TimeSeriesContainer tsc, int numberToAverageOver, double changeLimit, boolean setInvalidValueToUndefined, String qualityFlagForInvalidValue) Flag values in time series exceeding maximum change from a forward moving average.static TimeSeriesContainerscreenWithMaxMin(TimeSeriesContainer tsc, double minValueLimit, double maxValueLimit, double changeLimit, boolean setInvalidValueToSpecified, double invalidValueReplacement, String qualityFlagForInvalidValue) Flag values in time series exceeding minimum and maximum limit values or maximum change limit.static TimeSeriesContainerscreenWithMaxMin(TimeSeriesContainer tsc, double minValueLimit, double maxValueLimit, double changeLimit, boolean setInvalidValueToUndefined, String qualityFlagForInvalidValue) Flag values in time series exceeding minimum and maximum limit values or maximum change limit.static TimeSeriesContainerscreenWithMaxMin(TimeSeriesContainer tsc, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit) Flag values in time series exceeding minimum and maximum limit values as questionable or rejected.static TimeSeriesContainerscreenWithRateOfChange(TimeSeriesContainer tsc, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit) Flag values in time series whose rate of change from the last valid value exceed minimum/maximum limits values as questionable or rejected.static booleansetAlwaysAllowUnsafe(boolean state) static booleansetAlwaysCreateQuality(boolean state) static booleansetAlwaysWarnUnsafe(boolean state) static TimeSeriesContainersign(List<ValueContainer> vcl, Condition c) static TimeSeriesContainersign(List<ValueContainer> vcl, String c) static TimeSeriesContainersin(List<ValueContainer> vcl, Condition c) static TimeSeriesContainersin(List<ValueContainer> vcl, String c) static doubleCompute the skew coefficient of the time series values.static TimeSeriesContainersnapToRegularInterval(TimeSeriesContainer tsc, int timeIntervalMinutes, int timeOffsetMinutes, int timeBackwardMinutes, int timeForwardMinutes) static TimeSeriesContainersnapToRegularInterval(TimeSeriesContainer tsc, String timeIntervalStr, String timeOffsetStr, String timeBackwardStr, String timeForwardStr) static TimeSeriesContainersqrt(List<ValueContainer> vcl, Condition c) static TimeSeriesContainersqrt(List<ValueContainer> vcl, String c) static doubleCompute the standard deviation of the time series values.static TimeSeriesContainerstdev(List<ValueContainer> vcl, Condition c) static TimeSeriesContainerstdev(List<ValueContainer> vcl, String c) static TimeSeriesContainersubtract(List<ValueContainer> vcl, Condition c) static TimeSeriesContainersubtract(List<ValueContainer> vcl, String c) static TimeSeriesContainerDerive a new time series from the successive differences of the current time series.static TimeSeriesContainersuccessiveDifferences(TimeSeriesContainer tsc, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) Derive a new time series from the successive differences of the current time series.static doublesum(TimeSeriesContainer tsc) Compute the total accumulated amount for time series.static TimeSeriesContainersum(List<ValueContainer> vcl, Condition c) static TimeSeriesContainersum(List<ValueContainer> vcl, String c) static TimeSeriesContainertan(List<ValueContainer> vcl, Condition c) static TimeSeriesContainertan(List<ValueContainer> vcl, String c) static TimeSeriesContainerDerive a new time series from the successive difference rates of the current time series.static TimeSeriesContainertimeDerivative(TimeSeriesContainer tsc, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) Derive a new time series from the successive difference rates of the current time series.static voidtransformTimeSeries(TimeSeriesContainer currentTsc, TimeSeriesContainer newTsc, int functionType, boolean toIrregular, double missingAllowed) static TimeSeriesContainertransformWithFunction(TimeSeriesContainer baseTsc, ScalarOperable transformer) static TimeSeriesContainertruncate(List<ValueContainer> vcl, Condition c) static TimeSeriesContainertruncate(List<ValueContainer> vcl, String c) static voidvalidateIndex(TimeSeriesContainer tsc, int index) static voidstatic doublevar(TimeSeriesContainer tsc) Compute the variance value of the time series.static TimeSeriesContainervar(List<ValueContainer> vcl, Condition c) static TimeSeriesContainervar(List<ValueContainer> vcl, String c)
-
Field Details
-
validTimeSeriesTypes
-
instTimeSeriesTypes
-
periodTimeSeriesTypes
-
totalTimeSeriesTypes
-
averageTimeSeriesTypes
-
dssTimeSeriesTypes
-
cwmsTimeSeriesTypes
-
-
Constructor Details
-
TimeSeriesFunctions
public TimeSeriesFunctions()
-
-
Method Details
-
parseTimeIntervalString
- Throws:
ComputationException
-
setAlwaysAllowUnsafe
public static boolean setAlwaysAllowUnsafe(boolean state) -
setAlwaysWarnUnsafe
public static boolean setAlwaysWarnUnsafe(boolean state) -
setAlwaysCreateQuality
public static boolean setAlwaysCreateQuality(boolean state) -
validateTimeSeriesContainer
- Throws:
ComputationException
-
validateIndex
- Throws:
ComputationException
-
isRegular
-
isIregular
-
collectValidValues
-
isValid
Determine if the data value intscis valid (not missing, rejected, or undefined) for the index locationindex.- Parameters:
tsc- a TimeSeriesContainer.index- the array index of the value of interest.- Returns:
- true if the value is valid (not missing or undefined).
- Throws:
ComputationException
-
isMissing
Determine if the data value intscis missing (missing quality or undefined value) for the index locationindex.- Parameters:
tsc- a TimeSeriesContainer.index- the array index of the value of interest.- Returns:
- true if the value is valid (not missing or undefined).
- Throws:
ComputationException
-
bisearch
public static int bisearch(int[] xarray, int x, int n) binary search with upper limit- Parameters:
xarray- the array to find the position inx- the item to find the position forn- the upper limit in the array- Returns:
- the position
-
bisearch
public static int bisearch(double[] xarray, double x, int n) binary search with upper limit- Parameters:
xarray- the array to find the position inx- the item to find the position forn- the upper limit in the array- Returns:
- the position
-
findInterval
public static int findInterval(int[] times, int time, int lastIndex) Find interval times array in which "time" lies in and return the index position of the first point. times[idx] <= time < times[idx+1] -
findValidValue
find the first valid value index before or after a specified index- Parameters:
tsc- the TimeSeriesContainer to checkindex- the index to look before or afterlookAfter- whether to look after- Returns:
- the first valid value index
-
integrate
public static double integrate(TimeSeriesContainer tsc, int time0, int time1, String dataType, int functionType, double missingAllowed, intContainer lastIndex, doubleContainer sumTime) integrate or accumulate tsc over the interval time0 to time1 -
intervalStats
public static double intervalStats(int functionType, TimeSeriesContainer tsc, int time0, int time1, int interval, String dataType, double missingAllowed, intContainer lastIndex, intContainer timeOfOccurrence) Compute max, min and count between time0 and time1 for time series transform. Return value for the appropriate function specified by functionType. -
add
public static TimeSeriesContainer add(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
add
public static TimeSeriesContainer add(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
subtract
public static TimeSeriesContainer subtract(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
subtract
public static TimeSeriesContainer subtract(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
multiply
public static TimeSeriesContainer multiply(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
multiply
public static TimeSeriesContainer multiply(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
divide
public static TimeSeriesContainer divide(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
divide
public static TimeSeriesContainer divide(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
integer_divide
public static TimeSeriesContainer integer_divide(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
integer_divide
public static TimeSeriesContainer integer_divide(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
modulo
public static TimeSeriesContainer modulo(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
modulo
public static TimeSeriesContainer modulo(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
exponentiation
public static TimeSeriesContainer exponentiation(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
exponentiation
public static TimeSeriesContainer exponentiation(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
abs
public static TimeSeriesContainer abs(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
abs
public static TimeSeriesContainer abs(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
neg
public static TimeSeriesContainer neg(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
neg
public static TimeSeriesContainer neg(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
inverse
public static TimeSeriesContainer inverse(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
inverse
public static TimeSeriesContainer inverse(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
sign
public static TimeSeriesContainer sign(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
sign
public static TimeSeriesContainer sign(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
sqrt
public static TimeSeriesContainer sqrt(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
sqrt
public static TimeSeriesContainer sqrt(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
exp
public static TimeSeriesContainer exp(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
exp
public static TimeSeriesContainer exp(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
log
public static TimeSeriesContainer log(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
log
public static TimeSeriesContainer log(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
log10
public static TimeSeriesContainer log10(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
log10
public static TimeSeriesContainer log10(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
sin
public static TimeSeriesContainer sin(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
sin
public static TimeSeriesContainer sin(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
cos
public static TimeSeriesContainer cos(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
cos
public static TimeSeriesContainer cos(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
tan
public static TimeSeriesContainer tan(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
tan
public static TimeSeriesContainer tan(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
asin
public static TimeSeriesContainer asin(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
asin
public static TimeSeriesContainer asin(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
acos
public static TimeSeriesContainer acos(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
acos
public static TimeSeriesContainer acos(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
atan
public static TimeSeriesContainer atan(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
atan
public static TimeSeriesContainer atan(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
floor
public static TimeSeriesContainer floor(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
floor
public static TimeSeriesContainer floor(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
ceil
public static TimeSeriesContainer ceil(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
ceil
public static TimeSeriesContainer ceil(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
round
public static TimeSeriesContainer round(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
round
public static TimeSeriesContainer round(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
truncate
public static TimeSeriesContainer truncate(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
truncate
public static TimeSeriesContainer truncate(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
fmod
public static TimeSeriesContainer fmod(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
fmod
public static TimeSeriesContainer fmod(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
sum
public static TimeSeriesContainer sum(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
sum
public static TimeSeriesContainer sum(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
product
public static TimeSeriesContainer product(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
product
public static TimeSeriesContainer product(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
max
public static TimeSeriesContainer max(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
max
public static TimeSeriesContainer max(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
min
public static TimeSeriesContainer min(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
min
public static TimeSeriesContainer min(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
mean
public static TimeSeriesContainer mean(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
mean
public static TimeSeriesContainer mean(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
gmean
public static TimeSeriesContainer gmean(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
gmean
public static TimeSeriesContainer gmean(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
hmean
public static TimeSeriesContainer hmean(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
hmean
public static TimeSeriesContainer hmean(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
rms
public static TimeSeriesContainer rms(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
rms
public static TimeSeriesContainer rms(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
stdev
public static TimeSeriesContainer stdev(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
stdev
public static TimeSeriesContainer stdev(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
var
public static TimeSeriesContainer var(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
var
public static TimeSeriesContainer var(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
med
public static TimeSeriesContainer med(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
med
public static TimeSeriesContainer med(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p1
public static TimeSeriesContainer p1(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p1
public static TimeSeriesContainer p1(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p2
public static TimeSeriesContainer p2(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p2
public static TimeSeriesContainer p2(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p5
public static TimeSeriesContainer p5(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p5
public static TimeSeriesContainer p5(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p10
public static TimeSeriesContainer p10(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p10
public static TimeSeriesContainer p10(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p20
public static TimeSeriesContainer p20(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p20
public static TimeSeriesContainer p20(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p25
public static TimeSeriesContainer p25(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p25
public static TimeSeriesContainer p25(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p75
public static TimeSeriesContainer p75(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p75
public static TimeSeriesContainer p75(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p80
public static TimeSeriesContainer p80(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p80
public static TimeSeriesContainer p80(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p90
public static TimeSeriesContainer p90(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p90
public static TimeSeriesContainer p90(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p95
public static TimeSeriesContainer p95(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p95
public static TimeSeriesContainer p95(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p98
public static TimeSeriesContainer p98(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p98
public static TimeSeriesContainer p98(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p99
public static TimeSeriesContainer p99(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p99
public static TimeSeriesContainer p99(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
roundOff
public static TimeSeriesContainer roundOff(TimeSeriesContainer tsc, int digitsPrecision, int powerOfTensPlace) throws ComputationException Derive a new time series with values of the current time series rounded to the specified precision and/or power of tens place.digitsPrecisioncontrols the number of significant digits displayed and can range from 1 to 8.powerOfTensPlaceis the magnitude of 10 to which to round to. For example, -1 specifies rounding to one-tenth (0.1).Examples: 1234.123456 will round to:
1230.0 for digitsPrecision = 3, powerOfTensPlace = -1 1234.1 for digitsPrecision = 6, powerOfTensPlace = -1 1230 for digitsPrecision = 6, powerOfTensPlace = 1Values which are missing in the original time series will be missing in the new time series.- Parameters:
digitsPrecision- Number of digits of precision, between 1 and 8.powerOfTensPlace- Magnitude of ten to round to.- Returns:
- A new time series composed of values of the current time series rounded to the specified precision.
- Throws:
ComputationException
-
accumulation
Derive a new time series by computing a running accumulation of the parameter time seriestsc.For time points in which the parameter time series
tscvalue is missing or rejected, the value in the accumulation time series remains constant (same as the accumulated value at the last valid point location).The new time series will have all quality values set to "no quality".
- Returns:
- A new time series representing the running accumulation of the current time series
- Throws:
ComputationException
-
accumulation
public static TimeSeriesContainer accumulation(TimeSeriesContainer tsc, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) throws ComputationException Derive a new time series by computing a running accumulation of the parameter time seriestsc.For time points in which the parameter time series
tscvalue is missing or rejected, the value in the accumulation time series remains constant (same as the accumulated value at the last valid point location).The new time series will have all quality values set to "no quality".
- Parameters:
tsc- the TimeSeriesContainerallowUnsafe- flag specifying whether to allow "unsafe" math operations.warnUnsafe- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A new time series representing the running accumulation of the current time series
- Throws:
ComputationException
-
min
Find the minimum value of the time series. Missing and rejected values are excluded.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the minimum value of the time series.
- Throws:
ComputationException
-
min
Find the minimum value of the time series above a floor. Missing and rejected values are excluded.- Parameters:
tsc- the TimeSeriesContainerfloor- the value to compute the minimum above- Returns:
- the minimum value of the time series.
- Throws:
ComputationException
-
minDate
Find the date/time of the minimum value of the time series. Missing and rejected values are excluded.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the date and time of the minimum value as an int value translatable by HecTime
- Throws:
ComputationException- See Also:
-
minDate
Find the date/time of the minimum value of the time series above a floor. Missing and rejected values are excluded.- Parameters:
tsc- the TimeSeriesContainerfloor- the value to compute the minimum above- Returns:
- the date and time of the minimum value as an int value translatable by HecTime
- Throws:
ComputationException- See Also:
-
max
Find the maximum value of the time series. Missing and rejected values are excluded.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the maximum value of the time series.
- Throws:
ComputationException
-
max
Find the maximum value of the time series below a ceiling. Missing and rejected values are excluded.- Parameters:
tsc- the TimeSeriesContainerceiling- the value under which to compute the maximum- Returns:
- the maximum value of the time series.
- Throws:
ComputationException
-
maxDate
Find the date/time of the maximum value of the time series under a ceiling. Missing and rejected values are excluded.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the date and time of the maximum value as an int value translatable by HecTime
- Throws:
ComputationException- See Also:
-
maxDate
Find the date/time of the maximum value of the time series. Missing and rejected values are excluded.- Parameters:
tsc- the TimeSeriesContainerceiling- the value under which to compute the maximum- Returns:
- the date and time of the maximum value as an int value translatable by HecTime
- Throws:
ComputationException- See Also:
-
mean
Compute the mean value of the time series. Missing and rejected values are excluded.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the mean value of the time series.
- Throws:
ComputationException
-
gmean
Compute the geometric mean value of the time series. Missing and rejected values are excluded.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the geometric mean value of the time series.
- Throws:
ComputationException
-
hmean
Compute the harmonic mean value of the time series. Missing and rejected values are excluded.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the harmonic mean value of the time series.
- Throws:
ComputationException
-
rms
Compute the root mean square (quadratic mean) value of the time series. Missing and rejected values are excluded.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the root mean square (quadratic mean) mean value of the time series.
- Throws:
ComputationException
-
var
Compute the variance value of the time series. Missing and rejected values are excluded.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the variance mean value of the time series.
- Throws:
ComputationException
-
sum
Compute the total accumulated amount for time series. Missing and rejected values are excluded.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the total accumulated value of the time series.
- Throws:
ComputationException
-
standardDeviation
Compute the standard deviation of the time series values. Missing and rejected values are excluded. A minimum of three valid values are required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the standard deviation value of the time series.
- Throws:
ComputationException
-
skewCoefficient
Compute the skew coefficient of the time series values. Missing values and rejected are excluded. A minimum of three valid values are required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the skew coefficient value of the time series.
- Throws:
ComputationException
-
kurtosisCoefficient
Compute the kurtosis coefficient of the time series values. Missing values and rejected are excluded. A minimum of four valid values are required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the kurtosis coefficient value of the time series.
- Throws:
ComputationException
-
mode
Compute the mode of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the mode coefficient value of the time series.
- Throws:
ComputationException
-
med
Compute the median of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the median coefficient value of the time series.
- Throws:
ComputationException
-
p1
Compute the p1 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the p1 coefficient value of the time series.
- Throws:
ComputationException
-
p2
Compute the p2 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the p2 coefficient value of the time series.
- Throws:
ComputationException
-
p5
Compute the p5 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the p5 coefficient value of the time series.
- Throws:
ComputationException
-
p10
Compute the p10 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the p10 coefficient value of the time series.
- Throws:
ComputationException
-
p20
Compute the p20 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the p20 coefficient value of the time series.
- Throws:
ComputationException
-
p25
Compute the p25 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the p25 coefficient value of the time series.
- Throws:
ComputationException
-
p75
Compute the p75 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the p75 coefficient value of the time series.
- Throws:
ComputationException
-
p80
Compute the p80 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the p80 coefficient value of the time series.
- Throws:
ComputationException
-
p90
Compute the p90 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the p90 coefficient value of the time series.
- Throws:
ComputationException
-
p95
Compute the p95 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the p95 coefficient value of the time series.
- Throws:
ComputationException
-
p98
Compute the p98 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the p98 coefficient value of the time series.
- Throws:
ComputationException
-
p99
Compute the p99 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the p99 coefficient value of the time series.
- Throws:
ComputationException
-
numberValidValues
Count the number of valid (non-missing and non-rejected) values in the time series values.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the number of valid (non-missing and non-rejected) values in the time series.
- Throws:
ComputationException
-
numberInvalidValues
Count the number of invalid (missing or rejected) values in the time series values.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the number of invalid (missing or rejected) values in the time series.
- Throws:
ComputationException
-
numberMissingValues
Count the number of missing (but not rejected) values in the time series values.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the number of missing (but not rejected) values in the time series.
- Throws:
ComputationException
-
numberRejectedValues
Count the number of rejected (but not missing) values in the time series values.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the number of rejected (but not missing) values in the time series.
- Throws:
ComputationException
-
numberQuestionedValues
Count the number of questioned values in the time series values.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the number of questioned values in the time series.
- Throws:
ComputationException
-
firstValidDate
Find the date and time of the first valid time series value.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the date and time of the first valid value as an int value translatable by HecTime
- Throws:
ComputationException- See Also:
-
firstValidValue
Find the first valid value in the time series.- Returns:
- the value of the first valid time series value.
- Throws:
HecMathExceptionComputationException
-
lastValidDate
Find the date and time of the last valid time series value.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the date and time of the last valid value as an int value translatable by HecTime
- Throws:
ComputationException- See Also:
-
lastValidValue
Find the last valid value in the time series.- Parameters:
tsc- the TimeSeriesContainer- Returns:
- the value of the last valid time series value.
- Throws:
HecMathExceptionComputationException
-
differences
public static TimeSeriesContainer differences(TimeSeriesContainer tsc, boolean time_based, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) throws ComputationException Derive a new time series from the differences (time-based or otherwise) of the current time series. The time series must be of type "INST-CUM". The value in the new time is set to missing if either the current or previous point in the current time series is set to missing (need to have two consecutive valid values).By default, if the data type of the current time series is "INST-CUM", the data type of the new time series is set to "PER-CUM".
- Parameters:
tsc- the TimeSeriesContainertime_based- flag specifying whether compute successive difference (false) or time derivatives (true)allowUnsafe- flag specifying whether to allow "unsafe" math operations.warnUnsafe- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A new time series of successive differences.
- Throws:
ComputationExceptionComputationException
-
successiveDifferences
public static TimeSeriesContainer successiveDifferences(TimeSeriesContainer tsc) throws ComputationException Derive a new time series from the successive differences of the current time series. The time series must be of type "INST-CUM". The value in the new time is set to missing if either the current or previous point in the current time series is set to missing (need to have two consecutive valid values).By default, if the data type of the current time series is "INST-CUM", the data type of the new time series is set to "PER-CUM".
- Parameters:
tsc- the TimeSeriesContainer- Returns:
- A new time series of successive differences.
- Throws:
ComputationException
-
successiveDifferences
public static TimeSeriesContainer successiveDifferences(TimeSeriesContainer tsc, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) throws ComputationException Derive a new time series from the successive differences of the current time series. The time series must be of type "INST-CUM". The value in the new time is set to missing if either the current or previous point in the current time series is set to missing (need to have two consecutive valid values).By default, if the data type of the current time series is "INST-CUM", the data type of the new time series is set to "PER-CUM".
- Parameters:
tsc- the TimeSeriesContainerallowUnsafe- flag specifying whether to allow "unsafe" math operations.warnUnsafe- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A new time series of successive differences.
- Throws:
ComputationException
-
timeDerivative
public static TimeSeriesContainer timeDerivative(TimeSeriesContainer tsc) throws ComputationException Derive a new time series from the successive difference rates of the current time series. The time series must be of type "INST-CUM". The value in the new time is set to missing if either the current or previous point in the current time series is set to missing (need to have two consecutive valid values).By default, if the data type of the current time series is "INST-CUM", the data type of the new time series is set to "PER-CUM".
- Parameters:
tsc- the TimeSeriesContainer- Returns:
- A new time series of successive differences.
- Throws:
ComputationException
-
timeDerivative
public static TimeSeriesContainer timeDerivative(TimeSeriesContainer tsc, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) throws ComputationException Derive a new time series from the successive difference rates of the current time series. The time series must be of type "INST-CUM". The value in the new time is set to missing if either the current or previous point in the current time series is set to missing (need to have two consecutive valid values).By default, if the data type of the current time series is "INST-CUM", the data type of the new time series is set to "PER-CUM".
- Parameters:
tsc- the TimeSeriesContainerallowUnsafe- flag specifying whether to allow "unsafe" math operations.warnUnsafe- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A new time series of successive differences.
- Throws:
ComputationException
-
movingAverage
public static TimeSeriesContainer movingAverage(TimeSeriesContainer tsc, TimeSeriesFunctions.MovingAverageMethod method, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) throws ComputationException Derive a new time series by performing a moving average of with the specified method. Only valid (non missing, non-rejected) values are used to average, although invalid values may exist within the range of values to average, depending on the setting of theonlyValidValuesargument. Average values near the beginning or end of the time series may or may not be computed based on the setting of theuseReducedargument.- Parameters:
tsc- The time series to derive from.method- The moving average method to use. Currently-supported methods areFORWARD,CENTERED, andOLYMPIC.numberToAverageOver- The number of values to average for each element. Must be 2 or greater, and must be odd forCENTEREDorOLYMPICmethods.onlyValidValues- Specifies whether to require a complete set of valid values in order to compute an average for a given element. Iftrue, then any elements that would use an invalid element in its average will be set to missing. Iffalse, then the average for a given element will be computed with fewer values than specified in thenumberToAverageOverargument if an invalid element in thetscargument is encounterd.useReduced- Specifies whether to compute averages for elements near enough to the beginning or end of the time series that thenumberToAverageOverargument cannot be satisfied. Iftrue, then the number of elements required for the average will be reduced accordingly. Iffalse, elements near the beginning and/or end of the time series will be set to missing.- Returns:
- The derived time series.
- Throws:
ComputationException
-
centeredMovingAverage
public static TimeSeriesContainer centeredMovingAverage(TimeSeriesContainer tsc, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) throws ComputationException Perform a centered moving average smoothing of the time series.Derive a new time series from the centered moving average of
numberToAverageOvervalues in the current time series.If
onlyValidValuesis set to true, then if points in the averaging interval are missing values, the point in the new time series is set to missing. IfonlyValidValuesis set to false and missing values are contained in the averaging interval, a smoothed point is still computed using the valid values in the interval. If there are no valid values in the averaging interval, the point in the new time series is set to missing.If
useReducedis set to true, then centered moving average points can be still be computed at the beginning and end of the time series even if there are less thannumberToAverageOvervalues in the interval. IfuseReducedis set to false, then the first and lastnumberToAverageOver/2points of the new time series are set to missing.- Parameters:
tsc- The time series to derive from.numberToAverageOver- the number of values to average over for computing the centered moving average. Must be greater than 2 and odd.onlyValidValues- all values in the averaging interval must be valid for the computed point in the new time series to be valid.useReduced- allow points at the beginning and end of the centered moving average time series to be computed from a reduced ( less thannumberToAverageOver) number of points. Otherwise, set the first and lastnumberToAverageOver/2points of the new time series to missing.- Returns:
- A new time series computed from the olypic smoothing average of current time series.
- Throws:
ComputationException- if thenumberToAverageOveris less than 3 or not odd.
-
olympicSmoothing
public static TimeSeriesContainer olympicSmoothing(TimeSeriesContainer tsc, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) throws ComputationException Perform an Olympic smoothing average of the time series.Derive a new time series from the Olympic smoothing average of
numberToAverageOvervalues in the current time series. Olympic smoothing is the same as centered moving average except that the minimum and maximum values in the averaging interval are ignored.If
onlyValidValuesis set to true, then if points in the averaging interval are missing values, the point in the new time series is set to missing. IfonlyValidValuesis set to false and missing values are contained in the averaging interval, a smoothed point is still computed using the valid values in the interval. If there are no valid values in the averaging interval, the point in the new time series is set to missing.If
useReducedis set to true, then centered moving average points can be still be computed at the beginning and end of the time series even if there are less thannumberToAverageOvervalues in the interval. IfuseReducedis set to false, then the first and lastnumberToAverageOver/2points of the new time series are set to missing.- Parameters:
tsc- The time series to derive from.numberToAverageOver- the number of values to average over for computing the centered moving average. Must be greater than 2 and odd.onlyValidValues- all values in the averaging interval must be valid for the computed point in the new time series to be valid.useReduced- allow points at the beginning and end of the centered moving average time series to be computed from a reduced ( less thannumberToAverageOver) number of points. Otherwise, set the first and lastnumberToAverageOver/2points of the new time series to missing.- Returns:
- a new time series computed from the olypic smoothing average of current time series.
- Throws:
ComputationException- if thenumberToAverageOveris less than 3 or not odd.
-
forwardMovingAverage
public static TimeSeriesContainer forwardMovingAverage(TimeSeriesContainer tsc, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) throws ComputationException Compute a forward moving average of the time series.Derive a new time series from the forward moving average of the last
numberToAverageOvervalues of the current time series.If
onlyValidValuesis set to true, then if points in the averaging interval are missing values, the point in the new time series is set to missing. IfonlyValidValuesis set to false and missing values are contained in the averaging interval, a smoothed point is still computed using the valid values in the interval. If there are no valid values in the averaging interval, the point in the new time series is set to missing.If
useReducedis set to true, then forward moving average points can be still be computed at the beginning of the time series even if there are less thannumberToAverageOvervalues in the interval. IfuseReducedis set to false, then the firstnumberToAverageOverpoints of the new time series are set to missing.- Parameters:
tsc- The time series to derive from.numberToAverageOver- the number of values to average over for computing the forward moving average. Must be greater than or equal to 2.onlyValidValues- all values in the averaging interval must be valid for the computed point in the new time series to be valid.useReduced- allow points at the beginning and end of the centered moving average time series to be computed from a reduced ( less thannumberToAverageOver) number of points. Otherwise, set the first and lastnumberToAverageOver/2points of the new time series to missing.- Returns:
- a new time series computed from the forward moving average of current time series.
- Throws:
ComputationException
-
forwardMovingAverage
public static TimeSeriesContainer forwardMovingAverage(TimeSeriesContainer tsc, int numberToAverageOver) throws ComputationException Compute a forward moving average of the time series.Derive a new time series from the forward moving average of the last
numberToAverageOvervalues of the current time series. If a missing value is occurs over thenumberToAverageOverpoints, the value is excluded from the computation and the average is over one less value. At least to valid values must be defined over the averaging interval or else the point in the new time series is set to missing.- Parameters:
tsc- The time series to derive from.numberToAverageOver- the number of values to average over for computing the forward moving average. Must be greater than or equal to 2.- Returns:
- a new time series computed from the forward moving average of current time series.
- Throws:
ComputationException
-
screenWithMaxMin
public static TimeSeriesContainer screenWithMaxMin(TimeSeriesContainer tsc, double minValueLimit, double maxValueLimit, double changeLimit, boolean setInvalidValueToSpecified, double invalidValueReplacement, String qualityFlagForInvalidValue) throws ComputationException Flag values in time series exceeding minimum and maximum limit values or maximum change limit.Values in the time series are screened for quality. Values below
minValueLimitor abovemaxValueLimitor with a change from the previous time series value greater thanchangeLimitfail the quality test. The maximum change comparison is done only when consecutive values are not flagged.If
setInvalidToSpecifiedValueis set to "true", values failing the screening test are set to the specified value.If
qualityFlagForInvalidValueis set to a character or string recognized as a valid quality flag, the quality flag will be set for tested values. If there is no previously existing quality available for the time series, the quality flag array will be created for the time series. Values failing the quality test are set to the user specified quality flag for invalid values. If there is existing quality data and the time series value passes the quality test, the existing quality flag for the points is unchanged. If there was no previously existing quality and the time series value passes the quality test, the quality flag for the point is set to "Okay".- Parameters:
tsc- The time series to derive from.minValueLimit- minimum valid value limit.maxValueLimit- maximum valid value limit.changeLimit- maximum change allowed in the tested value from the previous time series value.setInvalidValueToSpecified- if true, time series values failing the quality test are set to the specified value.invalidValueReplacement- The value to use for replacing invalid values issetInvalidToSpecifiedValueis set to "true".qualityFlagForInvalidValue- character string representing the quality flag setting for values failing the quality test. The accepted character strings are: "M" or "Missing", "R" or "Rejected", "Q" or "Questionable".- Returns:
- A copy of the time series with values failing the quality test set to missing and/or with the quality flag set to the user specified quality for invalid values.
- Throws:
ComputationException- See Also:
-
screenWithMaxMin
public static TimeSeriesContainer screenWithMaxMin(TimeSeriesContainer tsc, double minValueLimit, double maxValueLimit, double changeLimit, boolean setInvalidValueToUndefined, String qualityFlagForInvalidValue) throws ComputationException Flag values in time series exceeding minimum and maximum limit values or maximum change limit.Values in the time series are screened for quality. Values below
minValueLimitor abovemaxValueLimitor with a change from the previous time series value greater thanchangeLimitfail the quality test. The maximum change comparison is done only when consecutive values are not flagged.If
setInvalidToMissingValueis set to "true", values failing the screening test are set to the "Missing" value.If
qualityFlagForInvalidValueis set to a character or string recognized as a valid quality flag, the quality flag will be set for tested values. If there is no previously existing quality available for the time series, the quality flag array will be created for the time series. Values failing the quality test are set to the user specified quality flag for invalid values. If there is existing quality data and the time series value passes the quality test, the existing quality flag for the points is unchanged. If there was no previously existing quality and the time series value passes the quality test, the quality flag for the point is set to "Okay".- Parameters:
tsc- The time series to derive from.minValueLimit- minimum valid value limit.maxValueLimit- maximum valid value limit.changeLimit- maximum change allowed in the tested value from the previous time series value.setInvalidValueToUndefined- if true, time series values failing the quality test are set to the "Undefined" value.qualityFlagForInvalidValue- character string representing the quality flag setting for values failing the quality test. The accepted character strings are: "M" or "Missing", "R" or "Rejected", "Q" or "Questionable".- Returns:
- A copy of the time series with values failing the quality test set to missing and/or with the quality flag set to the user specified quality for invalid values.
- Throws:
ComputationException- See Also:
-
screenWithMaxMin
public static TimeSeriesContainer screenWithMaxMin(TimeSeriesContainer tsc, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit) throws ComputationException Flag values in time series exceeding minimum and maximum limit values as questionable or rejected.Values in the time series are screened for quality. Values below
minRejectLimitor abovemaxRejectLimitare marked with a rejected quality flag. Other values belowminQuestionLimitor abovemaxQuestionLimitare marked with a questioned quality flag. Other values are marked with an okay quality flag unless they are already marked as rejected or questioned.- Parameters:
tsc- The time series to derive from.minRejectLimit- Values below this will be marked as rejected.minQuestionLimit- Values below this, but not belowminRejectLimitwill be marked as questioned.maxQuestionLimit- Values above this, but not abovemaxRejectLimitwill be marked as questioned.maxRejectLimit- Values above this will be marked as rejected.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException- See Also:
-
screenWithRateOfChange
public static TimeSeriesContainer screenWithRateOfChange(TimeSeriesContainer tsc, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit) throws ComputationException Flag values in time series whose rate of change from the last valid value exceed minimum/maximum limits values as questionable or rejected.Values in the time series are screened for quality. Values whose rate of change from the last valid value are below
minRejectLimitor abovemaxRejectLimitare marked with a rejected quality flag. Other whose rate of change from the last valid value are values belowminQuestionLimitor abovemaxQuestionLimitare marked with a questioned quality flag. Other values are marked with an okay quality flag unless they are already marked as rejected or questioned.- Parameters:
tsc- The time series to derive from.minRejectLimit- Values whose rate of change from the last valid value are below this will be marked as rejected.minQuestionLimit- Values whose rate of change from the last valid value are below this, but not belowminRejectLimitwill be marked as questioned.maxQuestionLimit- Values whose rate of change from the last valid value are above this, but not abovemaxRejectLimitwill be marked as questioned.maxRejectLimit- Values whose rate of change from the last valid value are above this will be marked as rejected.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
screenWithDurationMagnitude
public static TimeSeriesContainer screenWithDurationMagnitude(TimeSeriesContainer tsc, String durationStr, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit) throws ComputationException Flag values in time series whose accumulation over a specified period lies minimum/maximum limits values as questionable or rejected.Values in the time series are screened for quality. All (non-missing) values whose accumulated value for the specified duration is below
minRejectLimitor abovemaxRejectLimitare marked with a rejected quality flag. Other whose whose accumulated value for the specified duration is belowminQuestionLimitor abovemaxQuestionLimitare marked with a questioned quality flag. Other values are marked with an okay quality flag unless they are already marked as rejected or questioned.- Parameters:
tsc- The time series to derive from.durationStr- The time period over which to perform the test, of the form nX, where in is an integer and X is one of Minutes, Hours, or Days, which can be abbreviated to one or more characters.minRejectLimit- Values whose accumulated value for the specified duration is below this will be marked as rejected.minQuestionLimit- Values whose accumulated value for the specified duration is below this, but not belowminRejectLimitwill be marked as questioned.maxQuestionLimit- Values whose accumulated value for the specified duration is above this, but not abovemaxRejectLimitwill be marked as questioned.maxRejectLimit- Values whose accumulated value for the specified duration is above this will be marked as rejected.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
durationMinutes
- Throws:
ComputationException
-
screenWithDurationMagnitude
public static TimeSeriesContainer screenWithDurationMagnitude(TimeSeriesContainer tsc, String durationStr, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit, boolean allowUnsafe, boolean warnUnsafe) throws ComputationException Flag values in time series whose accumulation over a specified period lies minimum/maximum limits values as questionable or rejected.Values in the time series are screened for quality. All (non-missing) values whose accumulated value for the specified duration is below
minRejectLimitor abovemaxRejectLimitare marked with a rejected quality flag. Other whose whose accumulated value for the specified duration is belowminQuestionLimitor abovemaxQuestionLimitare marked with a questioned quality flag. Other values are marked with an okay quality flag unless they are already marked as rejected or questioned.- Parameters:
tsc- The time series to derive from.durationStr- The time period over which to perform the test, of the form nX, where in is an integer and X is one of Minutes, Hours, or Days, which can be abbreviated to one or more characters.minRejectLimit- Values whose accumulated value for the specified duration is below this will be marked as rejected.minQuestionLimit- Values whose accumulated value for the specified duration is below this, but not belowminRejectLimitwill be marked as questioned.maxQuestionLimit- Values whose accumulated value for the specified duration is above this, but not abovemaxRejectLimitwill be marked as questioned.maxRejectLimit- Values whose accumulated value for the specified duration is above this will be marked as rejected.allowUnsafe- flag specifying whether to allow "unsafe" math operations.warnUnsafe- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
screenWithDurationMagnitude
public static TimeSeriesContainer screenWithDurationMagnitude(TimeSeriesContainer tsc, String durationStr, double minMissingLimit, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit, double maxMissingLimit, double percentRequired, boolean allowUnsafe, boolean warnUnsafe) throws ComputationException Flag values in time series whose accumulation over a specified period lies minimum/maximum limits values as questionable or rejected.Values in the time series are screened for quality. All (non-missing) values whose accumulated value for the specified duration is below
minRejectLimitor abovemaxRejectLimitare marked with a rejected quality flag. Other whose whose accumulated value for the specified duration is belowminQuestionLimitor abovemaxQuestionLimitare marked with a questioned quality flag. Other values are marked with an okay quality flag unless they are already marked as rejected or questioned.- Parameters:
tsc- The time series to derive from.durationStr- The time period over which to perform the test, of the form nX, where in is an integer and X is one of Minutes, Hours, or Days, which can be abbreviated to one or more characters.minMissingLimit- Values whose accumulated value for the specified duration is below this will be marked as missing.minRejectLimit- Values whose accumulated value for the specified duration is below this will be marked as rejected.minQuestionLimit- Values whose accumulated value for the specified duration is below this, but not belowminRejectLimitwill be marked as questioned.maxQuestionLimit- Values whose accumulated value for the specified duration is above this, but not abovemaxRejectLimitwill be marked as questioned.maxRejectLimit- Values whose accumulated value for the specified duration is above this will be marked as rejected.maxMissingLimit- Values whose accumulated value for the specified duration is above this will be marked as missing.percentRequired- Minimum percent of values in the duration that must be valid for the screening to be performed.allowUnsafe- flag specifying whether to allow "unsafe" math operations.warnUnsafe- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
screenWithConstantValue
public static TimeSeriesContainer screenWithConstantValue(TimeSeriesContainer tsc, String durationStr, double rejectTolerance, double questionTolerance) throws ComputationException Flag values in time series whose values do not change more than a specified amount over a specified duation as questionable or rejected.Values in the time series are screened for quality. All (non-missing) values whose difference over the specified duration is below
rejectToleranceare marked with a rejected quality flag. Other whose whose difference over the specified duration is belowquestionToleranceare marked with a questioned quality flag. Other values are marked with an okay quality flag unless they are already marked as rejected or questioned.Only values greater than zero are screened as described.
Only time periods that contain no missing values are screened as described.
- Parameters:
tsc- The time series to derive from.durationStr- The time period over which to perform the test, of the form nX, where in is an integer and X is one of Minutes, Hours, or Days, which can be abbreviated to one or more characters.rejectTolerance- Values will be marked as rejected if they do not differ by more than this amount over the specified duration. To disable marking values as rejected, set this tolerance to less than zero.questionTolerance- Values will be marked as questioned if they do not differ by more than this amount over the specified duration. To disable marking values as questioned, set this tolerance to less than zero.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
screenWithConstantValue
public static TimeSeriesContainer screenWithConstantValue(TimeSeriesContainer tsc, String durationStr, double rejectTolerance, double questionTolerance, double minThreshold, int maxMissing) throws ComputationException Flag values in time series whose values do not change more than a specified amount over a specified duation as questionable or rejected.Values in the time series are screened for quality. All (non-missing) values whose difference over the specified duration is below
rejectToleranceare marked with a rejected quality flag. Other whose whose difference over the specified duration is belowquestionToleranceare marked with a questioned quality flag. Other values are marked with an okay quality flag unless they are already marked as rejected or questioned.Only values above the specified
minThresholdvalue are screened as described.Only time periods that contain no more that
maxMissingmissing values are screened as described.- Parameters:
tsc- The time series to derive from.durationStr- The time period over which to perform the test, of the form nX, where in is an integer and X is one of Minutes, Hours, or Days, which can be abbreviated to one or more characters.rejectTolerance- Values will be marked as rejected if they do not differ by more than this amount over the specified duration. To disable marking values as rejected, set this tolerance to less than zero.questionTolerance- Values will be marked as questioned if they do not differ by more than this amount over the specified duration. To disable marking values as questioned, set this tolerance to less than zero.minThreshold- Values will be screened only if they are greater than this value.maxMissing- The maximum number of missing values to tolerate in the specified duration for screening purposes.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
screenWithConstantValue
public static TimeSeriesContainer screenWithConstantValue(TimeSeriesContainer tsc, String durationStr, double rejectTolerance, double questionTolerance, double minThreshold, int maxMissing, boolean allowUnsafe, boolean warnUnsafe) throws ComputationException Flag values in time series whose values do not change more than a specified amount over a specified duation as questionable or rejected.Values in the time series are screened for quality. All (non-missing) values whose difference over the specified duration is below
rejectToleranceare marked with a rejected quality flag. Other whose whose difference over the specified duration is belowquestionToleranceare marked with a questioned quality flag. Other values are marked with an okay quality flag unless they are already marked as rejected or questioned.Only values above the specified
minThresholdvalue are screened as described.Only time periods that contain no more that
maxMissingmissing values are screened as described.- Parameters:
tsc- The time series to derive from.durationStr- The time period over which to perform the test, of the form nX, where in is an integer and X is one of Minutes, Hours, or Days, which can be abbreviated to one or more characters.rejectTolerance- Values will be marked as rejected if they do not differ by more than this amount over the specified duration. To disable marking values as rejected, set this tolerance to less than zero.questionTolerance- Values will be marked as questioned if they do not differ by more than this amount over the specified duration. To disable marking values as questioned, set this tolerance to less than zero.minThreshold- Values will be screened only if they are greater than this value.maxMissing- The maximum number of missing values to tolerate in the specified duration for screening purposes.allowUnsafe- flag specifying whether to allow "unsafe" math operations.warnUnsafe- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
screenWithConstantValue
public static TimeSeriesContainer screenWithConstantValue(TimeSeriesContainer tsc, String durationStr, double missingTolerance, double rejectTolerance, double questionTolerance, double minThreshold, int maxMissing, boolean allowUnsafe, boolean warnUnsafe) throws ComputationException Flag values in time series whose values do not change more than a specified amount over a specified duation as questionable or rejected.Values in the time series are screened for quality. All (non-missing) values whose difference over the specified duration is below
rejectToleranceare marked with a rejected quality flag. Other whose whose difference over the specified duration is belowquestionToleranceare marked with a questioned quality flag. Other values are marked with an okay quality flag unless they are already marked as rejected or questioned.Only values above the specified
minThresholdvalue are screened as described.Only time periods that contain no more that
maxMissingmissing values are screened as described.- Parameters:
tsc- The time series to derive from.durationStr- The time period over which to perform the test, of the form nX, where in is an integer and X is one of Minutes, Hours, or Days, which can be abbreviated to one or more characters.missingTolerance- Values will be marked as missing if they do not differ by more than this amount over the specified duration. To disable marking values as missing, set this tolerance to less than zero.rejectTolerance- Values will be marked as rejected if they do not differ by more than this amount over the specified duration. To disable marking values as rejected, set this tolerance to less than zero.questionTolerance- Values will be marked as questioned if they do not differ by more than this amount over the specified duration. To disable marking values as questioned, set this tolerance to less than zero.minThreshold- Values will be screened only if they are greater than this value.maxMissing- The maximum number of missing values to tolerate in the specified duration for screening purposes.allowUnsafe- flag specifying whether to allow "unsafe" math operations.warnUnsafe- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
screenWithForwardMovingAverage
public static TimeSeriesContainer screenWithForwardMovingAverage(TimeSeriesContainer tsc, int numberToAverageOver, double changeLimit, boolean setInvalidValueToUndefined, String qualityFlagForInvalidValue) throws ComputationException Flag values in time series exceeding maximum change from a forward moving average.A running forward moving average of valid values is progressively computed over
numberToAverageOverpoints. Values exceeding the moving average computed for the preceeding point location by more thanchangeLimitare flagged or set to the "Missing" value depending upon the settings forsetInvalidToMissingValueorqualityFlagForInvalidValueparameters. Values failing the quality test are excluded from the forward moving average computation for the subsequent points. The maximum change comparison is done only when consecutive values are not flagged.If
setInvalidToMissingValueis set to "true", values failing the screening test are set to the "Missing" value.If
qualityFlagForInvalidValueis set to a character or string recognized as a valid quality flag, the quality flag will be set for tested values. If there is no previously existing quality available for the time series, the quality flag array will be created for the time series. Values failing the quality test are set to the user specified quality flag for invalid values. If there is existing quality data and the time series value passes the quality test, the existing quality flag for the points is unchanged. If there was no previously existing quality and the time series value passes the quality test, the quality flag for the point is set to "Okay".- Parameters:
tsc- The time series to derive from.numberToAverageOver- the number of values to average over for computing the forward moving average. Must be greater than 2.changeLimit- allowed deviation in the tested value from the forward moving average.setInvalidValueToUndefined-qualityFlagForInvalidValue- character string representing the quality flag setting for values failing the quality test. The accepted character strings are: "M" or "Missing", "R" or "Rejected", "Q" or "Questionable". A blank string is entered to disable the setting of the quality flag.- Returns:
- a copy of the time series with values failing the quality test set to missing and/or with the quality flag set to the user specified quality for invalid values.
- Throws:
ComputationException
-
estimateForMissingValues
public static TimeSeriesContainer estimateForMissingValues(TimeSeriesContainer tsc, int maxMissingAllowed, boolean accumulation, boolean setQuestioned, boolean estimateRejected, boolean allowUnsafe, boolean warnUnsafe) throws ComputationException Linearly interpolate estimates for missing values in the time series.The function interpolates between valid values in the time series to fill in locations in time with values defined as "Missing". Linear interpolation will NOT be performed for segments of the time series where there are more than
maxMissingAllowedsuccessive bad values.- Parameters:
tsc- time series to interpolate onmaxMissingAllowed- maximum number consecutive missing values between valid values in which interpolation is allowed.accumulation- flag specifying whether to estimate accumulated values (such as precip)setQuestioned- if true, sets the quality (if any) to questioned for interpolated valuesestimateRejected- if true, estimates missing AND rejected valuesallowUnsafe- flag specifying whether to allow "unsafe" math operations.warnUnsafe- flag specifying whether to warn about "unsafe" math operations.- Returns:
- a copy of the current time series with missing values filled by linear interpolation.
- Throws:
ComputationException- if the time series contains less than 3 valid values.
-
snapToRegularInterval
public static TimeSeriesContainer snapToRegularInterval(TimeSeriesContainer tsc, String timeIntervalStr, String timeOffsetStr, String timeBackwardStr, String timeForwardStr) throws ComputationException - Throws:
ComputationException
-
snapToRegularInterval
public static TimeSeriesContainer snapToRegularInterval(TimeSeriesContainer tsc, int timeIntervalMinutes, int timeOffsetMinutes, int timeBackwardMinutes, int timeForwardMinutes) throws ComputationException - Throws:
ComputationException
-
interpolate
public static double interpolate(TimeSeriesContainer tsc, int time, String dataType, intContainer lastIndex) -
transformTimeSeries
public static void transformTimeSeries(TimeSeriesContainer currentTsc, TimeSeriesContainer newTsc, int functionType, boolean toIrregular, double missingAllowed) throws ComputationException - Throws:
ComputationException
-
main
- Throws:
Exception
-
transformWithFunction
public static TimeSeriesContainer transformWithFunction(TimeSeriesContainer baseTsc, ScalarOperable transformer) -
resample
public static TimeSeriesContainer resample(TimeSeriesContainer tsc, mil.army.usace.hec.metadata.Interval interval) throws HecMathException Create timeseries derived from input in the specified interval. Uses source offset, pass result into SNAP or SHIFT if offset change is required- Parameters:
tsc- input timeseriesinterval- desired output interval- Returns:
- new timeseries with inputs mapped to the same times in output.
- Throws:
HecMathException- Since:
- 2022-07
-