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 TimeSeriesContainer
abs
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
abs
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
Derive a new time series by computing a running accumulation of the parameter time seriestsc
.static TimeSeriesContainer
accumulation
(TimeSeriesContainer tsc, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) Derive a new time series by computing a running accumulation of the parameter time seriestsc
.static TimeSeriesContainer
acos
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
acos
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
add
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
add
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
asin
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
asin
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
atan
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
atan
(List<ValueContainer> vcl, String c) static int
bisearch
(double[] xarray, double x, int n) binary search with upper limitstatic int
bisearch
(int[] xarray, int x, int n) binary search with upper limitstatic TimeSeriesContainer
ceil
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
ceil
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
centeredMovingAverage
(TimeSeriesContainer tsc, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) Perform a centered moving average smoothing of the time series.static List<ValueContainer>
static TimeSeriesContainer
cos
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
cos
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
differences
(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 TimeSeriesContainer
divide
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
divide
(List<ValueContainer> vcl, String c) static int
durationMinutes
(String durationStr) static TimeSeriesContainer
estimateForMissingValues
(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 TimeSeriesContainer
exp
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
exp
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
exponentiation
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
exponentiation
(List<ValueContainer> vcl, String c) 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.static int
findValidValue
(TimeSeriesContainer tsc, int index, boolean lookAfter) find the first valid value index before or after a specified indexstatic int
Find the date and time of the first valid time series value.static double
Find the first valid value in the time series.static TimeSeriesContainer
floor
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
floor
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
fmod
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
fmod
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
forwardMovingAverage
(TimeSeriesContainer tsc, int numberToAverageOver) Compute a forward moving average of the time series.static TimeSeriesContainer
forwardMovingAverage
(TimeSeriesContainer tsc, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) Compute a forward moving average of the time series.static double
gmean
(TimeSeriesContainer tsc) Compute the geometric mean value of the time series.static TimeSeriesContainer
gmean
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
gmean
(List<ValueContainer> vcl, String c) static double
hmean
(TimeSeriesContainer tsc) Compute the harmonic mean value of the time series.static TimeSeriesContainer
hmean
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
hmean
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
integer_divide
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
integer_divide
(List<ValueContainer> vcl, String c) static double
integrate
(TimeSeriesContainer tsc, int time0, int time1, String dataType, int functionType, double missingAllowed, intContainer lastIndex, doubleContainer sumTime) integrate or accumulate tsc over the interval time0 to time1static double
interpolate
(TimeSeriesContainer tsc, int time, String dataType, intContainer lastIndex) static double
intervalStats
(int functionType, TimeSeriesContainer tsc, int time0, int time1, int interval, String dataType, double missingAllowed, intContainer lastIndex, intContainer timeOfOccurrence) Compute max, min and count between time0 and time1 for time series transform.static TimeSeriesContainer
inverse
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
inverse
(List<ValueContainer> vcl, String c) static boolean
protected static boolean
isMissing
(TimeSeriesContainer tsc, int index) Determine if the data value intsc
is missing (missing quality or undefined value) for the index locationindex
.static boolean
static boolean
isValid
(TimeSeriesContainer tsc, int index) Determine if the data value intsc
is valid (not missing, rejected, or undefined) for the index locationindex
.static double
Compute the kurtosis coefficient of the time series values.static int
Find the date and time of the last valid time series value.static double
Find the last valid value in the time series.static TimeSeriesContainer
log
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
log
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
log10
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
log10
(List<ValueContainer> vcl, String c) static void
static double
max
(TimeSeriesContainer tsc) Find the maximum value of the time series.static double
max
(TimeSeriesContainer tsc, double ceiling) Find the maximum value of the time series below a ceiling.static TimeSeriesContainer
max
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
max
(List<ValueContainer> vcl, String c) static int
Find the date/time of the maximum value of the time series under a ceiling.static int
maxDate
(TimeSeriesContainer tsc, double ceiling) Find the date/time of the maximum value of the time series.static double
mean
(TimeSeriesContainer tsc) Compute the mean value of the time series.static TimeSeriesContainer
mean
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
mean
(List<ValueContainer> vcl, String c) static double
med
(TimeSeriesContainer tsc) Compute the median of the time series values.static TimeSeriesContainer
med
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
med
(List<ValueContainer> vcl, String c) static double
min
(TimeSeriesContainer tsc) Find the minimum value of the time series.static double
min
(TimeSeriesContainer tsc, double floor) Find the minimum value of the time series above a floor.static TimeSeriesContainer
min
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
min
(List<ValueContainer> vcl, String c) static int
Find the date/time of the minimum value of the time series.static int
minDate
(TimeSeriesContainer tsc, double floor) Find the date/time of the minimum value of the time series above a floor.static double
mode
(TimeSeriesContainer tsc) Compute the mode of the time series values.static TimeSeriesContainer
modulo
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
modulo
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
movingAverage
(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 TimeSeriesContainer
multiply
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
multiply
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
neg
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
neg
(List<ValueContainer> vcl, String c) static int
Count the number of invalid (missing or rejected) values in the time series values.static int
Count the number of missing (but not rejected) values in the time series values.static int
Count the number of questioned values in the time series values.static int
Count the number of rejected (but not missing) values in the time series values.static int
Count the number of valid (non-missing and non-rejected) values in the time series values.static TimeSeriesContainer
olympicSmoothing
(TimeSeriesContainer tsc, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) Perform an Olympic smoothing average of the time series.static double
p1
(TimeSeriesContainer tsc) Compute the p1 of the time series values.static TimeSeriesContainer
p1
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
p1
(List<ValueContainer> vcl, String c) static double
p10
(TimeSeriesContainer tsc) Compute the p10 of the time series values.static TimeSeriesContainer
p10
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
p10
(List<ValueContainer> vcl, String c) static double
p2
(TimeSeriesContainer tsc) Compute the p2 of the time series values.static TimeSeriesContainer
p2
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
p2
(List<ValueContainer> vcl, String c) static double
p20
(TimeSeriesContainer tsc) Compute the p20 of the time series values.static TimeSeriesContainer
p20
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
p20
(List<ValueContainer> vcl, String c) static double
p25
(TimeSeriesContainer tsc) Compute the p25 of the time series values.static TimeSeriesContainer
p25
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
p25
(List<ValueContainer> vcl, String c) static double
p5
(TimeSeriesContainer tsc) Compute the p5 of the time series values.static TimeSeriesContainer
p5
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
p5
(List<ValueContainer> vcl, String c) static double
p75
(TimeSeriesContainer tsc) Compute the p75 of the time series values.static TimeSeriesContainer
p75
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
p75
(List<ValueContainer> vcl, String c) static double
p80
(TimeSeriesContainer tsc) Compute the p80 of the time series values.static TimeSeriesContainer
p80
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
p80
(List<ValueContainer> vcl, String c) static double
p90
(TimeSeriesContainer tsc) Compute the p90 of the time series values.static TimeSeriesContainer
p90
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
p90
(List<ValueContainer> vcl, String c) static double
p95
(TimeSeriesContainer tsc) Compute the p95 of the time series values.static TimeSeriesContainer
p95
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
p95
(List<ValueContainer> vcl, String c) static double
p98
(TimeSeriesContainer tsc) Compute the p98 of the time series values.static TimeSeriesContainer
p98
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
p98
(List<ValueContainer> vcl, String c) static double
p99
(TimeSeriesContainer tsc) Compute the p99 of the time series values.static TimeSeriesContainer
p99
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
p99
(List<ValueContainer> vcl, String c) static int
parseTimeIntervalString
(String timeIntervalStr) static TimeSeriesContainer
product
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
product
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
resample
(TimeSeriesContainer tsc, mil.army.usace.hec.metadata.Interval interval) Create timeseries derived from input in the specified interval.static double
rms
(TimeSeriesContainer tsc) Compute the root mean square (quadratic mean) value of the time series.static TimeSeriesContainer
rms
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
rms
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
round
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
round
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
roundOff
(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 TimeSeriesContainer
screenWithConstantValue
(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 TimeSeriesContainer
screenWithConstantValue
(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 TimeSeriesContainer
screenWithConstantValue
(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 TimeSeriesContainer
screenWithConstantValue
(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 TimeSeriesContainer
screenWithDurationMagnitude
(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 TimeSeriesContainer
screenWithDurationMagnitude
(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 TimeSeriesContainer
screenWithDurationMagnitude
(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 TimeSeriesContainer
screenWithForwardMovingAverage
(TimeSeriesContainer tsc, int numberToAverageOver, double changeLimit, boolean setInvalidValueToUndefined, String qualityFlagForInvalidValue) Flag values in time series exceeding maximum change from a forward moving average.static TimeSeriesContainer
screenWithMaxMin
(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 TimeSeriesContainer
screenWithMaxMin
(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 TimeSeriesContainer
screenWithMaxMin
(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 TimeSeriesContainer
screenWithRateOfChange
(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 boolean
setAlwaysAllowUnsafe
(boolean state) static boolean
setAlwaysCreateQuality
(boolean state) static boolean
setAlwaysWarnUnsafe
(boolean state) static TimeSeriesContainer
sign
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
sign
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
sin
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
sin
(List<ValueContainer> vcl, String c) static double
Compute the skew coefficient of the time series values.static TimeSeriesContainer
snapToRegularInterval
(TimeSeriesContainer tsc, int timeIntervalMinutes, int timeOffsetMinutes, int timeBackwardMinutes, int timeForwardMinutes) static TimeSeriesContainer
snapToRegularInterval
(TimeSeriesContainer tsc, String timeIntervalStr, String timeOffsetStr, String timeBackwardStr, String timeForwardStr) static TimeSeriesContainer
sqrt
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
sqrt
(List<ValueContainer> vcl, String c) static double
Compute the standard deviation of the time series values.static TimeSeriesContainer
stdev
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
stdev
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
subtract
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
subtract
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
Derive a new time series from the successive differences of the current time series.static TimeSeriesContainer
successiveDifferences
(TimeSeriesContainer tsc, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) Derive a new time series from the successive differences of the current time series.static double
sum
(TimeSeriesContainer tsc) Compute the total accumulated amount for time series.static TimeSeriesContainer
sum
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
sum
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
tan
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
tan
(List<ValueContainer> vcl, String c) static TimeSeriesContainer
Derive a new time series from the successive difference rates of the current time series.static TimeSeriesContainer
timeDerivative
(TimeSeriesContainer tsc, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) Derive a new time series from the successive difference rates of the current time series.static void
transformTimeSeries
(TimeSeriesContainer currentTsc, TimeSeriesContainer newTsc, int functionType, boolean toIrregular, double missingAllowed) static TimeSeriesContainer
transformWithFunction
(TimeSeriesContainer baseTsc, ScalarOperable transformer) static TimeSeriesContainer
truncate
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
truncate
(List<ValueContainer> vcl, String c) static void
validateIndex
(TimeSeriesContainer tsc, int index) static void
static double
var
(TimeSeriesContainer tsc) Compute the variance value of the time series.static TimeSeriesContainer
var
(List<ValueContainer> vcl, Condition c) static TimeSeriesContainer
var
(List<ValueContainer> vcl, String c)
-
Field Details
-
validTimeSeriesTypes
-
instTimeSeriesTypes
-
periodTimeSeriesTypes
-
totalTimeSeriesTypes
-
averageTimeSeriesTypes
-
dssTimeSeriesTypes
-
cwmsTimeSeriesTypes
-
-
Constructor Details
-
TimeSeriesFunctions
public TimeSeriesFunctions()
-
-
Method Details
-
parseTimeIntervalString
- Throws:
ComputationException
-
setAlwaysAllowUnsafe
public static boolean setAlwaysAllowUnsafe(boolean state) -
setAlwaysWarnUnsafe
public static boolean setAlwaysWarnUnsafe(boolean state) -
setAlwaysCreateQuality
public static boolean setAlwaysCreateQuality(boolean state) -
validateTimeSeriesContainer
- Throws:
ComputationException
-
validateIndex
- Throws:
ComputationException
-
isRegular
-
isIregular
-
collectValidValues
-
isValid
Determine if the data value intsc
is valid (not missing, rejected, or undefined) for the index locationindex
.- Parameters:
tsc
- a TimeSeriesContainer.index
- the array index of the value of interest.- Returns:
- true if the value is valid (not missing or undefined).
- Throws:
ComputationException
-
isMissing
Determine if the data value intsc
is missing (missing quality or undefined value) for the index locationindex
.- Parameters:
tsc
- a TimeSeriesContainer.index
- the array index of the value of interest.- Returns:
- true if the value is valid (not missing or undefined).
- Throws:
ComputationException
-
bisearch
public static int bisearch(int[] xarray, int x, int n) binary search with upper limit- Parameters:
xarray
- the array to find the position inx
- the item to find the position forn
- the upper limit in the array- Returns:
- the position
-
bisearch
public static int bisearch(double[] xarray, double x, int n) binary search with upper limit- Parameters:
xarray
- the array to find the position inx
- the item to find the position forn
- the upper limit in the array- Returns:
- the position
-
findInterval
public static int findInterval(int[] times, int time, int lastIndex) Find interval times array in which "time" lies in and return the index position of the first point. times[idx] <= time < times[idx+1] -
findValidValue
find the first valid value index before or after a specified index- Parameters:
tsc
- the TimeSeriesContainer to checkindex
- the index to look before or afterlookAfter
- whether to look after- Returns:
- the first valid value index
-
integrate
public static double integrate(TimeSeriesContainer tsc, int time0, int time1, String dataType, int functionType, double missingAllowed, intContainer lastIndex, doubleContainer sumTime) integrate or accumulate tsc over the interval time0 to time1 -
intervalStats
public static double intervalStats(int functionType, TimeSeriesContainer tsc, int time0, int time1, int interval, String dataType, double missingAllowed, intContainer lastIndex, intContainer timeOfOccurrence) Compute max, min and count between time0 and time1 for time series transform. Return value for the appropriate function specified by functionType. -
add
public static TimeSeriesContainer add(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
add
public static TimeSeriesContainer add(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
subtract
public static TimeSeriesContainer subtract(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
subtract
public static TimeSeriesContainer subtract(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
multiply
public static TimeSeriesContainer multiply(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
multiply
public static TimeSeriesContainer multiply(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
divide
public static TimeSeriesContainer divide(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
divide
public static TimeSeriesContainer divide(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
integer_divide
public static TimeSeriesContainer integer_divide(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
integer_divide
public static TimeSeriesContainer integer_divide(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
modulo
public static TimeSeriesContainer modulo(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
modulo
public static TimeSeriesContainer modulo(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
exponentiation
public static TimeSeriesContainer exponentiation(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
exponentiation
public static TimeSeriesContainer exponentiation(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
abs
public static TimeSeriesContainer abs(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
abs
public static TimeSeriesContainer abs(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
neg
public static TimeSeriesContainer neg(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
neg
public static TimeSeriesContainer neg(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
inverse
public static TimeSeriesContainer inverse(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
inverse
public static TimeSeriesContainer inverse(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
sign
public static TimeSeriesContainer sign(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
sign
public static TimeSeriesContainer sign(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
sqrt
public static TimeSeriesContainer sqrt(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
sqrt
public static TimeSeriesContainer sqrt(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
exp
public static TimeSeriesContainer exp(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
exp
public static TimeSeriesContainer exp(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
log
public static TimeSeriesContainer log(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
log
public static TimeSeriesContainer log(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
log10
public static TimeSeriesContainer log10(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
log10
public static TimeSeriesContainer log10(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
sin
public static TimeSeriesContainer sin(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
sin
public static TimeSeriesContainer sin(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
cos
public static TimeSeriesContainer cos(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
cos
public static TimeSeriesContainer cos(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
tan
public static TimeSeriesContainer tan(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
tan
public static TimeSeriesContainer tan(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
asin
public static TimeSeriesContainer asin(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
asin
public static TimeSeriesContainer asin(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
acos
public static TimeSeriesContainer acos(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
acos
public static TimeSeriesContainer acos(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
atan
public static TimeSeriesContainer atan(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
atan
public static TimeSeriesContainer atan(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
floor
public static TimeSeriesContainer floor(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
floor
public static TimeSeriesContainer floor(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
ceil
public static TimeSeriesContainer ceil(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
ceil
public static TimeSeriesContainer ceil(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
round
public static TimeSeriesContainer round(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
round
public static TimeSeriesContainer round(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
truncate
public static TimeSeriesContainer truncate(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
truncate
public static TimeSeriesContainer truncate(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
fmod
public static TimeSeriesContainer fmod(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
fmod
public static TimeSeriesContainer fmod(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
sum
public static TimeSeriesContainer sum(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
sum
public static TimeSeriesContainer sum(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
product
public static TimeSeriesContainer product(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
product
public static TimeSeriesContainer product(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
max
public static TimeSeriesContainer max(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
max
public static TimeSeriesContainer max(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
min
public static TimeSeriesContainer min(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
min
public static TimeSeriesContainer min(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
mean
public static TimeSeriesContainer mean(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
mean
public static TimeSeriesContainer mean(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
gmean
public static TimeSeriesContainer gmean(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
gmean
public static TimeSeriesContainer gmean(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
hmean
public static TimeSeriesContainer hmean(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
hmean
public static TimeSeriesContainer hmean(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
rms
public static TimeSeriesContainer rms(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
rms
public static TimeSeriesContainer rms(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
stdev
public static TimeSeriesContainer stdev(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
stdev
public static TimeSeriesContainer stdev(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
var
public static TimeSeriesContainer var(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
var
public static TimeSeriesContainer var(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
med
public static TimeSeriesContainer med(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
med
public static TimeSeriesContainer med(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p1
public static TimeSeriesContainer p1(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p1
public static TimeSeriesContainer p1(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p2
public static TimeSeriesContainer p2(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p2
public static TimeSeriesContainer p2(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p5
public static TimeSeriesContainer p5(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p5
public static TimeSeriesContainer p5(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p10
public static TimeSeriesContainer p10(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p10
public static TimeSeriesContainer p10(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p20
public static TimeSeriesContainer p20(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p20
public static TimeSeriesContainer p20(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p25
public static TimeSeriesContainer p25(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p25
public static TimeSeriesContainer p25(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p75
public static TimeSeriesContainer p75(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p75
public static TimeSeriesContainer p75(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p80
public static TimeSeriesContainer p80(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p80
public static TimeSeriesContainer p80(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p90
public static TimeSeriesContainer p90(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p90
public static TimeSeriesContainer p90(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p95
public static TimeSeriesContainer p95(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p95
public static TimeSeriesContainer p95(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p98
public static TimeSeriesContainer p98(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p98
public static TimeSeriesContainer p98(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
p99
public static TimeSeriesContainer p99(List<ValueContainer> vcl, Condition c) throws ComputationException - Throws:
ComputationException
-
p99
public static TimeSeriesContainer p99(List<ValueContainer> vcl, String c) throws ComputationException - Throws:
ComputationException
-
roundOff
public static TimeSeriesContainer roundOff(TimeSeriesContainer tsc, int digitsPrecision, int powerOfTensPlace) throws ComputationException Derive a new time series with values of the current time series rounded to the specified precision and/or power of tens place.digitsPrecision
controls the number of significant digits displayed and can range from 1 to 8.powerOfTensPlace
is 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 = 1
Values which are missing in the original time series will be missing in the new time series.- Parameters:
digitsPrecision
- Number of digits of precision, between 1 and 8.powerOfTensPlace
- Magnitude of ten to round to.- Returns:
- A new time series composed of values of the current time series rounded to the specified precision.
- Throws:
ComputationException
-
accumulation
Derive a new time series by computing a running accumulation of the parameter time seriestsc
.For time points in which the parameter time series
tsc
value is missing or rejected, the value in the accumulation time series remains constant (same as the accumulated value at the last valid point location).The new time series will have all quality values set to "no quality".
- Returns:
- A new time series representing the running accumulation of the current time series
- Throws:
ComputationException
-
accumulation
public static TimeSeriesContainer accumulation(TimeSeriesContainer tsc, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) throws ComputationException Derive a new time series by computing a running accumulation of the parameter time seriestsc
.For time points in which the parameter time series
tsc
value is missing or rejected, the value in the accumulation time series remains constant (same as the accumulated value at the last valid point location).The new time series will have all quality values set to "no quality".
- Parameters:
tsc
- the TimeSeriesContainerallowUnsafe
- flag specifying whether to allow "unsafe" math operations.warnUnsafe
- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A new time series representing the running accumulation of the current time series
- Throws:
ComputationException
-
min
Find the minimum value of the time series. Missing and rejected values are excluded.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the minimum value of the time series.
- Throws:
ComputationException
-
min
Find the minimum value of the time series above a floor. Missing and rejected values are excluded.- Parameters:
tsc
- the TimeSeriesContainerfloor
- the value to compute the minimum above- Returns:
- the minimum value of the time series.
- Throws:
ComputationException
-
minDate
Find the date/time of the minimum value of the time series. Missing and rejected values are excluded.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the date and time of the minimum value as an int value translatable by HecTime
- Throws:
ComputationException
- See Also:
-
minDate
Find the date/time of the minimum value of the time series above a floor. Missing and rejected values are excluded.- Parameters:
tsc
- the TimeSeriesContainerfloor
- the value to compute the minimum above- Returns:
- the date and time of the minimum value as an int value translatable by HecTime
- Throws:
ComputationException
- See Also:
-
max
Find the maximum value of the time series. Missing and rejected values are excluded.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the maximum value of the time series.
- Throws:
ComputationException
-
max
Find the maximum value of the time series below a ceiling. Missing and rejected values are excluded.- Parameters:
tsc
- the TimeSeriesContainerceiling
- the value under which to compute the maximum- Returns:
- the maximum value of the time series.
- Throws:
ComputationException
-
maxDate
Find the date/time of the maximum value of the time series under a ceiling. Missing and rejected values are excluded.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the date and time of the maximum value as an int value translatable by HecTime
- Throws:
ComputationException
- See Also:
-
maxDate
Find the date/time of the maximum value of the time series. Missing and rejected values are excluded.- Parameters:
tsc
- the TimeSeriesContainerceiling
- the value under which to compute the maximum- Returns:
- the date and time of the maximum value as an int value translatable by HecTime
- Throws:
ComputationException
- See Also:
-
mean
Compute the mean value of the time series. Missing and rejected values are excluded.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the mean value of the time series.
- Throws:
ComputationException
-
gmean
Compute the geometric mean value of the time series. Missing and rejected values are excluded.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the geometric mean value of the time series.
- Throws:
ComputationException
-
hmean
Compute the harmonic mean value of the time series. Missing and rejected values are excluded.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the harmonic mean value of the time series.
- Throws:
ComputationException
-
rms
Compute the root mean square (quadratic mean) value of the time series. Missing and rejected values are excluded.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the root mean square (quadratic mean) mean value of the time series.
- Throws:
ComputationException
-
var
Compute the variance value of the time series. Missing and rejected values are excluded.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the variance mean value of the time series.
- Throws:
ComputationException
-
sum
Compute the total accumulated amount for time series. Missing and rejected values are excluded.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the total accumulated value of the time series.
- Throws:
ComputationException
-
standardDeviation
Compute the standard deviation of the time series values. Missing and rejected values are excluded. A minimum of three valid values are required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the standard deviation value of the time series.
- Throws:
ComputationException
-
skewCoefficient
Compute the skew coefficient of the time series values. Missing values and rejected are excluded. A minimum of three valid values are required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the skew coefficient value of the time series.
- Throws:
ComputationException
-
kurtosisCoefficient
Compute the kurtosis coefficient of the time series values. Missing values and rejected are excluded. A minimum of four valid values are required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the kurtosis coefficient value of the time series.
- Throws:
ComputationException
-
mode
Compute the mode of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the mode coefficient value of the time series.
- Throws:
ComputationException
-
med
Compute the median of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the median coefficient value of the time series.
- Throws:
ComputationException
-
p1
Compute the p1 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the p1 coefficient value of the time series.
- Throws:
ComputationException
-
p2
Compute the p2 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the p2 coefficient value of the time series.
- Throws:
ComputationException
-
p5
Compute the p5 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the p5 coefficient value of the time series.
- Throws:
ComputationException
-
p10
Compute the p10 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the p10 coefficient value of the time series.
- Throws:
ComputationException
-
p20
Compute the p20 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the p20 coefficient value of the time series.
- Throws:
ComputationException
-
p25
Compute the p25 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the p25 coefficient value of the time series.
- Throws:
ComputationException
-
p75
Compute the p75 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the p75 coefficient value of the time series.
- Throws:
ComputationException
-
p80
Compute the p80 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the p80 coefficient value of the time series.
- Throws:
ComputationException
-
p90
Compute the p90 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the p90 coefficient value of the time series.
- Throws:
ComputationException
-
p95
Compute the p95 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the p95 coefficient value of the time series.
- Throws:
ComputationException
-
p98
Compute the p98 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the p98 coefficient value of the time series.
- Throws:
ComputationException
-
p99
Compute the p99 of the time series values. Missing values and rejected are excluded. A minimum of one valid value is required for the computation.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the p99 coefficient value of the time series.
- Throws:
ComputationException
-
numberValidValues
Count the number of valid (non-missing and non-rejected) values in the time series values.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the number of valid (non-missing and non-rejected) values in the time series.
- Throws:
ComputationException
-
numberInvalidValues
Count the number of invalid (missing or rejected) values in the time series values.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the number of invalid (missing or rejected) values in the time series.
- Throws:
ComputationException
-
numberMissingValues
Count the number of missing (but not rejected) values in the time series values.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the number of missing (but not rejected) values in the time series.
- Throws:
ComputationException
-
numberRejectedValues
Count the number of rejected (but not missing) values in the time series values.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the number of rejected (but not missing) values in the time series.
- Throws:
ComputationException
-
numberQuestionedValues
Count the number of questioned values in the time series values.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the number of questioned values in the time series.
- Throws:
ComputationException
-
firstValidDate
Find the date and time of the first valid time series value.- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- the date and time of the first valid value as an int value translatable by HecTime
- Throws:
ComputationException
- See Also:
-
firstValidValue
Find the first valid value in the time series.- Returns:
- the value of the first valid time series value.
- Throws:
HecMathException
ComputationException
-
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:
HecMathException
ComputationException
-
differences
public static TimeSeriesContainer differences(TimeSeriesContainer tsc, boolean time_based, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) throws ComputationException Derive a new time series from the differences (time-based or otherwise) of the current time series. The time series must be of type "INST-CUM". The value in the new time is set to missing if either the current or previous point in the current time series is set to missing (need to have two consecutive valid values).By default, if the data type of the current time series is "INST-CUM", the data type of the new time series is set to "PER-CUM".
- Parameters:
tsc
- the TimeSeriesContainertime_based
- flag specifying whether compute successive difference (false) or time derivatives (true)allowUnsafe
- flag specifying whether to allow "unsafe" math operations.warnUnsafe
- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A new time series of successive differences.
- Throws:
ComputationException
ComputationException
-
successiveDifferences
public static TimeSeriesContainer successiveDifferences(TimeSeriesContainer tsc) throws ComputationException Derive a new time series from the successive differences of the current time series. The time series must be of type "INST-CUM". The value in the new time is set to missing if either the current or previous point in the current time series is set to missing (need to have two consecutive valid values).By default, if the data type of the current time series is "INST-CUM", the data type of the new time series is set to "PER-CUM".
- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- A new time series of successive differences.
- Throws:
ComputationException
-
successiveDifferences
public static TimeSeriesContainer successiveDifferences(TimeSeriesContainer tsc, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) throws ComputationException Derive a new time series from the successive differences of the current time series. The time series must be of type "INST-CUM". The value in the new time is set to missing if either the current or previous point in the current time series is set to missing (need to have two consecutive valid values).By default, if the data type of the current time series is "INST-CUM", the data type of the new time series is set to "PER-CUM".
- Parameters:
tsc
- the TimeSeriesContainerallowUnsafe
- flag specifying whether to allow "unsafe" math operations.warnUnsafe
- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A new time series of successive differences.
- Throws:
ComputationException
-
timeDerivative
public static TimeSeriesContainer timeDerivative(TimeSeriesContainer tsc) throws ComputationException Derive a new time series from the successive difference rates of the current time series. The time series must be of type "INST-CUM". The value in the new time is set to missing if either the current or previous point in the current time series is set to missing (need to have two consecutive valid values).By default, if the data type of the current time series is "INST-CUM", the data type of the new time series is set to "PER-CUM".
- Parameters:
tsc
- the TimeSeriesContainer- Returns:
- A new time series of successive differences.
- Throws:
ComputationException
-
timeDerivative
public static TimeSeriesContainer timeDerivative(TimeSeriesContainer tsc, boolean allowUnsafe, boolean warnUnsafe, boolean createQuality) throws ComputationException Derive a new time series from the successive difference rates of the current time series. The time series must be of type "INST-CUM". The value in the new time is set to missing if either the current or previous point in the current time series is set to missing (need to have two consecutive valid values).By default, if the data type of the current time series is "INST-CUM", the data type of the new time series is set to "PER-CUM".
- Parameters:
tsc
- the TimeSeriesContainerallowUnsafe
- flag specifying whether to allow "unsafe" math operations.warnUnsafe
- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A new time series of successive differences.
- Throws:
ComputationException
-
movingAverage
public static TimeSeriesContainer movingAverage(TimeSeriesContainer tsc, TimeSeriesFunctions.MovingAverageMethod method, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) throws ComputationException Derive a new time series by performing a moving average of with the specified method. Only valid (non missing, non-rejected) values are used to average, although invalid values may exist within the range of values to average, depending on the setting of theonlyValidValues
argument. Average values near the beginning or end of the time series may or may not be computed based on the setting of theuseReduced
argument.- 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 forCENTERED
orOLYMPIC
methods.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 thenumberToAverageOver
argument if an invalid element in thetsc
argument is encounterd.useReduced
- Specifies whether to compute averages for elements near enough to the beginning or end of the time series that thenumberToAverageOver
argument cannot be satisfied. Iftrue
, then the number of elements required for the average will be reduced accordingly. Iffalse
, elements near the beginning and/or end of the time series will be set to missing.- Returns:
- The derived time series.
- Throws:
ComputationException
-
centeredMovingAverage
public static TimeSeriesContainer centeredMovingAverage(TimeSeriesContainer tsc, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) throws ComputationException Perform a centered moving average smoothing of the time series.Derive a new time series from the centered moving average of
numberToAverageOver
values in the current time series.If
onlyValidValues
is set to true, then if points in the averaging interval are missing values, the point in the new time series is set to missing. IfonlyValidValues
is 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
useReduced
is 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 thannumberToAverageOver
values in the interval. IfuseReduced
is set to false, then the first and lastnumberToAverageOver/2
points 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/2
points 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 thenumberToAverageOver
is less than 3 or not odd.
-
olympicSmoothing
public static TimeSeriesContainer olympicSmoothing(TimeSeriesContainer tsc, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) throws ComputationException Perform an Olympic smoothing average of the time series.Derive a new time series from the Olympic smoothing average of
numberToAverageOver
values 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
onlyValidValues
is set to true, then if points in the averaging interval are missing values, the point in the new time series is set to missing. IfonlyValidValues
is 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
useReduced
is 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 thannumberToAverageOver
values in the interval. IfuseReduced
is set to false, then the first and lastnumberToAverageOver/2
points 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/2
points 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 thenumberToAverageOver
is less than 3 or not odd.
-
forwardMovingAverage
public static TimeSeriesContainer forwardMovingAverage(TimeSeriesContainer tsc, int numberToAverageOver, boolean onlyValidValues, boolean useReduced) throws ComputationException Compute a forward moving average of the time series.Derive a new time series from the forward moving average of the last
numberToAverageOver
values of the current time series.If
onlyValidValues
is set to true, then if points in the averaging interval are missing values, the point in the new time series is set to missing. IfonlyValidValues
is 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
useReduced
is 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 thannumberToAverageOver
values in the interval. IfuseReduced
is set to false, then the firstnumberToAverageOver
points 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/2
points of the new time series to missing.- Returns:
- a new time series computed from the forward moving average of current time series.
- Throws:
ComputationException
-
forwardMovingAverage
public static TimeSeriesContainer forwardMovingAverage(TimeSeriesContainer tsc, int numberToAverageOver) throws ComputationException Compute a forward moving average of the time series.Derive a new time series from the forward moving average of the last
numberToAverageOver
values of the current time series. If a missing value is occurs over thenumberToAverageOver
points, the value is excluded from the computation and the average is over one less value. At least to valid values must be defined over the averaging interval or else the point in the new time series is set to missing.- Parameters:
tsc
- The time series to derive from.numberToAverageOver
- the number of values to average over for computing the forward moving average. Must be greater than or equal to 2.- Returns:
- a new time series computed from the forward moving average of current time series.
- Throws:
ComputationException
-
screenWithMaxMin
public static TimeSeriesContainer screenWithMaxMin(TimeSeriesContainer tsc, double minValueLimit, double maxValueLimit, double changeLimit, boolean setInvalidValueToSpecified, double invalidValueReplacement, String qualityFlagForInvalidValue) throws ComputationException Flag values in time series exceeding minimum and maximum limit values or maximum change limit.Values in the time series are screened for quality. Values below
minValueLimit
or abovemaxValueLimit
or with a change from the previous time series value greater thanchangeLimit
fail the quality test. The maximum change comparison is done only when consecutive values are not flagged.If
setInvalidToSpecifiedValue
is set to "true", values failing the screening test are set to the specified value.If
qualityFlagForInvalidValue
is 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 issetInvalidToSpecifiedValue
is set to "true".qualityFlagForInvalidValue
- character string representing the quality flag setting for values failing the quality test. The accepted character strings are: "M" or "Missing", "R" or "Rejected", "Q" or "Questionable".- Returns:
- A copy of the time series with values failing the quality test set to missing and/or with the quality flag set to the user specified quality for invalid values.
- Throws:
ComputationException
- See Also:
-
screenWithMaxMin
public static TimeSeriesContainer screenWithMaxMin(TimeSeriesContainer tsc, double minValueLimit, double maxValueLimit, double changeLimit, boolean setInvalidValueToUndefined, String qualityFlagForInvalidValue) throws ComputationException Flag values in time series exceeding minimum and maximum limit values or maximum change limit.Values in the time series are screened for quality. Values below
minValueLimit
or abovemaxValueLimit
or with a change from the previous time series value greater thanchangeLimit
fail the quality test. The maximum change comparison is done only when consecutive values are not flagged.If
setInvalidToMissingValue
is set to "true", values failing the screening test are set to the "Missing" value.If
qualityFlagForInvalidValue
is set to a character or string recognized as a valid quality flag, the quality flag will be set for tested values. If there is no previously existing quality available for the time series, the quality flag array will be created for the time series. Values failing the quality test are set to the user specified quality flag for invalid values. If there is existing quality data and the time series value passes the quality test, the existing quality flag for the points is unchanged. If there was no previously existing quality and the time series value passes the quality test, the quality flag for the point is set to "Okay".- Parameters:
tsc
- The time series to derive from.minValueLimit
- minimum valid value limit.maxValueLimit
- maximum valid value limit.changeLimit
- maximum change allowed in the tested value from the previous time series value.setInvalidValueToUndefined
- if true, time series values failing the quality test are set to the "Undefined" value.qualityFlagForInvalidValue
- character string representing the quality flag setting for values failing the quality test. The accepted character strings are: "M" or "Missing", "R" or "Rejected", "Q" or "Questionable".- Returns:
- A copy of the time series with values failing the quality test set to missing and/or with the quality flag set to the user specified quality for invalid values.
- Throws:
ComputationException
- See Also:
-
screenWithMaxMin
public static TimeSeriesContainer screenWithMaxMin(TimeSeriesContainer tsc, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit) throws ComputationException Flag values in time series exceeding minimum and maximum limit values as questionable or rejected.Values in the time series are screened for quality. Values below
minRejectLimit
or abovemaxRejectLimit
are marked with a rejected quality flag. Other values belowminQuestionLimit
or abovemaxQuestionLimit
are 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 belowminRejectLimit
will be marked as questioned.maxQuestionLimit
- Values above this, but not abovemaxRejectLimit
will be marked as questioned.maxRejectLimit
- Values above this will be marked as rejected.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
- See Also:
-
screenWithRateOfChange
public static TimeSeriesContainer screenWithRateOfChange(TimeSeriesContainer tsc, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit) throws ComputationException Flag values in time series whose rate of change from the last valid value exceed minimum/maximum limits values as questionable or rejected.Values in the time series are screened for quality. Values whose rate of change from the last valid value are below
minRejectLimit
or abovemaxRejectLimit
are marked with a rejected quality flag. Other whose rate of change from the last valid value are values belowminQuestionLimit
or abovemaxQuestionLimit
are 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 belowminRejectLimit
will be marked as questioned.maxQuestionLimit
- Values whose rate of change from the last valid value are above this, but not abovemaxRejectLimit
will be marked as questioned.maxRejectLimit
- Values whose rate of change from the last valid value are above this will be marked as rejected.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
screenWithDurationMagnitude
public static TimeSeriesContainer screenWithDurationMagnitude(TimeSeriesContainer tsc, String durationStr, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit) throws ComputationException Flag values in time series whose accumulation over a specified period lies minimum/maximum limits values as questionable or rejected.Values in the time series are screened for quality. All (non-missing) values whose accumulated value for the specified duration is below
minRejectLimit
or abovemaxRejectLimit
are marked with a rejected quality flag. Other whose whose accumulated value for the specified duration is belowminQuestionLimit
or abovemaxQuestionLimit
are 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 belowminRejectLimit
will be marked as questioned.maxQuestionLimit
- Values whose accumulated value for the specified duration is above this, but not abovemaxRejectLimit
will be marked as questioned.maxRejectLimit
- Values whose accumulated value for the specified duration is above this will be marked as rejected.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
durationMinutes
- Throws:
ComputationException
-
screenWithDurationMagnitude
public static TimeSeriesContainer screenWithDurationMagnitude(TimeSeriesContainer tsc, String durationStr, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit, boolean allowUnsafe, boolean warnUnsafe) throws ComputationException Flag values in time series whose accumulation over a specified period lies minimum/maximum limits values as questionable or rejected.Values in the time series are screened for quality. All (non-missing) values whose accumulated value for the specified duration is below
minRejectLimit
or abovemaxRejectLimit
are marked with a rejected quality flag. Other whose whose accumulated value for the specified duration is belowminQuestionLimit
or abovemaxQuestionLimit
are 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 belowminRejectLimit
will be marked as questioned.maxQuestionLimit
- Values whose accumulated value for the specified duration is above this, but not abovemaxRejectLimit
will be marked as questioned.maxRejectLimit
- Values whose accumulated value for the specified duration is above this will be marked as rejected.allowUnsafe
- flag specifying whether to allow "unsafe" math operations.warnUnsafe
- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
screenWithDurationMagnitude
public static TimeSeriesContainer screenWithDurationMagnitude(TimeSeriesContainer tsc, String durationStr, double minMissingLimit, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit, double maxMissingLimit, double percentRequired, boolean allowUnsafe, boolean warnUnsafe) throws ComputationException Flag values in time series whose accumulation over a specified period lies minimum/maximum limits values as questionable or rejected.Values in the time series are screened for quality. All (non-missing) values whose accumulated value for the specified duration is below
minRejectLimit
or abovemaxRejectLimit
are marked with a rejected quality flag. Other whose whose accumulated value for the specified duration is belowminQuestionLimit
or abovemaxQuestionLimit
are 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 belowminRejectLimit
will be marked as questioned.maxQuestionLimit
- Values whose accumulated value for the specified duration is above this, but not abovemaxRejectLimit
will be marked as questioned.maxRejectLimit
- Values whose accumulated value for the specified duration is above this will be marked as rejected.maxMissingLimit
- Values whose accumulated value for the specified duration is above this will be marked as missing.percentRequired
- Minimum percent of values in the duration that must be valid for the screening to be performed.allowUnsafe
- flag specifying whether to allow "unsafe" math operations.warnUnsafe
- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
screenWithConstantValue
public static TimeSeriesContainer screenWithConstantValue(TimeSeriesContainer tsc, String durationStr, double rejectTolerance, double questionTolerance) throws ComputationException Flag values in time series whose values do not change more than a specified amount over a specified duation as questionable or rejected.Values in the time series are screened for quality. All (non-missing) values whose difference over the specified duration is below
rejectTolerance
are marked with a rejected quality flag. Other whose whose difference over the specified duration is belowquestionTolerance
are marked with a questioned quality flag. Other values are marked with an okay quality flag unless they are already marked as rejected or questioned.Only values greater than zero are screened as described.
Only time periods that contain no missing values are screened as described.
- Parameters:
tsc
- The time series to derive from.durationStr
- The time period over which to perform the test, of the form nX, where in is an integer and X is one of Minutes, Hours, or Days, which can be abbreviated to one or more characters.rejectTolerance
- Values will be marked as rejected if they do not differ by more than this amount over the specified duration. To disable marking values as rejected, set this tolerance to less than zero.questionTolerance
- Values will be marked as questioned if they do not differ by more than this amount over the specified duration. To disable marking values as questioned, set this tolerance to less than zero.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
screenWithConstantValue
public static TimeSeriesContainer screenWithConstantValue(TimeSeriesContainer tsc, String durationStr, double rejectTolerance, double questionTolerance, double minThreshold, int maxMissing) throws ComputationException Flag values in time series whose values do not change more than a specified amount over a specified duation as questionable or rejected.Values in the time series are screened for quality. All (non-missing) values whose difference over the specified duration is below
rejectTolerance
are marked with a rejected quality flag. Other whose whose difference over the specified duration is belowquestionTolerance
are 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
minThreshold
value are screened as described.Only time periods that contain no more that
maxMissing
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.minThreshold
- Values will be screened only if they are greater than this value.maxMissing
- The maximum number of missing values to tolerate in the specified duration for screening purposes.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
screenWithConstantValue
public static TimeSeriesContainer screenWithConstantValue(TimeSeriesContainer tsc, String durationStr, double rejectTolerance, double questionTolerance, double minThreshold, int maxMissing, boolean allowUnsafe, boolean warnUnsafe) throws ComputationException Flag values in time series whose values do not change more than a specified amount over a specified duation as questionable or rejected.Values in the time series are screened for quality. All (non-missing) values whose difference over the specified duration is below
rejectTolerance
are marked with a rejected quality flag. Other whose whose difference over the specified duration is belowquestionTolerance
are 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
minThreshold
value are screened as described.Only time periods that contain no more that
maxMissing
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.minThreshold
- Values will be screened only if they are greater than this value.maxMissing
- The maximum number of missing values to tolerate in the specified duration for screening purposes.allowUnsafe
- flag specifying whether to allow "unsafe" math operations.warnUnsafe
- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
screenWithConstantValue
public static TimeSeriesContainer screenWithConstantValue(TimeSeriesContainer tsc, String durationStr, double missingTolerance, double rejectTolerance, double questionTolerance, double minThreshold, int maxMissing, boolean allowUnsafe, boolean warnUnsafe) throws ComputationException Flag values in time series whose values do not change more than a specified amount over a specified duation as questionable or rejected.Values in the time series are screened for quality. All (non-missing) values whose difference over the specified duration is below
rejectTolerance
are marked with a rejected quality flag. Other whose whose difference over the specified duration is belowquestionTolerance
are 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
minThreshold
value are screened as described.Only time periods that contain no more that
maxMissing
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.missingTolerance
- Values will be marked as missing if they do not differ by more than this amount over the specified duration. To disable marking values as missing, set this tolerance to less than zero.rejectTolerance
- Values will be marked as rejected if they do not differ by more than this amount over the specified duration. To disable marking values as rejected, set this tolerance to less than zero.questionTolerance
- Values will be marked as questioned if they do not differ by more than this amount over the specified duration. To disable marking values as questioned, set this tolerance to less than zero.minThreshold
- Values will be screened only if they are greater than this value.maxMissing
- The maximum number of missing values to tolerate in the specified duration for screening purposes.allowUnsafe
- flag specifying whether to allow "unsafe" math operations.warnUnsafe
- flag specifying whether to warn about "unsafe" math operations.- Returns:
- A copy of the time series with values with the quality set as described.
- Throws:
ComputationException
-
screenWithForwardMovingAverage
public static TimeSeriesContainer screenWithForwardMovingAverage(TimeSeriesContainer tsc, int numberToAverageOver, double changeLimit, boolean setInvalidValueToUndefined, String qualityFlagForInvalidValue) throws ComputationException Flag values in time series exceeding maximum change from a forward moving average.A running forward moving average of valid values is progressively computed over
numberToAverageOver
points. Values exceeding the moving average computed for the preceeding point location by more thanchangeLimit
are flagged or set to the "Missing" value depending upon the settings forsetInvalidToMissingValue
orqualityFlagForInvalidValue
parameters. 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
setInvalidToMissingValue
is set to "true", values failing the screening test are set to the "Missing" value.If
qualityFlagForInvalidValue
is set to a character or string recognized as a valid quality flag, the quality flag will be set for tested values. If there is no previously existing quality available for the time series, the quality flag array will be created for the time series. Values failing the quality test are set to the user specified quality flag for invalid values. If there is existing quality data and the time series value passes the quality test, the existing quality flag for the points is unchanged. If there was no previously existing quality and the time series value passes the quality test, the quality flag for the point is set to "Okay".- Parameters:
tsc
- The time series to derive from.numberToAverageOver
- the number of values to average over for computing the forward moving average. Must be greater than 2.changeLimit
- allowed deviation in the tested value from the forward moving average.setInvalidValueToUndefined
-qualityFlagForInvalidValue
- character string representing the quality flag setting for values failing the quality test. The accepted character strings are: "M" or "Missing", "R" or "Rejected", "Q" or "Questionable". A blank string is entered to disable the setting of the quality flag.- Returns:
- a copy of the time series with values failing the quality test set to missing and/or with the quality flag set to the user specified quality for invalid values.
- Throws:
ComputationException
-
estimateForMissingValues
public static TimeSeriesContainer estimateForMissingValues(TimeSeriesContainer tsc, int maxMissingAllowed, boolean accumulation, boolean setQuestioned, boolean estimateRejected, boolean allowUnsafe, boolean warnUnsafe) throws ComputationException Linearly interpolate estimates for missing values in the time series.The function interpolates between valid values in the time series to fill in locations in time with values defined as "Missing". Linear interpolation will NOT be performed for segments of the time series where there are more than
maxMissingAllowed
successive bad values.- Parameters:
tsc
- time series to interpolate onmaxMissingAllowed
- maximum number consecutive missing values between valid values in which interpolation is allowed.accumulation
- flag specifying whether to estimate accumulated values (such as precip)setQuestioned
- if true, sets the quality (if any) to questioned for interpolated valuesestimateRejected
- if true, estimates missing AND rejected valuesallowUnsafe
- flag specifying whether to allow "unsafe" math operations.warnUnsafe
- flag specifying whether to warn about "unsafe" math operations.- Returns:
- a copy of the current time series with missing values filled by linear interpolation.
- Throws:
ComputationException
- if the time series contains less than 3 valid values.
-
snapToRegularInterval
public static TimeSeriesContainer snapToRegularInterval(TimeSeriesContainer tsc, String timeIntervalStr, String timeOffsetStr, String timeBackwardStr, String timeForwardStr) throws ComputationException - Throws:
ComputationException
-
snapToRegularInterval
public static TimeSeriesContainer snapToRegularInterval(TimeSeriesContainer tsc, int timeIntervalMinutes, int timeOffsetMinutes, int timeBackwardMinutes, int timeForwardMinutes) throws ComputationException - Throws:
ComputationException
-
interpolate
public static double interpolate(TimeSeriesContainer tsc, int time, String dataType, intContainer lastIndex) -
transformTimeSeries
public static void transformTimeSeries(TimeSeriesContainer currentTsc, TimeSeriesContainer newTsc, int functionType, boolean toIrregular, double missingAllowed) throws ComputationException - Throws:
ComputationException
-
main
- Throws:
Exception
-
transformWithFunction
public static TimeSeriesContainer transformWithFunction(TimeSeriesContainer baseTsc, ScalarOperable transformer) -
resample
public static TimeSeriesContainer resample(TimeSeriesContainer tsc, mil.army.usace.hec.metadata.Interval interval) throws HecMathException Create timeseries derived from input in the specified interval. Uses source offset, pass result into SNAP or SHIFT if offset change is required- Parameters:
tsc
- input timeseriesinterval
- desired output interval- Returns:
- new timeseries with inputs mapped to the same times in output.
- Throws:
HecMathException
- Since:
- 2022-07
-