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 hec.io.TimeSeriesContainerabs(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerabs(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContaineraccumulation(hec.io.TimeSeriesContainer tsc) Derive a new time series by computing a running accumulation of the parameter time seriestsc.static hec.io.TimeSeriesContaineraccumulation(hec.io.TimeSeriesContainer tsc, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) Derive a new time series by computing a running accumulation of the parameter time seriestsc.static hec.io.TimeSeriesContaineracos(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContaineracos(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContaineradd(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContaineradd(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainerasin(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerasin(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContaineratan(List<ValueContainer> vcl, Condition c) static hec.io.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 hec.io.TimeSeriesContainerceil(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerceil(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainercenteredMovingAverage(hec.io.TimeSeriesContainer tsc, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) Perform a centered moving average smoothing of the time series.static List<ValueContainer> collectValidValues(hec.io.TimeSeriesContainer tsc) static hec.io.TimeSeriesContainercos(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainercos(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainerdifferences(hec.io.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 hec.io.TimeSeriesContainerdivide(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerdivide(List<ValueContainer> vcl, String c) static intdurationMinutes(String durationStr) static hec.io.TimeSeriesContainerestimateForMissingValues(hec.io.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 hec.io.TimeSeriesContainerexp(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerexp(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainerexponentiation(List<ValueContainer> vcl, Condition c) static hec.io.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(hec.io.TimeSeriesContainer tsc, int index, boolean lookAfter) find the first valid value index before or after a specified indexstatic intfirstValidDate(hec.io.TimeSeriesContainer tsc) Find the date and time of the first valid time series value.static doublefirstValidValue(hec.io.TimeSeriesContainer tsc) Find the first valid value in the time series.static hec.io.TimeSeriesContainerfloor(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerfloor(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainerfmod(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerfmod(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainerforwardMovingAverage(hec.io.TimeSeriesContainer tsc, int numberToAverageOver) Compute a forward moving average of the time series.static hec.io.TimeSeriesContainerforwardMovingAverage(hec.io.TimeSeriesContainer tsc, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) Compute a forward moving average of the time series.static doublegmean(hec.io.TimeSeriesContainer tsc) Compute the geometric mean value of the time series.static hec.io.TimeSeriesContainergmean(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainergmean(List<ValueContainer> vcl, String c) static doublehmean(hec.io.TimeSeriesContainer tsc) Compute the harmonic mean value of the time series.static hec.io.TimeSeriesContainerhmean(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerhmean(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainerinteger_divide(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerinteger_divide(List<ValueContainer> vcl, String c) static doubleintegrate(hec.io.TimeSeriesContainer tsc, int time0, int time1, String dataType, int functionType, double missingAllowed, hec.heclib.util.intContainer lastIndex, hec.heclib.util.doubleContainer sumTime) integrate or accumulate tsc over the interval time0 to time1static doubleinterpolate(hec.io.TimeSeriesContainer tsc, int time, String dataType, hec.heclib.util.intContainer lastIndex) static doubleintervalStats(int functionType, hec.io.TimeSeriesContainer tsc, int time0, int time1, int interval, String dataType, double missingAllowed, hec.heclib.util.intContainer lastIndex, hec.heclib.util.intContainer timeOfOccurrence) Compute max, min and count between time0 and time1 for time series transform.static hec.io.TimeSeriesContainerinverse(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerinverse(List<ValueContainer> vcl, String c) static booleanisIregular(hec.io.TimeSeriesContainer tsc) static booleanisMissing(hec.io.TimeSeriesContainer tsc, int index) Determine if the data value intscis missing (missing quality or undefined value) for the index locationindex.static booleanisRegular(hec.io.TimeSeriesContainer tsc) static booleanisValid(hec.io.TimeSeriesContainer tsc, int index) Determine if the data value intscis valid (not missing, rejected, or undefined) for the index locationindex.static doublekurtosisCoefficient(hec.io.TimeSeriesContainer tsc) Compute the kurtosis coefficient of the time series values.static intlastValidDate(hec.io.TimeSeriesContainer tsc) Find the date and time of the last valid time series value.static doublelastValidValue(hec.io.TimeSeriesContainer tsc) Find the last valid value in the time series.static hec.io.TimeSeriesContainerlog(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerlog(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainerlog10(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerlog10(List<ValueContainer> vcl, String c) static voidstatic doublemax(hec.io.TimeSeriesContainer tsc) Find the maximum value of the time series.static doublemax(hec.io.TimeSeriesContainer tsc, double ceiling) Find the maximum value of the time series below a ceiling.static hec.io.TimeSeriesContainermax(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainermax(List<ValueContainer> vcl, String c) static intmaxDate(hec.io.TimeSeriesContainer tsc) Find the date/time of the maximum value of the time series under a ceiling.static intmaxDate(hec.io.TimeSeriesContainer tsc, double ceiling) Find the date/time of the maximum value of the time series.static doublemean(hec.io.TimeSeriesContainer tsc) Compute the mean value of the time series.static hec.io.TimeSeriesContainermean(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainermean(List<ValueContainer> vcl, String c) static doublemed(hec.io.TimeSeriesContainer tsc) Compute the median of the time series values.static hec.io.TimeSeriesContainermed(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainermed(List<ValueContainer> vcl, String c) static doublemin(hec.io.TimeSeriesContainer tsc) Find the minimum value of the time series.static doublemin(hec.io.TimeSeriesContainer tsc, double floor) Find the minimum value of the time series above a floor.static hec.io.TimeSeriesContainermin(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainermin(List<ValueContainer> vcl, String c) static intminDate(hec.io.TimeSeriesContainer tsc) Find the date/time of the minimum value of the time series.static intminDate(hec.io.TimeSeriesContainer tsc, double floor) Find the date/time of the minimum value of the time series above a floor.static doublemode(hec.io.TimeSeriesContainer tsc) Compute the mode of the time series values.static hec.io.TimeSeriesContainermodulo(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainermodulo(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainermovingAverage(hec.io.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 hec.io.TimeSeriesContainermultiply(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainermultiply(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainerneg(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerneg(List<ValueContainer> vcl, String c) static intnumberInvalidValues(hec.io.TimeSeriesContainer tsc) Count the number of invalid (missing or rejected) values in the time series values.static intnumberMissingValues(hec.io.TimeSeriesContainer tsc) Count the number of missing (but not rejected) values in the time series values.static intnumberQuestionedValues(hec.io.TimeSeriesContainer tsc) Count the number of questioned values in the time series values.static intnumberRejectedValues(hec.io.TimeSeriesContainer tsc) Count the number of rejected (but not missing) values in the time series values.static intnumberValidValues(hec.io.TimeSeriesContainer tsc) Count the number of valid (non-missing and non-rejected) values in the time series values.static hec.io.TimeSeriesContainerolympicSmoothing(hec.io.TimeSeriesContainer tsc, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) Perform an Olympic smoothing average of the time series.static doublep1(hec.io.TimeSeriesContainer tsc) Compute the p1 of the time series values.static hec.io.TimeSeriesContainerp1(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerp1(List<ValueContainer> vcl, String c) static doublep10(hec.io.TimeSeriesContainer tsc) Compute the p10 of the time series values.static hec.io.TimeSeriesContainerp10(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerp10(List<ValueContainer> vcl, String c) static doublep2(hec.io.TimeSeriesContainer tsc) Compute the p2 of the time series values.static hec.io.TimeSeriesContainerp2(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerp2(List<ValueContainer> vcl, String c) static doublep20(hec.io.TimeSeriesContainer tsc) Compute the p20 of the time series values.static hec.io.TimeSeriesContainerp20(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerp20(List<ValueContainer> vcl, String c) static doublep25(hec.io.TimeSeriesContainer tsc) Compute the p25 of the time series values.static hec.io.TimeSeriesContainerp25(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerp25(List<ValueContainer> vcl, String c) static doublep5(hec.io.TimeSeriesContainer tsc) Compute the p5 of the time series values.static hec.io.TimeSeriesContainerp5(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerp5(List<ValueContainer> vcl, String c) static doublep75(hec.io.TimeSeriesContainer tsc) Compute the p75 of the time series values.static hec.io.TimeSeriesContainerp75(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerp75(List<ValueContainer> vcl, String c) static doublep80(hec.io.TimeSeriesContainer tsc) Compute the p80 of the time series values.static hec.io.TimeSeriesContainerp80(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerp80(List<ValueContainer> vcl, String c) static doublep90(hec.io.TimeSeriesContainer tsc) Compute the p90 of the time series values.static hec.io.TimeSeriesContainerp90(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerp90(List<ValueContainer> vcl, String c) static doublep95(hec.io.TimeSeriesContainer tsc) Compute the p95 of the time series values.static hec.io.TimeSeriesContainerp95(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerp95(List<ValueContainer> vcl, String c) static doublep98(hec.io.TimeSeriesContainer tsc) Compute the p98 of the time series values.static hec.io.TimeSeriesContainerp98(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerp98(List<ValueContainer> vcl, String c) static doublep99(hec.io.TimeSeriesContainer tsc) Compute the p99 of the time series values.static hec.io.TimeSeriesContainerp99(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerp99(List<ValueContainer> vcl, String c) static intparseTimeIntervalString(String timeIntervalStr) static hec.io.TimeSeriesContainerproduct(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerproduct(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainerresample(hec.io.TimeSeriesContainer tsc, mil.army.usace.hec.metadata.Interval interval) Create timeseries derived from input in the specified interval.static doublerms(hec.io.TimeSeriesContainer tsc) Compute the root mean square (quadratic mean) value of the time series.static hec.io.TimeSeriesContainerrms(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerrms(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainerround(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerround(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainerroundOff(hec.io.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 hec.io.TimeSeriesContainerscreenWithConstantValue(hec.io.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 hec.io.TimeSeriesContainerscreenWithConstantValue(hec.io.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 hec.io.TimeSeriesContainerscreenWithConstantValue(hec.io.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 hec.io.TimeSeriesContainerscreenWithConstantValue(hec.io.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 hec.io.TimeSeriesContainerscreenWithDurationMagnitude(hec.io.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 hec.io.TimeSeriesContainerscreenWithDurationMagnitude(hec.io.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 hec.io.TimeSeriesContainerscreenWithDurationMagnitude(hec.io.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 hec.io.TimeSeriesContainerscreenWithForwardMovingAverage(hec.io.TimeSeriesContainer tsc, int numberToAverageOver, double changeLimit, boolean setInvalidValueToUndefined, String qualityFlagForInvalidValue) Flag values in time series exceeding maximum change from a forward moving average.static hec.io.TimeSeriesContainerscreenWithMaxMin(hec.io.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 hec.io.TimeSeriesContainerscreenWithMaxMin(hec.io.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 hec.io.TimeSeriesContainerscreenWithMaxMin(hec.io.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 hec.io.TimeSeriesContainerscreenWithRateOfChange(hec.io.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 hec.io.TimeSeriesContainersign(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainersign(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainersin(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainersin(List<ValueContainer> vcl, String c) static doubleskewCoefficient(hec.io.TimeSeriesContainer tsc) Compute the skew coefficient of the time series values.static hec.io.TimeSeriesContainersnapToRegularInterval(hec.io.TimeSeriesContainer tsc, int timeIntervalMinutes, int timeOffsetMinutes, int timeBackwardMinutes, int timeForwardMinutes) static hec.io.TimeSeriesContainersnapToRegularInterval(hec.io.TimeSeriesContainer tsc, String timeIntervalStr, String timeOffsetStr, String timeBackwardStr, String timeForwardStr) static hec.io.TimeSeriesContainersqrt(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainersqrt(List<ValueContainer> vcl, String c) static doublestandardDeviation(hec.io.TimeSeriesContainer tsc) Compute the standard deviation of the time series values.static hec.io.TimeSeriesContainerstdev(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainerstdev(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainersubtract(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainersubtract(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainersuccessiveDifferences(hec.io.TimeSeriesContainer tsc) Derive a new time series from the successive differences of the current time series.static hec.io.TimeSeriesContainersuccessiveDifferences(hec.io.TimeSeriesContainer tsc, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) Derive a new time series from the successive differences of the current time series.static doublesum(hec.io.TimeSeriesContainer tsc) Compute the total accumulated amount for time series.static hec.io.TimeSeriesContainersum(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainersum(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainertan(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainertan(List<ValueContainer> vcl, String c) static hec.io.TimeSeriesContainertimeDerivative(hec.io.TimeSeriesContainer tsc) Derive a new time series from the successive difference rates of the current time series.static hec.io.TimeSeriesContainertimeDerivative(hec.io.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(hec.io.TimeSeriesContainer currentTsc, hec.io.TimeSeriesContainer newTsc, int functionType, boolean toIrregular, double missingAllowed) static hec.io.TimeSeriesContainertransformWithFunction(hec.io.TimeSeriesContainer baseTsc, ScalarOperable transformer) static hec.io.TimeSeriesContainertruncate(List<ValueContainer> vcl, Condition c) static hec.io.TimeSeriesContainertruncate(List<ValueContainer> vcl, String c) static voidvalidateIndex(hec.io.TimeSeriesContainer tsc, int index) static voidvalidateTimeSeriesContainer(hec.io.TimeSeriesContainer tsc) static doublevar(hec.io.TimeSeriesContainer tsc) Compute the variance value of the time series.static hec.io.TimeSeriesContainervar(List<ValueContainer> vcl, Condition c) static hec.io.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
public static void validateTimeSeriesContainer(hec.io.TimeSeriesContainer tsc) throws ComputationException - Throws:
ComputationException
-
validateIndex
public static void validateIndex(hec.io.TimeSeriesContainer tsc, int index) throws ComputationException - Throws:
ComputationException
-
isRegular
public static boolean isRegular(hec.io.TimeSeriesContainer tsc) -
isIregular
public static boolean isIregular(hec.io.TimeSeriesContainer tsc) -
collectValidValues
-
isValid
public static boolean isValid(hec.io.TimeSeriesContainer tsc, int index) 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
public static boolean isMissing(hec.io.TimeSeriesContainer tsc, int index) 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
public static int findValidValue(hec.io.TimeSeriesContainer tsc, int index, boolean lookAfter) 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(hec.io.TimeSeriesContainer tsc, int time0, int time1, String dataType, int functionType, double missingAllowed, hec.heclib.util.intContainer lastIndex, hec.heclib.util.doubleContainer sumTime) integrate or accumulate tsc over the interval time0 to time1 -
intervalStats
public static double intervalStats(int functionType, hec.io.TimeSeriesContainer tsc, int time0, int time1, int interval, String dataType, double missingAllowed, hec.heclib.util.intContainer lastIndex, hec.heclib.util.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 hec.io.TimeSeriesContainer add(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
add
public static hec.io.TimeSeriesContainer add(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
subtract
public static hec.io.TimeSeriesContainer subtract(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
subtract
public static hec.io.TimeSeriesContainer subtract(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
multiply
public static hec.io.TimeSeriesContainer multiply(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
multiply
public static hec.io.TimeSeriesContainer multiply(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
divide
public static hec.io.TimeSeriesContainer divide(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
divide
public static hec.io.TimeSeriesContainer divide(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
integer_divide
public static hec.io.TimeSeriesContainer integer_divide(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
integer_divide
public static hec.io.TimeSeriesContainer integer_divide(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
modulo
public static hec.io.TimeSeriesContainer modulo(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
modulo
public static hec.io.TimeSeriesContainer modulo(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
exponentiation
public static hec.io.TimeSeriesContainer exponentiation(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
exponentiation
public static hec.io.TimeSeriesContainer exponentiation(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
abs
public static hec.io.TimeSeriesContainer abs(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
abs
public static hec.io.TimeSeriesContainer abs(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
neg
public static hec.io.TimeSeriesContainer neg(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
neg
public static hec.io.TimeSeriesContainer neg(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
inverse
public static hec.io.TimeSeriesContainer inverse(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
inverse
public static hec.io.TimeSeriesContainer inverse(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
sign
public static hec.io.TimeSeriesContainer sign(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
sign
public static hec.io.TimeSeriesContainer sign(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
sqrt
public static hec.io.TimeSeriesContainer sqrt(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
sqrt
public static hec.io.TimeSeriesContainer sqrt(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
exp
public static hec.io.TimeSeriesContainer exp(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
exp
public static hec.io.TimeSeriesContainer exp(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
log
public static hec.io.TimeSeriesContainer log(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
log
public static hec.io.TimeSeriesContainer log(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
log10
public static hec.io.TimeSeriesContainer log10(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
log10
public static hec.io.TimeSeriesContainer log10(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
sin
public static hec.io.TimeSeriesContainer sin(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
sin
public static hec.io.TimeSeriesContainer sin(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
cos
public static hec.io.TimeSeriesContainer cos(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
cos
public static hec.io.TimeSeriesContainer cos(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
tan
public static hec.io.TimeSeriesContainer tan(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
tan
public static hec.io.TimeSeriesContainer tan(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
asin
public static hec.io.TimeSeriesContainer asin(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
asin
public static hec.io.TimeSeriesContainer asin(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
acos
public static hec.io.TimeSeriesContainer acos(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
acos
public static hec.io.TimeSeriesContainer acos(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
atan
public static hec.io.TimeSeriesContainer atan(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
atan
public static hec.io.TimeSeriesContainer atan(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
floor
public static hec.io.TimeSeriesContainer floor(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
floor
public static hec.io.TimeSeriesContainer floor(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
ceil
public static hec.io.TimeSeriesContainer ceil(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
ceil
public static hec.io.TimeSeriesContainer ceil(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
round
public static hec.io.TimeSeriesContainer round(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
round
public static hec.io.TimeSeriesContainer round(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
truncate
public static hec.io.TimeSeriesContainer truncate(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
truncate
public static hec.io.TimeSeriesContainer truncate(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
fmod
public static hec.io.TimeSeriesContainer fmod(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
fmod
public static hec.io.TimeSeriesContainer fmod(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
sum
public static hec.io.TimeSeriesContainer sum(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
sum
public static hec.io.TimeSeriesContainer sum(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
product
public static hec.io.TimeSeriesContainer product(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
product
public static hec.io.TimeSeriesContainer product(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
max
public static hec.io.TimeSeriesContainer max(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
max
public static hec.io.TimeSeriesContainer max(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
min
public static hec.io.TimeSeriesContainer min(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
min
public static hec.io.TimeSeriesContainer min(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
mean
public static hec.io.TimeSeriesContainer mean(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
mean
public static hec.io.TimeSeriesContainer mean(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
gmean
public static hec.io.TimeSeriesContainer gmean(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
gmean
public static hec.io.TimeSeriesContainer gmean(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
hmean
public static hec.io.TimeSeriesContainer hmean(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
hmean
public static hec.io.TimeSeriesContainer hmean(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
rms
public static hec.io.TimeSeriesContainer rms(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
rms
public static hec.io.TimeSeriesContainer rms(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
stdev
public static hec.io.TimeSeriesContainer stdev(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
stdev
public static hec.io.TimeSeriesContainer stdev(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
var
public static hec.io.TimeSeriesContainer var(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
var
public static hec.io.TimeSeriesContainer var(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
med
public static hec.io.TimeSeriesContainer med(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
med
public static hec.io.TimeSeriesContainer med(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p1
public static hec.io.TimeSeriesContainer p1(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p1
public static hec.io.TimeSeriesContainer p1(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p2
public static hec.io.TimeSeriesContainer p2(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p2
public static hec.io.TimeSeriesContainer p2(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p5
public static hec.io.TimeSeriesContainer p5(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p5
public static hec.io.TimeSeriesContainer p5(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p10
public static hec.io.TimeSeriesContainer p10(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p10
public static hec.io.TimeSeriesContainer p10(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p20
public static hec.io.TimeSeriesContainer p20(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p20
public static hec.io.TimeSeriesContainer p20(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p25
public static hec.io.TimeSeriesContainer p25(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p25
public static hec.io.TimeSeriesContainer p25(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p75
public static hec.io.TimeSeriesContainer p75(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p75
public static hec.io.TimeSeriesContainer p75(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p80
public static hec.io.TimeSeriesContainer p80(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p80
public static hec.io.TimeSeriesContainer p80(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p90
public static hec.io.TimeSeriesContainer p90(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p90
public static hec.io.TimeSeriesContainer p90(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p95
public static hec.io.TimeSeriesContainer p95(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p95
public static hec.io.TimeSeriesContainer p95(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p98
public static hec.io.TimeSeriesContainer p98(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p98
public static hec.io.TimeSeriesContainer p98(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p99
public static hec.io.TimeSeriesContainer p99(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p99
public static hec.io.TimeSeriesContainer p99(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
roundOff
public static hec.io.TimeSeriesContainer roundOff(hec.io.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
public static hec.io.TimeSeriesContainer accumulation(hec.io.TimeSeriesContainer tsc) 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".
- Returns:
- A new time series representing the running accumulation of the current time series
- Throws:
ComputationException
-
accumulation
public static hec.io.TimeSeriesContainer accumulation(hec.io.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
public static double max(hec.io.TimeSeriesContainer tsc, double ceiling) throws ComputationException 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
public static int maxDate(hec.io.TimeSeriesContainer tsc, double ceiling) throws ComputationException 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
public static double kurtosisCoefficient(hec.io.TimeSeriesContainer tsc) throws ComputationException 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
public static int numberQuestionedValues(hec.io.TimeSeriesContainer tsc) throws ComputationException 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 hec.io.TimeSeriesContainer differences(hec.io.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 hec.io.TimeSeriesContainer successiveDifferences(hec.io.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 hec.io.TimeSeriesContainer successiveDifferences(hec.io.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 hec.io.TimeSeriesContainer timeDerivative(hec.io.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 hec.io.TimeSeriesContainer timeDerivative(hec.io.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 hec.io.TimeSeriesContainer movingAverage(hec.io.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 hec.io.TimeSeriesContainer centeredMovingAverage(hec.io.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 hec.io.TimeSeriesContainer olympicSmoothing(hec.io.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 hec.io.TimeSeriesContainer forwardMovingAverage(hec.io.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 hec.io.TimeSeriesContainer forwardMovingAverage(hec.io.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 hec.io.TimeSeriesContainer screenWithMaxMin(hec.io.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 hec.io.TimeSeriesContainer screenWithMaxMin(hec.io.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 hec.io.TimeSeriesContainer screenWithMaxMin(hec.io.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 hec.io.TimeSeriesContainer screenWithRateOfChange(hec.io.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 hec.io.TimeSeriesContainer screenWithDurationMagnitude(hec.io.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 hec.io.TimeSeriesContainer screenWithDurationMagnitude(hec.io.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 hec.io.TimeSeriesContainer screenWithDurationMagnitude(hec.io.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 hec.io.TimeSeriesContainer screenWithConstantValue(hec.io.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 hec.io.TimeSeriesContainer screenWithConstantValue(hec.io.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 hec.io.TimeSeriesContainer screenWithConstantValue(hec.io.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 hec.io.TimeSeriesContainer screenWithConstantValue(hec.io.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 hec.io.TimeSeriesContainer screenWithForwardMovingAverage(hec.io.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 hec.io.TimeSeriesContainer estimateForMissingValues(hec.io.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 hec.io.TimeSeriesContainer snapToRegularInterval(hec.io.TimeSeriesContainer tsc, String timeIntervalStr, String timeOffsetStr, String timeBackwardStr, String timeForwardStr) throws ComputationException - Throws:
ComputationException
-
snapToRegularInterval
public static hec.io.TimeSeriesContainer snapToRegularInterval(hec.io.TimeSeriesContainer tsc, int timeIntervalMinutes, int timeOffsetMinutes, int timeBackwardMinutes, int timeForwardMinutes) throws ComputationException - Throws:
ComputationException
-
interpolate
public static double interpolate(hec.io.TimeSeriesContainer tsc, int time, String dataType, hec.heclib.util.intContainer lastIndex) -
transformTimeSeries
public static void transformTimeSeries(hec.io.TimeSeriesContainer currentTsc, hec.io.TimeSeriesContainer newTsc, int functionType, boolean toIrregular, double missingAllowed) throws ComputationException - Throws:
ComputationException
-
main
- Throws:
Exception
-
transformWithFunction
public static hec.io.TimeSeriesContainer transformWithFunction(hec.io.TimeSeriesContainer baseTsc, ScalarOperable transformer) -
resample
public static hec.io.TimeSeriesContainer resample(hec.io.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
-