public class TimeSeriesMath extends HecMath implements hec.data.IVerticalDatumOperations<TimeSeriesMath,HecMathException>
TimeSeriesMath class wraps around a
hec.io.TimeSeriesContainer (time series data) and
provides the user the capability to perform
arithmetic and other operations on a time series. For example, each
value in a time series may be scaled by the value 3.0 using:
ts.multiply( 3.0 ) where ts is aTimeSeriesMath object
HecMath,
PairedDataMath,
TimeSeriesContainer| Modifier and Type | Field and Description |
|---|---|
static int |
ACCUMULATE |
static int |
AVERAGE |
static int |
COUNT_VALID |
static int |
INST |
static int |
INST_CUM |
static int |
INST_VAL |
static int |
INTEGRATE |
static int |
INTERPOLATE |
static java.lang.String |
LEVEL_DAYMONTH_STRING |
static java.lang.String |
LEVEL_DAYWEEK_STRING |
static java.lang.String |
LEVEL_MONTH_STRING |
static java.lang.String |
LEVEL_TIME_STRING |
static java.lang.String |
LEVEL_YEAR_STRING |
static int |
MAX |
static int |
MIN |
static int |
PER_AVER |
static int |
PER_CUM |
static int |
TYPE_UNDEFINED |
static int |
VOLUME |
EXTRAPOLATE, FALSE, ITS_DELETE_INSERT, ITS_MERGE, LIN_INTERP, LIN_INTERP_TO_NONE, LOG_INTERP, NOT_ALLOWED, RTS_REPLACE_ALL, RTS_REPLACE_ALL_CREATE, RTS_REPLACE_ALL_DELETE, RTS_REPLACE_MISSING_VALUES_ONLY, RTS_REPLACE_WITH_NON_MISSING, STEP_NEAREST, STEP_NEXT, STEP_PREV, TRUE, UNDEFINED, UNDEFINED_DOUBLE, UNDEFINED_FLOAT, UNDEFINED_INT, UNDEFINED_LONG, UNDEFINED_TIME, USE_NEAREST, USE_NONE, USE_VALUE, USGS_INTERP| Constructor and Description |
|---|
TimeSeriesMath() |
TimeSeriesMath(TimeSeriesContainer tsc) |
| Modifier and Type | Method and Description |
|---|---|
HecMath |
abs()
Derive a new time series composed of the absolute values of the current time series.
|
HecMath |
accumulation()
Derive a new time series by computing a running accumulation of the current time series.
|
HecMath |
acos()
Derive a new time series from arccosine of the values of the current time series.
|
HecMath |
add(double constant)
Add a constant value to the values in current time series.
|
HecMath |
add(HecMath tsMath)
Add the time series in the parameter,
tsMath, to the current time series. |
HecMath |
asin()
Derive a new time series from arcsine of the values of the current time series.
|
HecMath |
atan()
Derive a new time series from arctangent of the values of the current time series.
|
boolean |
canDetermineUnitSystem()
See if the unit system can be successfully determined from the units string.
|
HecMath |
ceil()
Derive a new time series with values of the current time series rounded up to the
nearest whole number that is greater to or equal to the value.
|
HecMath |
centeredMovingAverage(int numberToAverageOver,
boolean onlyValidValues,
boolean useReduced)
Perform a centered moving average smoothing of the time series.
|
static boolean |
checkTimeSeries(TimeSeriesContainer tsc)
Perform basic checks on the TimeSeriesContainer
tsc to ensure that there is data. |
boolean |
checkTimeSeriesMatch(TimeSeriesContainer tsc)
Checks that the times in the TimeSeriesContainer
tsc exactly match the
times in the current time series. |
boolean |
checkTimeSeriesMath(HecMath math,
java.lang.String methodName)
Checks to see if
math is an instance of hec.hecmath.TimeSeriesMath object. |
TimeSeriesMath |
collapseVerticalDatum()
Returns a new TimeSeriesMath object constructed from this object if the internal
data supports it, collapsing the internal data in the process
|
java.util.Vector |
computeSimpleFrequency()
Deprecated.
|
HecMath |
convertToEnglishUnits()
Convert time series values to English units.
|
HecMath |
convertToIrregular(java.lang.String blockSize) |
HecMath |
convertToMetricUnits()
Convert time series values to metric (SI) units.
|
HecMath |
copy()
Create a duplicate copy of the time series object.
|
LinearRegressionStatistics |
correlationCoefficients(HecMath tsMath)
Computes the linear regression correlation coefficients between data in current time series
and the parameter time series,
tsMath. |
HecMath |
cos()
Derive a new time series from cosine of the values of the current time series.
|
HecMath[] |
cyclicAnalysis()
Derive a set of cyclic statistics from the current regular interval time series.
|
HecMath[] |
cyclicAnalysis(java.lang.String startYear) |
HecMath |
decayingBasinWetnessParameter(HecMath tsMath,
double decayRate)
Compute a time series decaying basin wetness parameter from the
preciptation time series
tsMath. |
HecMath |
divide(double constant)
Divide values in the current time series by a constant.
|
HecMath |
divide(HecMath tsMath)
Divide the current time series by the parameter time series,
tsMath. |
PairedDataMath[] |
durationAnalysisBin(java.lang.String periodType,
DurationPeriod[] durationPeriods,
int binDistribution,
int numberBins,
double[] binLimits,
int iplottingPointsMethod,
double[] userDefinedPoints,
int horizontalScale,
int verticalScale) |
PairedDataMath[] |
durationAnalysisStandard(java.lang.String periodType,
DurationPeriod[] durationPeriods,
int iplottingPointsMethod,
double[] userDefinedPoints,
int horizontalScale,
int verticalScale)
Perform A Standard Duration Analysis for time series.
|
HecMath |
estimateForMissingPrecipValues(int maxMissingAllowed)
Linearly interpolate estimates for missing values in a cumulative precipitation time series.
|
HecMath |
estimateForMissingValues(int maxMissingAllowed)
Linearly interpolate estimates for missing values in the time series.
|
HecMath |
exp()
Derive a new time series which is the e raised to the values of the current time series.
|
TimeSeriesMath |
expandVerticalDatum()
Returns a new TimeSeriesMathVertDatum object constructed from this object if the internal
data supports it, expanding the internal data in the process
|
HecMath |
exponentiation(double constant)
Raise values in the current time series to the power of
constant. |
HecMath |
exponentiation(HecMath tsMath)
Raise values in the current time series to the power of the parameter time series,
tsMath. |
HecMath |
extractTimeSeriesDataForTimeSpecification(java.lang.String timeLevelString,
java.lang.String rangeString,
boolean isInclusive,
int intervalWindow,
boolean setAsIrregular)
Extract data from the current regular or irregular interval time series according to the
time specifications defined in the parameters.
|
int |
firstValidDate()
Find the date and time of the first valid time series value.
|
double |
firstValidValue()
Find the first valid value in the time series.
|
HecMath |
floor()
Derive a new time series with values of the current time series rounded down to the
nearest whole number that is less than or equal to the value.
|
HecMath |
flowAccumulatorGageProcessor(HecMath tsMath)
Compute a time series of period-average flows from a flow accumulator type gage.
|
HecMath |
fmod(double constant)
Return the remainder of integer division of current time series by a constant.
|
HecMath |
fmod(HecMath tsMath)
Return the remainder of integer division of current time series by the parameter time series,
tsMath. |
HecMath |
forwardMovingAverage(int numberToAverageOver)
Compute a forward moving average of the time series.
|
HecMath |
forwardMovingAverage(int numberToAverageOver,
boolean onlyValidValues,
boolean useReduced)
Compute a forward moving average of the time series.
|
PairedDataMath |
generateDataPairs(HecMath tsMath,
boolean sort)
Generate data pairs from two time series.
|
PairedDataMath |
generateDataPairs(HecMath tsMath,
double buffer)
This method will compare the two time series and create a PairedDataMath object that
has all of the data points that are coincident in time (with given buffer)
|
static HecMath |
generateRegularIntervalTimeSeries(java.lang.String startTimeString,
java.lang.String endTimeString,
int timeIntervalMinutes,
int timeOffsetMinutes,
double initialValue) |
static HecMath |
generateRegularIntervalTimeSeries(java.lang.String startTimeString,
java.lang.String endTimeString,
java.lang.String timeIntervalString,
double initialValue)
Generate a new regular interval time series data for the specifed start time, end time,
time interval and timeOffset and with all values set to
initialValue. |
static HecMath |
generateRegularIntervalTimeSeries(java.lang.String startTimeString,
java.lang.String endTimeString,
java.lang.String timeIntervalString,
java.lang.String timeOffsetString,
double initialValue)
Generate a new regular interval time series data for the specifed start time, end time,
time interval and timeOffset and with all values set to
initialValue. |
TimeSeriesContainer |
getContainer()
get the HecMath._dc (DataContainer) cast as a TimeSeriesContainer
|
DataContainer |
getData()
Copy the current TimeSeriesContainer data in the TimeSeriesMath object
into
container. |
void |
getData(DataContainer container)
Copy the current TimeSeriesContainer data in the TimeSeriesMath object
into
container. |
double[] |
getSortedPeaks()
Deprecated.
|
java.lang.String |
getStandardUnits()
Returns the standardized units label for the time series y-values .
|
java.lang.String |
getType()
Returns the type label for the current time series.
|
java.lang.String |
getUnits()
Returns the units label of the y-values for the current time series.
|
HecMath |
gmean(HecMath[] tsMathArray)
Determine the geometric mean of the current time series and the each time series in the parameter,
tsMathArray. |
HecMath |
hmean(HecMath[] tsMathArray)
Determine the harmonic mean of the current time series and the each time series in the parameter,
tsMathArray. |
HecMath |
integer_divide(double constant) |
HecMath |
integer_divide(HecMath tsMath) |
HecMath |
integerDivide(double constant)
Divide values in the current time series by a constant and truncate the result to
an integer value.
|
HecMath |
integerDivide(HecMath tsMath)
Divide the current time series by the parameter time series,
tsMath and truncate the result to an integer value. |
HecMath |
interpolateDataAtRegularInterval(java.lang.String timeIntervalString,
java.lang.String timeOffsetString)
Create a new regular interval time series having the specified time interval
and time offset by interpolation of data from the current time series.
|
HecMath |
inverse()
Derive a new time series with values equal to 1 divided by the values of the original time series.
|
boolean |
isEnglish()
Determine if the time series data is in English units.
|
boolean |
isMetric()
Determine if the time series data is in metric (SI) units.
|
java.lang.String |
isMuskingumRoutingStable(int numberSubreaches,
double muskingumK,
double muskingumX)
Check for possible instability for the given Muskingum Routing parameters.
|
boolean |
isValid(int index)
Determine if the data value at the index location
index
in the current time series is valid ( okay or not missing ). |
double |
kurtosisCoefficient()
Compute the kurtosis coefficient of the time series values.
|
int |
lastValidDate()
Find the date and time of the last valid time series value.
|
double |
lastValidValue()
Find the last valid value in the time series.
|
HecMath |
log()
Derive a new time series with values being the natural log of values of the current time series.
|
HecMath |
log10()
Derive a new time series with values being the log base 10 of values of the current time series.
|
double |
max()
Find the maximum value of the time series.
|
HecMath |
max(HecMath[] tsMathArray)
Determine the maximum of the current time series and the each time series in the parameter,
tsMathArray. |
int |
maxDate()
Find the date and time of the maximum time series value.
|
double |
mean()
Compute the mean value of the time series.
|
HecMath |
mean(HecMath[] tsMathArray)
Determine the arithmetic mean of the current time series and the each time series in the parameter,
tsMathArray. |
double |
med()
Compute the median of the time series values.
|
HecMath |
med(HecMath[] tsMathArray)
Determine the median (50th percentile) of the current time series and the each time series in the parameter,
tsMathArray. |
HecMath |
mergeTimeSeries(HecMath tsMath)
Merge values in two time series.
|
double |
min()
Find the minimum value of the time series.
|
HecMath |
min(HecMath[] tsMathArray)
Determine the minimum of the current time series and the each time series in the parameter,
tsMathArray. |
int |
minDate()
Find the date and time of the minimum time series value.
|
double |
mode()
Compute the mode of the time series values.
|
HecMath |
modulo(double constant)
Return the remainder of integer division of current time series by a constant.
|
HecMath |
modulo(HecMath tsMath)
Return the remainder of integer division of current time series by the parameter time series,
tsMath. |
PairedDataMath |
multipleRegression(HecMath[] tsMathArray,
double minimumLimit,
double maximumLimit)
Determine the multiple linear regression coefficients between the current time series and
the set of time series in
tsMathArray. |
HecMath |
multiply(double constant)
Multiply a constant value to values in current time series.
|
HecMath |
multiply(HecMath tsMath)
Multiply the current time series with the parameter time series,
tsMath. |
HecMath |
muskingumRouting(int numberSubreaches,
double muskingumK,
double muskingumX)
Route the current time series by the Muskingum hydrologic routing method.
|
HecMath |
neg() |
HecMath |
negative()
Derive a new time series composed of the negatives of the values of the current time series.
|
int |
numberInvalidValues()
Count the number of invalid (missing or rejected) values in the time series values.
|
int |
numberMissingValues()
Count the number of missing (but not rejected) values in the time series values.
|
int |
numberQuestionedValues()
Count the number of questioned (but not missing) values in the time series values.
|
int |
numberRejectedValues()
Count the number of rejected (but not missing) values in the time series values.
|
int |
numberValidValues()
Count the number of valid (non-missing & non-rejected) values in the time series values.
|
HecMath |
olympicSmoothing(int numberToAverageOver,
boolean onlyValidValues,
boolean useReduced)
Perform an Olympic smoothing average of the time series.
|
double |
p1()
Compute the p1 of the time series values.
|
HecMath |
p1(HecMath[] tsMathArray)
Determine the 1st percentile of the current time series and the each time series in the parameter,
tsMathArray. |
double |
p10()
Compute the p10 of the time series values.
|
HecMath |
p10(HecMath[] tsMathArray)
Determine the 10th percentile of the current time series and the each time series in the parameter,
tsMathArray. |
double |
p2()
Compute the p2 of the time series values.
|
HecMath |
p2(HecMath[] tsMathArray)
Determine the 2nd percentile of the current time series and the each time series in the parameter,
tsMathArray. |
double |
p20()
Compute the p20 of the time series values.
|
HecMath |
p20(HecMath[] tsMathArray)
Determine the 20th percentile of the current time series and the each time series in the parameter,
tsMathArray. |
double |
p25()
Compute the p25 of the time series values.
|
HecMath |
p25(HecMath[] tsMathArray)
Determine the 25th percentile of the current time series and the each time series in the parameter,
tsMathArray. |
double |
p5()
Compute the p5 of the time series values.
|
HecMath |
p5(HecMath[] tsMathArray)
Determine the 5th percentile of the current time series and the each time series in the parameter,
tsMathArray. |
double |
p75()
Compute the p75 of the time series values.
|
HecMath |
p75(HecMath[] tsMathArray)
Determine the 75th percentile of the current time series and the each time series in the parameter,
tsMathArray. |
double |
p80()
Compute the p80 of the time series values.
|
HecMath |
p80(HecMath[] tsMathArray)
Determine the 80th percentile of the current time series and the each time series in the parameter,
tsMathArray. |
double |
p90()
Compute the p90 of the time series values.
|
HecMath |
p90(HecMath[] tsMathArray)
Determine the 90th percentile of the current time series and the each time series in the parameter,
tsMathArray. |
double |
p95()
Compute the p95 of the time series values.
|
HecMath |
p95(HecMath[] tsMathArray)
Determine the 95th percentile of the current time series and the each time series in the parameter,
tsMathArray. |
double |
p98()
Compute the p98 of the time series values.
|
HecMath |
p98(HecMath[] tsMathArray)
Determine the 98th percentile of the current time series and the each time series in the parameter,
tsMathArray. |
double |
p99()
Compute the p99 of the time series values.
|
HecMath |
p99(HecMath[] tsMathArray)
Determine the 99th percentile of the current time series and the each time series in the parameter,
tsMathArray. |
HecMath |
periodConstants(HecMath math) |
HecMath |
product(HecMath[] tsMathArray)
Multiply the current time series with the each time series in the parameter,
tsMathArray. |
HecMath |
replaceSpecificValues(HecDouble from,
HecDouble to)
Replace specific values for another in the time series.
|
HecMath |
replaceValuesInRange(HecDouble min,
HecDouble max,
HecDouble to)
Replace values within range for another in the time series.
|
HecMath |
rms(HecMath[] tsMathArray)
Determine the root mean square (rms, or quadraticharmonic mean) of the current time series
and the each time series in the parameter,
tsMathArray. |
HecMath |
round()
Derive a new time series with values of the current time series rounded to the nearest whole number.
|
HecMath |
roundOff(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.
|
HecMath |
screenWithConstantValue(java.lang.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.
|
HecMath |
screenWithDurationMagnitude(java.lang.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.
|
HecMath |
screenWithForwardMovingAverage(int numberToAverageOver,
double changeLimit)
Flag values in time series exceeding maximum change from a forward moving average.
|
HecMath |
screenWithForwardMovingAverage(int numberToAverageOver,
double changeLimit,
boolean setInvalidToUndefined,
java.lang.String qualityFlagForInvalidValue)
Flag values in time series exceeding maximum change from a forward moving average.
|
HecMath |
screenWithMaxMin(double minValueLimit,
double maxValueLimit,
double changeLimit)
Flag values in time series exceeding minimum and maximum limit values or maximum change limit.
|
HecMath |
screenWithMaxMin(double minValueLimit,
double maxValueLimit,
double changeLimit,
boolean setInvalidToSpecified,
double invalidValueReplacement,
java.lang.String qualityFlagForInvalidValue)
Flag values in time series exceeding minimum and maximum limit values or maximum change limit.
|
HecMath |
screenWithMaxMin(double minValueLimit,
double maxValueLimit,
double changeLimit,
boolean setInvalidToUndefined,
java.lang.String qualityFlagForInvalidValue)
Flag values in time series exceeding minimum and maximum limit values or maximum change limit.
|
HecMath |
screenWithMaxMin(double minRejectLimit,
double minQuestionLimit,
double maxQuestionLimit,
double maxRejectLimit)
Flag values in time series exceeding minimum and maximum limit values as questionable or rejected.
|
HecMath |
screenWithRateOfChange(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.
|
void |
setData(DataContainer container)
Set the TimeSeriesContainer data for the current TimeSeriesMath object.
|
void |
setParameterPart(java.lang.String paramString)
set the parameter type (C Part) of the DSS Pathname
|
void |
setType(java.lang.String typeString)
Set the type label for the time series.
|
void |
setUnits(java.lang.String unitsString)
Set the units label for the time series.
|
HecMath |
shiftAdjustment(HecMath tsMath)
lineary interpolate the values of the current time series upon the times
contained in tsc
|
HecMath |
shiftInTime(HecTime timeToShift)
Shift the times in the current time series by the specified time increment.
|
HecMath |
shiftInTime(int timeShiftMinutes)
Shift the times in the current time series by the specified time increment.
|
HecMath |
shiftInTime(int timeShiftMinutes,
int timeInterval,
int numberIntervals) |
HecMath |
shiftInTime(java.lang.String timeShiftString)
Shift the times in the current time series by the specified time increment.
|
HecMath |
sign()
Derive a new time series composed of the signs of the values of the current time series.
|
HecMath |
sin()
Derive a new time series from sine of the values of the current time series.
|
double |
skewCoefficient()
Compute the skew coefficient of the time series values.
|
HecMath |
snapToRegularInterval(java.lang.String timeIntervalString,
java.lang.String timeOffsetString,
java.lang.String timeBackwardString,
java.lang.String timeForwardString)
"Snap" data from the current irregular or regular interval time series to form a new
regular interval time series of the specified interval and offset.
|
HecMath |
sqrt()
Derive a new time series which is the square root of the values of the current time series.
|
double |
standardDeviation()
Compute the standard deviation of the time series values.
|
HecMath |
standardDeviation(HecMath[] tsMathArray)
Determine the standard deviation of the current time series and the each time series in the parameter,
tsMathArray. |
HecMath |
stddev(HecMath[] tsMathArray)
Deprecated.
|
HecMath |
straddleStaggerRouting(int numberToAverage,
int numberToLag,
int numberSubreaches)
Route the current time series using the Straddle-Stagger hydrologic routing method.
|
HecMath |
subtract(double constant)
Subtract a constant value from values in current time series.
|
HecMath |
subtract(HecMath tsMath)
Subtract the time series in the parameter,
tsMath,
from the current time series. |
HecMath |
successiveDifferences()
Derive a new time series from the successive differences of the current time series.
|
double |
sum()
Compute the total accumulated amount for time series.
|
HecMath |
sum(HecMath[] tsMathArray)
Add each of the time series in the parameter,
tsMathArray, to the current time series. |
HecMath |
tan()
Derive a new time series from tangent of the values of the current time series.
|
HecMath |
timeDerivative()
Derive a new time series from the successive differences in time of the current time series.
|
HecMath |
transformTimeSeries(HecMath tsMath,
java.lang.String functionTypeString)
Generate a new time series from the current regular or irregular
interval time series.
|
HecMath |
transformTimeSeries(HecMath tsMath,
java.lang.String functionTypeString,
boolean toIrregular) |
HecMath |
transformTimeSeries(HecMath tsMath,
java.lang.String functionTypeString,
boolean toIrregular,
double missingAllowed) |
HecMath |
transformTimeSeries(java.lang.String timeIntervalString,
java.lang.String timeOffsetString,
java.lang.String functionTypeString)
Generate a new regular interval time series from the current regular
or irregular time series.
|
HecMath |
transformTimeSeries(java.lang.String timeIntervalString,
java.lang.String timeOffsetString,
java.lang.String functionTypeString,
boolean toIrregular) |
HecMath |
transformWithFunction(hec.hecmath.computation.ScalarOperable transformer)
use custom transformer to alter values
|
HecMath |
truncate()
Derive a new time series with values of the current time series truncated to whole numbers.
|
HecMath |
var(HecMath[] tsMathArray) |
HecMath |
variance(HecMath[] tsMathArray)
Determine the variance of the current time series and the each time series in the parameter,
tsMathArray. |
applyMultipleLinearRegression, checkContainer, conicInterpolation, createInstance, createInstance, durationAnalysis, durationAnalysis, durationAnalysis, durationAnalysis, getPath, getSelectedCurve, isMissing, isValid, mergePairedDataSets, modifiedPulsRouting, multipleLinearRegression, polynomialTransformation, polynomialTransformationWithIntegral, ratingTableInterpolation, reverseRatingTableInterpolation, roundOffValue, setCurve, setCurve, setDPart, setEPart, setLocation, setPathname, setTimeInterval, setVersion, setWatershed, standardNormalDeviate, twoVariableRatingTableInterpolationpublic static final int TYPE_UNDEFINED
public static final int INST
public static final int INST_VAL
public static final int INST_CUM
public static final int PER_AVER
public static final int PER_CUM
public static final int INTERPOLATE
public static final int MAX
public static final int MIN
public static final int AVERAGE
public static final int INTEGRATE
public static final int ACCUMULATE
public static final int VOLUME
public static final int COUNT_VALID
public static final java.lang.String LEVEL_YEAR_STRING
public static final java.lang.String LEVEL_DAYMONTH_STRING
public static final java.lang.String LEVEL_MONTH_STRING
public static final java.lang.String LEVEL_DAYWEEK_STRING
public static final java.lang.String LEVEL_TIME_STRING
public TimeSeriesMath()
public TimeSeriesMath(TimeSeriesContainer tsc) throws HecMathException
HecMathExceptionpublic void setParameterPart(java.lang.String paramString)
throws HecMathException
setParameterPart in class HecMathparamString - the new parameter typeHecMathExceptionpublic void setData(DataContainer container) throws HecMathException
container.setData in class HecMaththe - TimeSeriesContainer data to be used by this TimeSeriesMath object.HecMathException - if container is null or not of type
TimeSeriesContainer.public DataContainer getData() throws HecMathException
container.getData in class HecMathHecMathExceptionpublic void getData(DataContainer container) throws HecMathException
container.getData in class HecMaththe - TimeSeriesContainer to receive the copy of data from
this time series.HecMathExceptionpublic TimeSeriesContainer getContainer()
HecMathExceptionpublic HecMath add(HecMath tsMath) throws HecMathException
tsMath, to the current time series.
A new time series will be created which duplicates the time points
of the current time series. Where time points match for the
current time series and tsMath, the values will be summed provided
values for both time series are valid values ( not missing ). Points in the current time
series which cannot be matched to valid points in tsMath are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. If a specific quality value in the parameter time series is questionable or rejected, that quality will be copied to the new time series.
add in class HecMathtsMath - the time series to be added to the current time series.HecMathExceptionpublic HecMath add(double constant) throws HecMathException
add in class HecMathconstant - the value to be added to values in current time series.HecMathExceptionpublic HecMath subtract(HecMath tsMath) throws HecMathException
tsMath,
from the current time series. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current time series and tsMath, the value in tsMath
will be subtracted from the value in the current time series provided
both values are valid ( not missing ). Points in the current time
series which cannot be matched to valid points in tsMath are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. If a specific quality value in the parameter time series is questionable or rejected, that quality will be copied to the new time series.
subtract in class HecMathtsMath - the time series to be subtracted from the current time series.HecMathExceptionpublic HecMath subtract(double constant) throws HecMathException
subtract in class HecMathconstant - the value to be subtracted from values in current time series.HecMathExceptionpublic HecMath multiply(HecMath tsMath) throws HecMathException
tsMath. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMath, the values will be multiplied provided the
values for both time series are valid values ( not missing ). Points in the current time
series which cannot be matched to valid points in tsMath are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. If a specific quality value in the parameter time series is questionable or rejected, that quality will be copied to the new time series.
multiply in class HecMathtsMath - the time series to be multiplied with the current time series.HecMathExceptionpublic HecMath multiply(double constant) throws HecMathException
multiply in class HecMathconstant - the value to be multiplied to values in current time series.HecMathExceptionpublic HecMath divide(HecMath tsMath) throws HecMathException
tsMath. A new time series will be created which duplicates
the time points of the current time series. Where time points
match for the current time series and tsMath, the value in the current time
series will be divided by the value in tsMath provided
both values are valid ( not missing ). Divide by zeroes are not allowed.
When the tsMath time series value is zero, the value for the new time
series will be set to missing. Points in the current time
series which cannot be matched to valid points in tsMath are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. If a specific quality value in the parameter time series is questionable or rejected, that quality will be copied to the new time series.
divide in class HecMathtsMath - the time series to be divided into the current time series.HecMathExceptionpublic HecMath divide(double constant) throws HecMathException
divide in class HecMathconstant - the value to divide values in current time series.HecMathException - if constant is zero.public HecMath integerDivide(HecMath tsMath) throws HecMathException
tsMath and truncate the result to an integer value. A new time series
will be created which duplicates the time points of the current time series. Where time points
match for the current time series and tsMath, the value in the current time
series will be divided by the value in tsMath provided
both values are valid ( not missing ). Divide by zeroes are not allowed.
When the tsMath time series value is zero, the value for the new time
series will be set to missing. Points in the current time
series which cannot be matched to valid points in tsMath are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. If a specific quality value in the parameter time series is questionable or rejected, that quality will be copied to the new time series.
tsMath - the time series to be divided into the current time series.HecMathExceptionpublic HecMath integer_divide(HecMath tsMath) throws HecMathException
HecMathExceptionpublic HecMath integerDivide(double constant) throws HecMathException
constant - the value to divide values in current time series.HecMathException - if constant is zero.public HecMath integer_divide(double constant) throws HecMathException
HecMathExceptionpublic HecMath modulo(HecMath tsMath) throws HecMathException
tsMath. A new time series will be created which duplicates the time points
of the current time series. Where time points
match for the current time series and tsMath, the value in the current time
series will be divided by the value in tsMath provided
both values are valid ( not missing ). Divide by zeroes are not allowed.
When the tsMath time series value is zero, the value for the new time
series will be set to missing. Points in the current time
series which cannot be matched to valid points in tsMath are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. If a specific quality value in the parameter time series is questionable or rejected, that quality will be copied to the new time series.
tsMath - the time series to be divided into the current time series.HecMathExceptionpublic HecMath modulo(double constant) throws HecMathException
constant - the value to divide values in current time series.HecMathException - if constant is zero.public HecMath exponentiation(HecMath tsMath) throws HecMathException
tsMath. A new time series will be created which duplicates
the time points of the current time series. Where time points
match for the current time series and tsMath, the value in the current time
series will be raised to the power of the value in tsMath provided
both values are valid ( not missing ). Points in the current time
series which cannot be matched to valid points in tsMath are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. If a specific quality value in the parameter time series is questionable or rejected, that quality will be copied to the new time series.
tsMath - the time series of exponents for the current time series.HecMathExceptionpublic HecMath exponentiation(double constant) throws HecMathException
constant. Times in which values
are missing in the current time series remain missing in the new time series.exponentiation in class HecMathconstant - the exponent value.HecMathException - if constant is zero.public HecMath abs() throws HecMathException
abs in class HecMathHecMathExceptionpublic HecMath negative() throws HecMathException
HecMathExceptionpublic HecMath neg() throws HecMathException
HecMathExceptionpublic HecMath inverse() throws HecMathException
inverse in class HecMathHecMathExceptionpublic HecMath sign() throws HecMathException
HecMathExceptionpublic HecMath sqrt() throws HecMathException
sqrt in class HecMathHecMathExceptionpublic HecMath exp() throws HecMathException
HecMathExceptionpublic HecMath log() throws HecMathException
log in class HecMathHecMathExceptionpublic HecMath log10() throws HecMathException
log10 in class HecMathHecMathExceptionpublic HecMath transformWithFunction(hec.hecmath.computation.ScalarOperable transformer) throws HecMathException
transformWithFunction in class HecMathHecMathExceptionpublic HecMath sin() throws HecMathException
sin in class HecMathHecMathExceptionpublic HecMath cos() throws HecMathException
cos in class HecMathHecMathExceptionpublic HecMath tan() throws HecMathException
tan in class HecMathHecMathExceptionpublic HecMath asin() throws HecMathException
HecMathExceptionpublic HecMath acos() throws HecMathException
HecMathExceptionpublic HecMath atan() throws HecMathException
HecMathExceptionpublic HecMath floor() throws HecMathException
HecMathExceptionpublic HecMath ceil() throws HecMathException
HecMathExceptionpublic HecMath round() throws HecMathException
round in class HecMathHecMathExceptionpublic HecMath truncate() throws HecMathException
truncate in class HecMathHecMathExceptionpublic HecMath fmod(HecMath tsMath) throws HecMathException
tsMath. A new time series will be created which duplicates the time points
of the current time series. Where time points
match for the current time series and tsMath, the value in the current time
series will be divided by the value in tsMath provided
both values are valid ( not missing ). Divide by zeroes are not allowed.
When the tsMath time series value is zero, the value for the new time
series will be set to missing. Points in the current time
series which cannot be matched to valid points in tsMath are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. If a specific quality value in the parameter time series is questionable or rejected, that quality will be copied to the new time series.
Fmod is the same as modulo when both arguments are greater than zero.
tsMath - the time series to be divided into the current time series.HecMathExceptionpublic HecMath fmod(double constant) throws HecMathException
Fmod is the same as modulo when both arguments are greater than zero.
constant - the value to divide values in current time series.HecMathException - if constant is zero.public HecMath sum(HecMath[] tsMathArray) throws HecMathException
tsMathArray, to the current time series.
A new time series will be created which duplicates the time points
of the current time series. Where time points match for the
current time series and each time series in tsMathArray, the values will be summed provided
values for all time series are valid values ( not missing ). Points in the current time
series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be added to the current time series.HecMathExceptionpublic HecMath product(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be multiplied provided the
values for all time series are valid values ( not missing ). Points in the current time
series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be multiplied with the current time series.HecMathExceptionpublic HecMath min(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the minimum of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath max(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the maximum of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath mean(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the arithmetic mean of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath gmean(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the geometric mean of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath hmean(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the harmonic mean of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath rms(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the rms of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath variance(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the variance of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath var(HecMath[] tsMathArray) throws HecMathException
HecMathExceptionpublic HecMath standardDeviation(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the standard deviation of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathException@Deprecated public HecMath stddev(HecMath[] tsMathArray) throws HecMathException
tsMathArray - HecMathExceptionstandardDeviation(HecMath[] tsMathArray)public HecMath med(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the median of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath p1(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the 1st percentile of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath p2(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the 2nd percentile of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath p5(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the 5th percentile of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath p10(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the 10th percentile of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath p20(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the 20th percentile of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath p25(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the 25th percentile of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath p75(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the 75th percentile of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath p80(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the 80th percentile of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath p90(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the 90th percentile of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath p95(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the 95th percentile of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath p98(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the 98th percentile of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath p99(HecMath[] tsMathArray) throws HecMathException
tsMathArray. A new time series will be
created which duplicates the time points of the current time series. Where time points
match for the current and tsMathArray, the values will be the 99th percentile of all time series
for that time, provided the values for all time series are valid values ( not missing ).
Points in the current time series which cannot be matched to valid points in tsMathArray are set
to missing. Values in the current time series which are missing remain missing in
the new time series.The new time series will always have quality defined. For a specific time, if any of the quailty values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)
tsMathArray - the array of time series to be compared with the current time series.HecMathExceptionpublic HecMath roundOff(int digitsPrecision, int powerOfTensPlace) throws HecMathException
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.roundOff in class HecMathdigitsPrecision - Number of digits of precision, between 1 and 8.powerOfTensPlace - Magnitude of ten to round to.HecMathExceptionpublic HecMath accumulation() throws HecMathException
Compute a new time series from the running accumulation of the current time series. For time points in which the current time series 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 ).
accumulation in class HecMathHecMathExceptionpublic double min()
throws HecMathException
min in class HecMathHecMathExceptionpublic int minDate()
throws HecMathException
minDate in class HecMathHecMathExceptionHecTimepublic double max()
throws HecMathException
max in class HecMathHecMathExceptionpublic int maxDate()
throws HecMathException
maxDate in class HecMathHecMathExceptionHecTimepublic double mean()
throws HecMathException
mean in class HecMathHecMathExceptionpublic double sum()
throws HecMathException
sum in class HecMathHecMathExceptionpublic double standardDeviation()
throws HecMathException
standardDeviation in class HecMathHecMathException - if there are less than 3 valid values in the time series.public double skewCoefficient()
throws HecMathException
skewCoefficient in class HecMathHecMathException - if there are less than 3 valid values in the time series.public double kurtosisCoefficient()
throws HecMathException
kurtosisCoefficient in class HecMathHecMathException - if there are less than 4 valid values in the time series.public double mode()
throws HecMathException
mode in class HecMathHecMathException - if there are less than 1 valid value in the time series.public double med()
throws HecMathException
med in class HecMathHecMathException - if there are less than 1 valid value in the time series.public double p1()
throws HecMathException
p1 in class HecMathHecMathException - if there are less than 1 valid value in the time series.public double p2()
throws HecMathException
p2 in class HecMathHecMathException - if there are less than 1 valid value in the time series.public double p5()
throws HecMathException
p5 in class HecMathHecMathException - if there are less than 1 valid value in the time series.public double p10()
throws HecMathException
p10 in class HecMathHecMathException - if there are less than 1 valid value in the time series.public double p20()
throws HecMathException
p20 in class HecMathHecMathException - if there are less than 1 valid value in the time series.public double p25()
throws HecMathException
p25 in class HecMathHecMathException - if there are less than 1 valid value in the time series.public double p75()
throws HecMathException
p75 in class HecMathHecMathException - if there are less than 1 valid value in the time series.public double p80()
throws HecMathException
p80 in class HecMathHecMathException - if there are less than 1 valid value in the time series.public double p90()
throws HecMathException
p90 in class HecMathHecMathException - if there are less than 1 valid value in the time series.public double p95()
throws HecMathException
p95 in class HecMathHecMathException - if there are less than 1 valid value in the time series.public double p98()
throws HecMathException
p98 in class HecMathHecMathException - if there are less than 1 valid value in the time series.public double p99()
throws HecMathException
p99 in class HecMathHecMathException - if there are less than 1 valid value in the time series.public int numberValidValues()
throws HecMathException
numberValidValues in class HecMathHecMathExceptionpublic int numberInvalidValues()
throws HecMathException
HecMathExceptionpublic int numberMissingValues()
throws HecMathException
numberMissingValues in class HecMathHecMathExceptionpublic int numberQuestionedValues()
throws HecMathException
HecMathExceptionpublic int numberRejectedValues()
throws HecMathException
HecMathExceptionpublic int firstValidDate()
throws HecMathException
HecMathExceptionHecTimepublic double firstValidValue()
throws HecMathException
HecMathExceptionpublic int lastValidDate()
throws HecMathException
lastValidDate in class HecMathHecMathExceptionHecTimepublic double lastValidValue()
throws HecMathException
lastValidValue in class HecMathHecMathExceptionpublic HecMath convertToMetricUnits() throws HecMathException
convertToMetricUnits in class HecMathHecMathException - if the unit conversion could not be performed.public HecMath convertToEnglishUnits() throws HecMathException
convertToEnglishUnits in class HecMathHecMathException - if the unit conversion could not be performed.public boolean isMetric()
throws HecMathException
isMetric in class HecMathHecMathException - if the unit system cannot be determined.public boolean isEnglish()
throws HecMathException
isEnglish in class HecMathHecMathException - if the unit system cannot be determined.public boolean canDetermineUnitSystem()
canDetermineUnitSystem in class HecMathpublic java.lang.String getUnits()
public java.lang.String getStandardUnits()
hec.heclib.util.unitConversion.def. This is
done to ease comparison of units between time series and for unit conversions.
For example, "inch", "inches" or "INCHES" are changed to "in".getStandardUnits in class HecMathhec.heclib.util.unitConversion.defpublic void setUnits(java.lang.String unitsString)
public java.lang.String getType()
public void setType(java.lang.String typeString)
typeString - the new type label for the time series.public HecMath successiveDifferences() throws HecMathException
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".
successiveDifferences in class HecMathHecMathException - if data is not of type "INST-VAL" or "INST-CUM".public HecMath timeDerivative() throws HecMathException
By default, the data type of the new time series is set as "PER-AVER".
timeDerivative in class HecMathHecMathExceptionpublic HecMath centeredMovingAverage(int numberToAverageOver, boolean onlyValidValues, boolean useReduced) throws HecMathException
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. If
onlyValidValues 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 than numberToAverageOver values in the interval.
If useReduced is set to false, then the first and last
numberToAverageOver/2 points of the new time series are set to missing.
centeredMovingAverage in class HecMathnumberToAverageOver - 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 than numberToAverageOver )
number of points. Otherwise, set the first and last numberToAverageOver/2
points of the new time series to missing.HecMathException - if the numberToAverageOver is less than 3 or not odd.public HecMath olympicSmoothing(int numberToAverageOver, boolean onlyValidValues, boolean useReduced) throws HecMathException
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. If
onlyValidValues 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 than numberToAverageOver values in the interval.
If useReduced is set to false, then the first and last
numberToAverageOver/2 points of the new time series are set to missing.
olympicSmoothing in class HecMathnumberToAverageOver - 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 than numberToAverageOver )
number of points. Otherwise, set the first and last numberToAverageOver/2
points of the new time series to missing.HecMathException - if the numberToAverageOver is less than 3 or not odd.public HecMath forwardMovingAverage(int numberToAverageOver, boolean onlyValidValues, boolean useReduced) throws HecMathException
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. If
onlyValidValues 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 than numberToAverageOver values in the interval.
If useReduced is set to false, then the first
numberToAverageOver points of the new time series are set to missing.
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 than numberToAverageOver )
number of points. Otherwise, set the first and last numberToAverageOver/2
points of the new time series to missing.HecMathExceptionpublic HecMath forwardMovingAverage(int numberToAverageOver) throws HecMathException
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 the numberToAverageOver 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.
forwardMovingAverage in class HecMathnumberToAverageOver - the number of values to average over for computing the forward
moving average. Must be greater than or equal to 2.HecMathExceptionpublic HecMath screenWithMaxMin(double minValueLimit, double maxValueLimit, double changeLimit) throws HecMathException
Values in the time series are screened for quality.
Values below minValueLimit or above
maxValueLimit or with a change from the previous time series value
greater than changeLimit fail the quality test. The maximum change
comparison is done only when consecutive values are not flagged.
Values failing the screening test are set to the "Missing" value.
minValueLimit - minimum valid value limit.maxValueLimit - maximum valid value limit.changeLimit - maximum change allowed in the tested value from the previous time series value.HecMathExceptionscreenWithMaxMin( double minValueLimit, double maxValueLimit, double changeLimit,
boolean setInvalidValueToUndefined, String qualityFlagForInvalidValue )public HecMath screenWithMaxMin(double minValueLimit, double maxValueLimit, double changeLimit, boolean setInvalidToSpecified, double invalidValueReplacement, java.lang.String qualityFlagForInvalidValue) throws HecMathException
Values in the time series are screened for quality.
Values below minValueLimit or above
maxValueLimit or with a change from the previous time series value
greater than changeLimit fail the quality test. The maximum change
comparison is done only when consecutive values are not flagged.
screenWithMaxMin in class HecMathminValueLimit - minimum valid value limit.maxValueLimit - maximum valid value limit.changeLimit - maximum change allowed in the tested value from the previous time series value.setInvalidToSpecified - if true, time series values failing the quality test are set
to the specified value.invalidValueReplacement - The value to use for replacing invalid values is setInvalidToSpecifiedValue 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".HecMathExceptionscreenWithMaxMin( double minValueLimit, double maxValueLimit, double changeLimit,
boolean setInvalidToMissingValue, String qualityFlagForInvalidValue )public HecMath screenWithMaxMin(double minValueLimit, double maxValueLimit, double changeLimit, boolean setInvalidToUndefined, java.lang.String qualityFlagForInvalidValue) throws HecMathException
Values in the time series are screened for quality.
Values below minValueLimit or above
maxValueLimit or with a change from the previous time series value
greater than changeLimit fail the quality test. The maximum change
comparison is done only when consecutive values are not flagged.
screenWithMaxMin in class HecMathminValueLimit - minimum valid value limit.maxValueLimit - maximum valid value limit.changeLimit - maximum change allowed in the tested value from the previous time series value.setInvalidToUndefined - 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".HecMathExceptionscreenWithMaxMin( double minValueLimit, double maxValueLimit, double changeLimit,
boolean setInvalidToMissingValue, String qualityFlagForInvalidValue )public HecMath screenWithMaxMin(double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit) throws HecMathException
Values in the time series are screened for quality.
Values below minRejectLimit or above
maxRejectLimit are marked with a rejected quality flag. Other values below
minQuestionLimit or above maxQuestionLimit 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.
minRejectLimit - Values below this will be marked as rejected.minQuestionLimit - Values below this, but not below minRejectLimit will be marked as questioned.maxQuestionLimit - Values above this, but not above maxRejectLimit will be marked as questioned.maxRejectLimit - Values above this will be marked as rejected.HecMathExceptionscreenWithMaxMin(TimeSeriesContainer tsc, double minValueLimit, double maxValueLimit, double changeLimit, boolean setInvalidValueToSpecified, double invalidValueReplacement, String qualityFlagForInvalidValue),
screenWithMaxMin(TimeSeriesContainer tsc, double minValueLimit, double maxValueLimit, double changeLimit, boolean setInvalidValueToUndefined, String qualityFlagForInvalidValue)public HecMath screenWithRateOfChange(double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit) throws HecMathException
Values in the time series are screened for quality.
Values whose rate of change from the last valid value are below minRejectLimit or above
maxRejectLimit are marked with a rejected quality flag. Other whose rate of change from
the last valid value are values below minQuestionLimit or above maxQuestionLimit
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.
Rates are computed in units per hour.
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 below
minRejectLimit will be marked as questioned.maxQuestionLimit - Values whose rate of change from the last valid value are above this, but not above
maxRejectLimit will be marked as questioned.maxRejectLimit - Values whose rate of change from the last valid value are above this will be marked as rejected.HecMathExceptionpublic HecMath screenWithDurationMagnitude(java.lang.String durationStr, double minRejectLimit, double minQuestionLimit, double maxQuestionLimit, double maxRejectLimit) throws HecMathException
Values in the time series are screened for quality.
All (non-missing) values whose accumulated value for the specified duration is below
minRejectLimit or above maxRejectLimit are marked with a rejected quality flag.
Other whose whose accumulated value for the specified duration is below minQuestionLimit or
above maxQuestionLimit 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.
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 below
minRejectLimit will be marked as questioned.maxQuestionLimit - Values whose accumulated value for the specified duration is above this, but not above
maxRejectLimit will be marked as questioned.maxRejectLimit - Values whose accumulated value for the specified duration is above this will be marked as rejected.HecMathExceptionpublic HecMath screenWithConstantValue(java.lang.String durationStr, double rejectTolerance, double questionTolerance, double minThreshold, int maxMissing) throws HecMathException
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 below questionTolerance 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.
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.HecMathExceptionpublic HecMath screenWithForwardMovingAverage(int numberToAverageOver, double changeLimit) throws HecMathException
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 than changeLimit are flagged or set to
the "Missing" value depending upon the settings for setInvalidToMissingValue or
qualityFlagForInvalidValue 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.
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.HecMathExceptionpublic HecMath screenWithForwardMovingAverage(int numberToAverageOver, double changeLimit, boolean setInvalidToUndefined, java.lang.String qualityFlagForInvalidValue) throws HecMathException
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 than changeLimit are flagged or set to
the "Missing" value depending upon the settings for setInvalidToMissingValue or
qualityFlagForInvalidValue 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".
screenWithForwardMovingAverage in class HecMathnumberToAverageOver - 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.setInvalidToUndefined - 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". A blank string is entered to disable the
setting of the quality flag.HecMathException - if the numberToAverageOver is less than 3 or if an
unrecognized quality flag is entered for qualityFlagForInvalidValue or if
setInvalidToMissingValue is false and qualityFlagForInvalidValue is blank
( no action would occur ).public HecMath estimateForMissingValues(int maxMissingAllowed) throws HecMathException
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.
estimateForMissingValues in class HecMathmaxMissingAllowed - maximum number consecutive missing values between valid values
in which interpolation is allowed.HecMathException - if the time series contains less than 2 valid values.estimateForMissingPrecipValues(int maxMissingAllowed)public HecMath estimateForMissingPrecipValues(int maxMissingAllowed) throws HecMathException
The function interpolates between valid values in the time series to fill in locations in time with values defined as "Missing".
If the values bracketing the missing period are increasing with time, only interpolate
if there are no more thant maxMissingAllowed successive bad values. If
the values bracketing the missing period are equal, then estimate any number of missing
values. If the values bracketing the missing period are decreasing with time,
do not estimate any missing values. Data must be of type "INST-CUM".
estimateForMissingPrecipValues in class HecMathmaxMissingAllowed - maximum number consecutive missing values between valid values
in which interpolation is allowed.HecMathException - if the data is not of type "INST-CUM" or
if the time series contains less than 2 valid values.estimateForMissingValues(int maxMissingAllowed)public HecMath replaceSpecificValues(HecDouble from, HecDouble to) throws HecMathException
The function searches through the time series array and replaces values that match the "from" value with the "to" value. HecDouble controls the precision to which the value is compared (e.g., 12.345 is to three places after the decimal).
replaceSpecificValues in class HecMathfrom - value which will be replacedto - value with which to replace withHecMathException - if the time series contains less than 2 valid values.public HecMath replaceValuesInRange(HecDouble min, HecDouble max, HecDouble to) throws HecMathException
The function searches through the time series array and replaces values between the "min" and "max" value with the "to" value.
replaceValuesInRange in class HecMathmin - minimum value which will be replacedmax - maximum value which will be replacedto - value with which to replace withHecMathException - if the time series contains less than 2 valid values.public HecMath mergeTimeSeries(HecMath tsMath) throws HecMathException
Will derive a new time series by merging all values in the current and
parameter, tsMath, time series.
For points in the two time series coincident in time, valid values in the primary (current) time series
take presidence over valid values in the parameter time series, and will be used in the new
merged time series. For coincident points in which the value from the primary time series are
flagged "Missing", then the valid value from the parameter time series will be used in the new
merged time series. If values for both time series are both "Missing", then the value for the time
in the merged time series is set to "Missing".
mergeTimeSeries in class HecMathtsMath - time series for merging data with the current time series.HecMathException - if either the current or parameter time series are empty.public PairedDataMath generateDataPairs(HecMath tsMath, double buffer) throws HecMathException
generateDataPairs in class HecMathtsMath - = other time seriesbuffer - - in minutes because time series containers are in minutesHecMathExceptionpublic PairedDataMath generateDataPairs(HecMath tsMath, boolean sort) throws HecMathException
Will derive a paired data set by pairing values in the current time series and
the parameter time series, tsMath, that are
coincident in time. The values of the primary (current)
time series form the x-ordinates, while values from tsMath form
the y-ordinates of the resulting paired data set.
generateDataPairs in class HecMathtsMath - second time series for forming data pairs ( forms the y-ordinates of the resulting paired data set).sort - if true, the paired data are sorted with ascending values of x.HecMathException - if times in the two time series do not match point for point.public java.lang.String isMuskingumRoutingStable(int numberSubreaches,
double muskingumK,
double muskingumX)
throws HecMathException
Test if the input parameters statisfy the stability criteria:
1/(2(1-x)) <= K/deltaT <= 1/2x, where deltaT = (time series time interval)/numberSubreaches
numberSubreaches - number of routing subreaches.muskingumK - muskingum "k" in hours.muskingumX - muskingum "X" parameter, between 0.0 and 0.5.HecMathException - if the current time series is not a regular interval time series, or
if values for numberSubreaches or muskingumX are invalid.public HecMath muskingumRouting(int numberSubreaches, double muskingumK, double muskingumX) throws HecMathException
Use isMuskingumRoutingStable() to determine if the Muskingum hydrologic routing is stable
for the parameters entered. Only regular interval time series can be routed.
muskingumRouting in class HecMathnumberSubreaches - number of routing subreaches.muskingumK - muskingum "k" in hours.muskingumX - muskingum "X" parameter, between 0.0 and 0.5.HecMathException - if the time series is not a regular interval time series, or
if values for numberSubreaches or muskingumX are invalid.public HecMath straddleStaggerRouting(int numberToAverage, int numberToLag, int numberSubreaches) throws HecMathException
Use isMuskingumRoutingStable() to determine if the Muskingum hydrologic routing is stable
for the parameters entered. Only regular interval time series can be routed.
straddleStaggerRouting in class HecMathnumberToAverage - number of ordinates to average.numberToLag - number of ordinates to lag hydrograph.numberSubreaches - number of routing subreaches.HecMathException - if the time series is not a regular interval time series.public HecMath decayingBasinWetnessParameter(HecMath tsMath, double decayRate) throws HecMathException
tsMath. The formula for computing
the new time series from the time series precipation and decayRate
is:
tsNew(i) = decayRate * tsNew(i-1) + tsPrecip(i)
The first value of the current time series is used to set the first value
in the new time series, that is tsNew(0).
The current time series and tsMath may be the same. Both the current
time series and tsMath must be regular interval and identical in
time. Missing values in the precip time series ( tsPrecip(i) ) are zero for the
computation.
decayingBasinWetnessParameter in class HecMathtsMath - precipitation time series.decayRate - decay rate R, where 0 < R < 1.tsMath.HecMathException - if decay rate is not less than one and greater than 0,
or if current time series and tsMath are not identical
in time or not regular interval.public HecMath flowAccumulatorGageProcessor(HecMath tsMath) throws HecMathException
The current time series is assumed to be the accumulated flow data, while the
paramter time series, tsMath, is assumed to be the corresponding
time series of the count. The two time series are combined to compute a new
time series of period average flow:
tsNew(i) = ( tsAccFlow(i)-tsAccFlow(i-1) ) / ( tsCount(i)-tsCount(i-1) )
In the above equation, if tsAccFlow(i), tsAccFlow(i-1), tsCount(i) or tsCount(i-1)
are missing, tsNew(i) is set to missing. The new time series is
assigned the data type "PER-AVER".flowAccumulatorGageProcessor in class HecMathtsMath - a time series of counts for the flow accumulator gage.HecMathExceptionpublic HecMath convertToIrregular(java.lang.String blockSize) throws HecMathException
convertToIrregular in class HecMathHecMathExceptionpublic HecMath interpolateDataAtRegularInterval(java.lang.String timeIntervalString, java.lang.String timeOffsetString) throws HecMathException
timeIntervalString is a valid DSS time interval character string
( "15MIN", "1HOUR", "1DAY", etc.). timeOffsetString defines
the time offset from the standard interval time.
timeOffsetString has the form
"nT", where "n" is an integer number and "T" is one of the time increments:
"M(INUTES)", "D(AYS)", "H(OUR)", "W(EEKS)", "MON(THS)" or "Y(EARS)" ( characters in
the parenthesis are optional ). For example, a time offset of
9 minutes would be expressed as "9M" or "9MIN".
Units and data type of the current time series are preserved in the new time series.
interpolateDataAtRegularInterval in class HecMathtimeIntervalString - a valid DSS regular time interval string which defines
the time interval of the new time series.timeOffsetString - the offset of the new time points from the regular interval time.
This string may be a blank string or the null value.HecMathException - if data type ("INST-VAL", etc.) is not defined for the
time series.public HecMath transformTimeSeries(java.lang.String timeIntervalString, java.lang.String timeOffsetString, java.lang.String functionTypeString) throws HecMathException
timeIntervalString and time offset
set by timeOffsetString. New time series values are generated
by processing current values according to the method set by
functionTypeString.
timeIntervalString must be a valid DSS regular time interval
character string ( "15MIN", "1HOUR", "1DAY", etc.).
Time of the new data points can be offset from the standard interval time
using timeOffsetString. Thus using timeOffsetString
the derived hourly interval data could be offset to be computed
at 5 minutes past the top of the hour.
timeOffsetString has the form "nT",
where "n" is an integer number and "T" is one of the time increments:
"M(INUTES)", "D(AYS)", "H(OUR)", "W(EEKS)", "MON(THS)" or "Y(EARS)" ( characters in
the parenthesis are optional ). For example, a time offset of
9 minutes would be expressed as "9M" or "9MIN".
functionTypeString is a 3 character string defining
how the data in the current time series will be processed to compute values
for the new time series. Valid settings for functionTypeString are:
"INT" - Interpolate at end of interval
"MAX" - Maximum over interval
"MIN" - Minimum over interval
"AVE" - Average over interval
"ACC" - Accumulation over interval
"ITG" - Integration over interval
"NUM" - Number of valid data over interval
transformTimeSeries in class HecMathtimeIntervalString - a valid DSS regular time interval string which defines
the time interval of the new time series.timeOffsetString - the offset of the new time points from the regular interval time.
This string may be a blank string or the null value.functionTypeString - 3 character string defining the function method for
transforming the current time series data.HecMathException - if the paramters could not be interpreted, or
or if the data type ("INST-VAL", etc.) of the current time
series is not defined.public HecMath transformTimeSeries(java.lang.String timeIntervalString, java.lang.String timeOffsetString, java.lang.String functionTypeString, boolean toIrregular) throws HecMathException
transformTimeSeries in class HecMathHecMathExceptionpublic HecMath transformTimeSeries(HecMath tsMath, java.lang.String functionTypeString) throws HecMathException
tsMath. tsMath may
be a regular or irregular interval time series.
functionTypeString is a 3 character string defining
how the data in the current time series will be processed to compute values
for the new time series. Valid settings for functionTypeString are:
"INT" - Interpolate at end of interval
"MAX" - Maximum over interval
"MIN" - Minimum over interval
"AVE" - Average over interval
"ACC" - Accumulation over interval
"ITG" - Integration over interval
"NUM" - Number of valid data over interval
transformTimeSeries in class HecMathtsMath - a time series used to set the time pattern for the new time
series. May be either regular or irregular interval.tsMath.HecMathException - if the paramters could not be interpreted, or
or if the data type ("INST-VAL", etc.) of the current time
series is not defined.transformTimeSeries(String timeIntervalString, String timeOffsetString, String functionTypeString )public HecMath transformTimeSeries(HecMath tsMath, java.lang.String functionTypeString, boolean toIrregular) throws HecMathException
transformTimeSeries in class HecMathHecMathExceptionpublic HecMath transformTimeSeries(HecMath tsMath, java.lang.String functionTypeString, boolean toIrregular, double missingAllowed) throws HecMathException
HecMathExceptionpublic HecMath snapToRegularInterval(java.lang.String timeIntervalString, java.lang.String timeOffsetString, java.lang.String timeBackwardString, java.lang.String timeForwardString) throws HecMathException
A new regular interval time series will be created having the time interval of
timeIntervalString with the time offset from the regular interval
specifed by timeOffsetString. In most cases, there will be no time offset.
Data from the orginal time series will be "snapped" to the regular interval if the time
of the data falls within the time window set by the timeBackwardString
and the timeForwardString. That is, if the new regular interval is at the top
of the hour and the time window extends to 9 minutes before the hour and 15 minutes after
the hour, an original data point at 0852 would be snapped to the time 0900 while a
point at 0916 would be ignored.
timeIntervalString is a character string that represents a valid DSS time interval
( "15MIN", "1HOUR", "1DAY", etc.). timeOffsetString,
timeBackwardString and timeForwardString are units of time
expressed as "nT", where "n" is an integer number and "T" is one of the time increments:
"M(INUTES)", "D(AYS)", "H(OUR)", "W(EEKS)", "MON(THS)" or "Y(EARS)" ( characters in
the parenthesis are optional ). In the above example, timeIntervalString
would be "1HOUR", timeOffsetString would be "0M",
timeBackwardString would be "9M" ( or "9min" ) and
timeForwardString would be "15M".
This function is typically used to convert irregular time series data that is reported close to the hour to regular time series at the hour.
snapToRegularInterval in class HecMathtimeIntervalString - a valid DSS regular time interval string which defines
the time interval of the new time series.timeOffsetString - the offset of the new time points from the regular interval time.
This string may be a blank string or the null value.timeBackwardString - the time to look backwards from the regular time interval
( plus offset ) for valid points.timeForwardString - the time to look forwards from the regular time interval
( plus offset ) for valid points.HecMathException - if timeIntervalString is not a valid DSS time interval string,
or if timeOffsetString, timeBackwardString, timeForwardString are
not valid time increment strings.public HecMath shiftInTime(java.lang.String timeShiftString) throws HecMathException
A new time series will created with the time points shifted by the amount specified by
timeShiftString. timeShiftString takes the form
"nT", where "n" is an integer number and "T" is one of the time increments:
"M(INUTES)", "D(AYS)", "H(OUR)", "W(EEKS)", "MON(THS)" or "Y(EARS)" ( characters in
the parenthesis are optional ). As an example, to shift the time series data ahead
by one hour would be accomplished by setting timeShiftString to
"1H" or "1HOUR".
shiftInTime in class HecMathtimeShiftString - the increment to shift the time series times.HecMathException - if timeShiftString is not valid time increment string.public HecMath shiftInTime(int timeShiftMinutes) throws HecMathException
A new time series will created with the time points shifted by the amount specified by
timeShiftString. timeShiftString takes the form
"nT", where "n" is an integer number and "T" is one of the time increments:
"M(INUTES)", "D(AYS)", "H(OUR)", "W(EEKS)", "MON(THS)" or "Y(EARS)" ( characters in
the parenthesis are optional ). As an example, to shift the time series data ahead
by one hour would be accomplished by setting timeShiftString to
"1H" or "1HOUR".
timeShiftMinutes - HecMathExceptionpublic HecMath shiftInTime(int timeShiftMinutes, int timeInterval, int numberIntervals) throws HecMathException
HecMathExceptionpublic HecMath shiftInTime(HecTime timeToShift) throws HecMathException
A new time series will created with the time points shifted by the amount specified by
timeShiftString. timeShiftString takes the form
"nT", where "n" is an integer number and "T" is one of the time increments:
"M(INUTES)", "D(AYS)", "H(OUR)", "W(EEKS)", "MON(THS)" or "Y(EARS)" ( characters in
the parenthesis are optional ). As an example, to shift the time series data ahead
by one hour would be accomplished by setting timeShiftString to
"1H" or "1HOUR".
timeShiftMinutes - HecMathExceptionpublic HecMath shiftAdjustment(HecMath tsMath) throws HecMathException
shiftAdjustment in class HecMathtsMath - HecMathExceptionpublic HecMath periodConstants(HecMath math) throws HecMathException
periodConstants in class HecMathHecMathExceptionpublic LinearRegressionStatistics correlationCoefficients(HecMath tsMath) throws HecMathException
tsMath. The time points in the two time
series must match exactly. Missing values are ignored.
Values in the primary (current) time series and tsMath are matched by time to
form the data pairs for the correlation analysis. The function returns a
LinearRegressionStatistics< object containing he comprehensive set of correlation statistics.
correlationCoefficients in class HecMathtsMath - the time series for correlation with the current time series.HecMathExceptionLinearRegressionStatisticspublic HecMath[] cyclicAnalysis() throws HecMathException
Fourteen statistical parameters are computed in each analysis. These are: maximum, minimum, average, standard deviation, 5%, 10%, 25%, 50% (median), 75%, 90%, 95% precentiles, date/time of maximum, date/time of minimum, and number of values processed. The function creates a pseudo regular interval time series for each function parameter. For example, with 1HOUR interval data, a 1HOUR interval time series with 24 hours of data (hours 0100 to 2400) would be created containing the maximum of all values at the time 0100, 0200, etc.
The 14 pseudo time series of cyclic statistics are returned by the function as an array of time series objects. The parameter part of the record path for each time series is modified to indicate the type of the statistical parameter. For a flow record, the paramter "FLOW" would become "FLOW-MAX" for the maximum values statistisc, "FLOW-P5" for the 5% percentile statistics, etc.
cyclicAnalysis in class HecMathHecMathException - if the time series is not regular interval or does not
have a time interval of "1HOUR", "1DAY" or "1MONTH".public HecMath[] cyclicAnalysis(java.lang.String startYear) throws HecMathException
HecMathExceptionpublic PairedDataMath[] durationAnalysisStandard(java.lang.String periodType, DurationPeriod[] durationPeriods, int iplottingPointsMethod, double[] userDefinedPoints, int horizontalScale, int verticalScale) throws HecMathException
periodType defines the analysis periods, with "Annual"
being the typical analysis. The values are:
"Annual",
"Quarterly",
"Monthly",
"Other"
* @param durationPeriods - array of DurationPeriod(s) for user defined
duration periods. null for standard periods calculations
* @param iplottingPointsMethod - what plotting points should be selected. Possibilities are:
DurationAnalysis.PLOTTING_POINTS_ALL
DurationAnalysis.PLOTTING_POINTS_TRADITIONAL
DurationAnalysis.PLOTTING_POINTS_USER_DEFINEDdouble[] - userDefinedPoints - User defined points, in precent 0< f < 100, or
null if iplottingPointsMethod != PLOTTING_POINTS_USER_DEFINEDhorizontalScale - - defines the horizontal scale of the plot:
DurationAnalysis.PLOT_PROBABILITY_HORIZONTAL;
DurationAnalysis.PLOT_EXCEEDANCE_HORIZONTAL;verticalScale - - defines the horizontal scale of the plot:
DurationAnalysis.PLOT_LINEAR_VERTICAL;
DurationAnalysis.PLOT_LOG_VERTICAL;HecMathException - if the time series is not regular interval or does not
have a time interval "1DAY".public PairedDataMath[] durationAnalysisBin(java.lang.String periodType, DurationPeriod[] durationPeriods, int binDistribution, int numberBins, double[] binLimits, int iplottingPointsMethod, double[] userDefinedPoints, int horizontalScale, int verticalScale) throws HecMathException
HecMathExceptionpublic PairedDataMath multipleRegression(HecMath[] tsMathArray, double minimumLimit, double maximumLimit) throws HecMathException
tsMathArray. All the time series must be
regular interval time series with the same time interval. Data is processed
for the time period common to all the time series. While the starting and
ending time for each time series need not be the same, there must be time points
common to all the time series. For any given time point, if a value is missing
in any time series, no data for that time is processed.The function computes a set of linear regression coefficients (Bn) of the general form.
Y = B0 + B1*X1 + B2*X2 + B3*X3
That is an estimate of the current time series could be computed from the time series in
tsMathArray and the regression coefficients such that:
tsEstimate(i) = B0 + B1*ts1(i) + B2*ts2(i) + B3*ts3(i) ...
multipleRegression in class HecMathtsMathArray - an array of time series objects for the regression analysis with
the current time series.minimumLimit - exclude values in the current time series below this limit.
Set to HecMath.UNDEFINED to disable this option.maximumLimit - exclude values in the current time series above this limit
Set to HecMath.UNDEFINED to disable this option.HecMathException - if the current time series and the time series in
tsMathArray are not regular interval time series with the same
time interval, or if there is no concurrent data between all the time series.HecMath.applyMultipleLinearRegression( String, String, HecMath[], double, double )public HecMath extractTimeSeriesDataForTimeSpecification(java.lang.String timeLevelString, java.lang.String rangeString, boolean isInclusive, int intervalWindow, boolean setAsIrregular) throws HecMathException
timeLevelString defines the time level/interval for extraction ( year, month,
day of the month, day of the week, or 24-hour time). rangeString
defines the interval range for data extraction applicable to the time level. For example,
if timeLevelString is "MONTH", a valid range would be "JAN-MAR".
The rangeString variable can define a single interval value
(e.g. "JAN" - select data from January only) or a beginning and ending
range (e.g. "JAN-MAR" - select data for January through March).
The table below shows the valid timeLevelString
and rangeString values.
timeLevelString rangeString: Example rangeString
"YEAR" Four digit year value. "1938" or "1938-1945"
"MONTH" Standard 3 char abbreviation "JAN" or "JAN-MAR"
for month.
"DAYMON(TH)" Day of the month or "15" or "1-15 or
"LASTDAY" string "16-LASTDAY"
"DAYWEE(K)" Standard 3 char abbreviation "MON" or "SUN-TUE"
for day of the week.
"TIME" Four digit 24-hour military "2400" or "0300-0600"
style clock time.
TimeSeriesMath contains enumerated string variables which may
be used for timeLevelString in place of the string values in the
table above:
Year TimeSeriesMath.LEVEL_YEAR_STRING
Month TimeSeriesMath.LEVEL_DAYMONTH_STRING
Day of Month TimeSeriesMath.LEVEL_MONTH_STRING
Day of Week TimeSeriesMath.LEVEL_DAYWEEK_STRING
24-hour time TimeSeriesMath.LEVEL_TIME_STRING
isInclusive determines whether the data extraction operation
is either inclusive or exclusive of the specified range. For example, if
isInclusive is true and the range is set to "JAN-MAR" for the
"MONTH" time level, the extracted data will include all data in the
months January through March for all the years of time series data. If
isInclusive is false for this example, the extracted data covers
the time April through December (is exclusive of data for January through March).
intervalWindow is only used when the timeLevelString
is "TIME". intervalWindow is the minutes before and after the time
of day within which the data will be extracted. intervalWindow effectively
increases the time range at the beginning and end intervalWindow minutes.
setAsIrregular defines whether the extracted data is saved as regular interval
or irregular interval data. Most often the time series data formed by the extraction
process will no longer be regular interval, and setAsIrregular should
be set to true. Setting setAsIrregular to false will force an
attempt to save the data as regular interval time data.
extractTimeSeriesDataForTimeSpecification in class HecMathtimeLevelString - selection interval for data extraction ("YEAR", "MONTH",
"DAYMON(TH)", "DAYWEE(K)" or "TIME").rangeString - range of time interval for data extraction.isInclusive - if true, data is extracted inclusive of the interval range, if false
data is extracted exclusive of the interval rangeintervalWindow - time window, in minutes. Only applied if
timeLevelString is "TIME".setAsIrregular - if true, save the time series as irregular interval time
series data (recommended), if false force a save as
regular interval time series data.HecMathException - if could not suscessfully interpret timeLevelString
or rangeString.public static HecMath generateRegularIntervalTimeSeries(java.lang.String startTimeString, java.lang.String endTimeString, java.lang.String timeIntervalString, double initialValue) throws HecMathException
initialValue.
startTimeString and endTimeString are standard time
window strings (e.g. "01JAN2001 0100").
timeIntervalString is a valid DSS time interval character string
( "15MIN", "1HOUR", "1DAY", etc.). timeOffsetString defines
the time offset from the standard interval time.
timeOffsetString has the form
"nT", where "n" is an integer number and "T" is one of the time increments:
"M(INUTES)", "D(AYS)", "H(OUR)", "W(EEKS)", "MON(THS)" or "Y(EARS)" ( characters in
the parenthesis are optional ). For example, a time offset of
9 minutes would be expressed as "9M" or "9MIN".startTimeString - a standard HEC Time window string defining the
time series data start date/time.endTimeString - a standard HEC Time window string defining the
time series data end date/time.timeIntervalString - a valid DSS regular time interval string which defines
the time interval of the new time series.initialValue - the initial value for all time series points. Set
to HecMath.UNDEFINED to set all values to missing.initialValue.
Data units and type are blank.HecMathException - if the time parameter cannot be successfully interpreted.public static HecMath generateRegularIntervalTimeSeries(java.lang.String startTimeString, java.lang.String endTimeString, java.lang.String timeIntervalString, java.lang.String timeOffsetString, double initialValue) throws HecMathException
initialValue.
startTimeString and endTimeString are standard time
window strings (e.g. "01JAN2001 0100").
timeIntervalString is a valid DSS time interval character string
( "15MIN", "1HOUR", "1DAY", etc.). timeOffsetString defines
the time offset from the standard interval time.
timeOffsetString has the form
"nT", where "n" is an integer number and "T" is one of the time increments:
"M(INUTES)", "D(AYS)", "H(OUR)", "W(EEKS)", "MON(THS)" or "Y(EARS)" ( characters in
the parenthesis are optional ). For example, a time offset of
9 minutes would be expressed as "9M" or "9MIN".startTimeString - a standard HEC Time window string defining the
time series data start date/time.endTimeString - a standard HEC Time window string defining the
time series data end date/time.timeIntervalString - a valid DSS regular time interval string which defines
the time interval of the new time series.timeOffsetString - the offset of the new time points from the regular interval time.
This string may be a blank string or the null value.initialValue - the initial value for all time series points. Set
to HecMath.UNDEFINED to set all values to missing.initialValue.
Data units and type are blank.HecMathException - if the time parameter cannot be successfully interpreted.public static HecMath generateRegularIntervalTimeSeries(java.lang.String startTimeString, java.lang.String endTimeString, int timeIntervalMinutes, int timeOffsetMinutes, double initialValue) throws HecMathException
startTimeString - endTimeString - timeIntervalMinutes - timeOffsetMinutes - initialValue - HecMathExceptionpublic boolean checkTimeSeriesMatch(TimeSeriesContainer tsc) throws HecMathException
tsc exactly match the
times in the current time series.tsc - the hec.io.TimeSeriesContainer for testing.tsc exactly match the times for the current time series.HecMathException - if the times in tsc do not
exactly match the times for the current time series.TimeSeriesContainerpublic boolean checkTimeSeriesMath(HecMath math, java.lang.String methodName) throws HecMathException
math is an instance of hec.hecmath.TimeSeriesMath object.math - the HecMath object for testing.math is a TimeSeriesMath object.HecMathException - if math is empty not an instance of TimeSeriesMath.public static boolean checkTimeSeries(TimeSeriesContainer tsc) throws HecMathException
tsc to ensure that there is data.tsc - the hec.io.TimeSeriesContainer for testing.tsc is not empty.HecMathException - if tsc is empty or contains no valid data.TimeSeriesContainerpublic boolean isValid(int index)
index
in the current time series is valid ( okay or not missing ).public HecMath copy() throws HecMathException
copy in class HecMathHecMathException@Deprecated
public double[] getSortedPeaks()
throws HecMathException
HecMathException@Deprecated
public java.util.Vector computeSimpleFrequency()
throws HecMathException
HecMathExceptionpublic TimeSeriesMath expandVerticalDatum() throws HecMathException
expandVerticalDatum in interface hec.data.IVerticalDatumOperations<TimeSeriesMath,HecMathException>HecMathExceptionpublic TimeSeriesMath collapseVerticalDatum() throws HecMathException
collapseVerticalDatum in interface hec.data.IVerticalDatumOperations<TimeSeriesMath,HecMathException>HecMathException