public class PairedDataMath extends HecMath implements hec.data.IRating
PairedDataMath class wraps around a
hec.io.PairedDataContainer (paired data) and
provides the user the capability to perform a set of
high level operations. For example, if the PairedDataMath object
contains paired data in the form of a rating table,
PairedDataMath can be used to derive a flow time series from
a stage time series:
tsFlow = rtable.ratingTableInterpolation( tsStage )
HecMath,
TimeSeriesMath,
PairedDataContainerEXTRAPOLATE, 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 |
|---|
PairedDataMath() |
| Modifier and Type | Method and Description |
|---|---|
HecMath |
abs()
Create a new paired data set with y-values computed from the absolute values of the
current paired data y-values.
|
HecMath |
add(double constant)
Add a constant value to the y-values in current paired data set.
|
HecMath |
add(HecMath math) |
TimeSeriesMath |
applyMultipleLinearRegression(java.lang.String startTimeString,
java.lang.String endTimeString,
TimeSeriesMath[] tsMathArray,
double minimumLimit,
double maximumLimit)
Apply the regression coefficients contained in the paired data set to the set
of time series in
tsMathArray to develop a new time series. |
boolean |
canDetermineUnitSystem()
See if the unit system can be successfully determined from the units string.
|
static boolean |
checkPairedData(PairedDataContainer pdc)
Perform basic checks on the PairedDataContainer
pdc to ensure that
there is data. |
static boolean |
checkPairedDataCurve(PairedDataContainer pdc,
int curveNumber)
Perform basic checks on the PairedDataContainer
pdc to
ensure that data is available for the curve curveNumber. |
TimeSeriesMath |
conicInterpolation(HecMath tsMath,
java.lang.String inputType,
java.lang.String outputType,
double storageScaleFactor)
Use the conic interpolation table in the current paired data set to develop a new time
series from the interpolation of
tsMath. |
HecMath |
convertToEnglishUnits()
Convert values to English units.
|
HecMath |
convertToMetricUnits()
Convert values to metric (SI) units.
|
HecMath |
copy()
Create a duplicate copy of the paired data set.
|
HecMath |
cos()
Create a new paired data set with y-values computed from the cosine of the
current paired data y-values.
|
HecMath |
divide(double constant)
Divide the y-values in current paired data set by a constant value.
|
HecMath |
divide(HecMath math) |
HecMath |
exponentiation(double constant)
Raise y-values in current paired data set to the power of
constant. |
long[] |
getCreateDates()
Retrieves the creation dates of the rating in milliseconds, one for each contained rating
|
DataContainer |
getData()
Copy the current PairedDataContainer data in the PairedDataMath object
into
container. |
void |
getData(DataContainer container)
Copy the current PairedDataContainer data in the PairedDataMath object
into
container. |
java.lang.String[] |
getDataUnits()
Retrieves the data ratingUnits.
|
long |
getDefaultValueTime()
Retrieves the default value time.
|
long[] |
getEffectiveDates()
Retrieves the effective dates of the rating in milliseconds, one for each contained rating
|
int |
getIndParamCount()
Retrieves the number of independent parameters for this rating.
|
java.lang.String |
getName()
Retrieves the name of the rating.
|
double[][] |
getRatingExtents()
Retrieves the min and max value for each parameter of the rating, in the current ratingUnits.
|
double[][] |
getRatingExtents(long ratingTime)
Retrieves the min and max value for each parameter of the rating, in the current ratingUnits.
|
java.lang.String[] |
getRatingParameters()
Retrieves the rating parameters.
|
long |
getRatingTime()
Retrieves the rating time.
|
java.lang.String[] |
getRatingUnits()
Retrieves the rating ratingUnits.
|
int |
getSelectedCurve() |
java.lang.String |
getStandardUnits()
Returns the standardized units label for the paired data y-values.
|
java.lang.String |
getUnits()
Returns the units label of the y-values for the current paired data set.
|
PairedDataMath |
interpolate(double[] xarray,
boolean linear,
boolean doExtrapolation)
Resample the x
|
HecMath |
inverse()
Create a new paired data set with y-values computed from 1 divided by
current paired data y-values.
|
boolean |
isEnglish()
Determine if the paired data is in English units.
|
boolean |
isMetric()
Determine if the paired data is in metric (SI) units.
|
boolean |
isValid(int index)
Determine if the data value at the array location
index
in the current paired data set is valid ( okay or not missing ). |
HecMath |
log()
Create a new paired data set with y-values computed from the natural log of the
current paired data y-values.
|
HecMath |
log10()
Create a new paired data set with y-values computed from the log base 10 of the
current paired data y-values.
|
HecMath |
mergePairedDataSets(HecMath _pdMath)
Merge two paired data sets.
|
TimeSeriesMath |
modifiedPulsRouting(TimeSeriesMath tsMath,
int numberSubreaches,
double muskingumX)
Use the storage-discharge function in the current paired data set to route
the regular interval time series
tsMath by the Modified Puls
hydrologic routing method. |
HecMath |
multiply(double constant)
Multiply the y-values in current paired data set by a constant value.
|
HecMath |
multiply(HecMath math) |
PairedDataMath |
pairedDataOps(boolean reorder,
int resample,
boolean swapXY,
int[] deleteCurves,
int switchXY) |
TimeSeriesMath |
polynomialTransformation(TimeSeriesMath tsMath)
Compute a polynomial transformation of
tsMath
using the polynomial coefficients defined in the current
paired data set. |
TimeSeriesMath |
polynomialTransformationWithIntegral(TimeSeriesMath tsMath)
Compute a polynomial transformation with integral of
tsMath
using the polynomial coefficients defined in the current
paired data set. |
double |
rate(double indVal)
Finds the dependent value for a single independent value.
|
double[] |
rate(double[] indVals)
Finds multiple dependent values for multiple single independent values.
|
double[] |
rate(double[][] indVals)
Finds multiple dependent values for multiple sets of independent values.
|
double[] |
rate(long[] valTimes,
double[] indVals)
Finds multiple dependent values for multiple single independent and times.
|
double[] |
rate(long[] valTimes,
double[][] indVals)
Finds multiple dependent values for multiple sets of independent values and times.
|
double |
rate(long valTime,
double indVal)
Finds the dependent value for a single independent value at a specified time.
|
double[] |
rate(long valTime,
double[] indVals)
Finds multiple dependent values for multiple single independent values at a specified time.
|
double[] |
rate(long valTime,
double[][] indVals)
Finds multiple dependent values for multiple sets of independent values at a specified time.
|
TimeSeriesContainer |
rate(TimeSeriesContainer tsc)
Rates the values in the specified TimeSeriesContainer to generate a resulting TimeSeriesContainer.
|
TimeSeriesContainer |
rate(TimeSeriesContainer[] tscs)
Rates the values in the specified TimeSeriesContainer objects to generate a resulting TimeSeriesContainer.
|
TimeSeriesMath |
rate(TimeSeriesMath tsm)
Rates the values in the specified TimeSeriesMath to generate a resulting TimeSeriesMath.
|
TimeSeriesMath |
rate(TimeSeriesMath[] tsms)
Rates the values in the specified TimeSeriesMath objects to generate a resulting TimeSeriesMath.
|
double |
rateOne(double... indVals)
Finds the dependent value for a set of independent values.
|
double |
rateOne(long valTime,
double... indVals)
Finds the dependent value for a set of independent values.
|
double |
rateOne2(double[] indVals)
Finds the dependent value for a set of independent values.
|
double |
rateOne2(long valTime,
double[] indVals)
Finds the dependent value for a set of independent values.
|
TimeSeriesMath |
ratingTableInterpolation(TimeSeriesMath tsMath)
Use the rating table in the current paired data set to develop a new time
series from the rating table interpolation of
tsMath. |
HecMath |
replaceSpecificValues(HecDouble from,
HecDouble to) |
void |
resetDefaultValuetime()
Resets the default value time.
|
void |
resetRatingTime()
Resets (un-sets) the rating time.
|
double |
reverseRate(double depVal)
Finds the independent value for a single independent value.
|
double[] |
reverseRate(double[] depVals)
Finds multiple independent values for multiple single independent values.
|
double[] |
reverseRate(long[] valTimes,
double[] depVals)
Finds multiple independent values for multiple single independent and times.
|
double |
reverseRate(long valTime,
double depVal)
Finds the independent value for a single independent value at a specified time.
|
double[] |
reverseRate(long valTime,
double[] depVals)
Finds multiple independent values for multiple single independent values at a specified time.
|
TimeSeriesContainer |
reverseRate(TimeSeriesContainer tsc)
Rates the values in the specified TimeSeriesContainer to generate a resulting TimeSeriesContainer.
|
TimeSeriesMath |
reverseRate(TimeSeriesMath tsm)
Rates the values in the specified TimeSeriesMath to generate a resulting TimeSeriesMath.
|
TimeSeriesMath |
reverseRatingTableInterpolation(TimeSeriesMath tsMath)
Use the rating table in the current paired data set to develop a new time
series from the reverse rating table interpolation of
tsMath. |
HecMath |
round()
Create a new paired data set with the current paired data y-values
rounded to the nearest whole number.
|
HecMath |
roundOff(int digitsPrecision,
int powerOfTensPlace)
Derive a new paired data set with y-values rounded to the specified
precision and/or power of tens place.
|
void |
setCurve(int curveNumber)
Select, by curve number, the paired data curve for performing subsequent
arithmetic operations or math functions.
|
void |
setCurve(java.lang.String curveName)
Select, by curve label, the paired data curve for performing subsequent
arithmetic operations or math functions.
|
void |
setData(DataContainer container)
Set the PairedDataContainer data for the current PairedDataMath object.
|
void |
setDataUnits(java.lang.String[] units)
Sets the data ratingUnits.
|
void |
setDefaultValueTime(long defaultValueTime)
Sets the default value time.
|
void |
setName(java.lang.String name)
Sets the name of the rating
|
void |
setRatingTime(long ratingTime)
Sets the rating time.
|
void |
setUnits(java.lang.String unitsString)
Set the y-units label for the paired data set.
|
HecMath |
sin()
Create a new paired data set with y-values computed from the sine of the
current paired data y-values.
|
HecMath |
sqrt()
Create a new paired data set with y-values computed from the square root of the
current paired data y-values.
|
HecMath |
subtract(double constant)
Subtract a constant value from the y-values in current paired data set.
|
HecMath |
subtract(HecMath math) |
HecMath |
tan()
Create a new paired data set with y-values computed from the tangent of the
current paired data y-values.
|
PairedDataMath |
translateXY() |
HecMath |
truncate()
Create a new paired data set with the current paired data y-values
truncated to whole numbers.
|
TimeSeriesMath |
twoVariableRatingTableInterpolation(TimeSeriesMath tsMathX,
TimeSeriesMath tsMathZ)
Use the current paired data set to create a new time series by the
two-variable rating table interpolation of the time series
tsMathX and
tsMathZ. |
accumulation, applyMultipleLinearRegression, centeredMovingAverage, checkContainer, convertToIrregular, correlationCoefficients, createInstance, createInstance, cyclicAnalysis, decayingBasinWetnessParameter, durationAnalysis, durationAnalysis, durationAnalysis, durationAnalysis, estimateForMissingPrecipValues, estimateForMissingValues, extractTimeSeriesDataForTimeSpecification, flowAccumulatorGageProcessor, forwardMovingAverage, generateDataPairs, generateRegularIntervalTimeSeries, generateRegularIntervalTimeSeries, generateRegularIntervalTimeSeries, getPath, interpolateDataAtRegularInterval, isMissing, isValid, kurtosisCoefficient, lastValidDate, lastValidValue, max, maxDate, mean, med, mergeTimeSeries, min, minDate, mode, modifiedPulsRouting, multipleLinearRegression, multipleRegression, muskingumRouting, numberMissingValues, numberValidValues, olympicSmoothing, p1, p10, p2, p20, p25, p5, p75, p80, p90, p95, p98, p99, periodConstants, polynomialTransformation, polynomialTransformationWithIntegral, ratingTableInterpolation, reverseRatingTableInterpolation, roundOffValue, screenWithForwardMovingAverage, screenWithMaxMin, screenWithMaxMin, setDPart, setEPart, setLocation, setParameterPart, setPathname, setTimeInterval, setVersion, setWatershed, shiftAdjustment, shiftInTime, skewCoefficient, snapToRegularInterval, standardDeviation, straddleStaggerRouting, successiveDifferences, sum, timeDerivative, transformTimeSeries, transformTimeSeries, transformTimeSeries, transformTimeSeries, twoVariableRatingTableInterpolationpublic void setData(DataContainer container) throws HecMathException
container.setData in class HecMaththe - PairedDataContainer data to be used by this PairedDataMath object.HecMathException - if container is null or not of type
PairedDataContainer.public void getData(DataContainer container) throws HecMathException
container.getData in class HecMaththe - PairedDataContainer to receive the copy of paired data from
this PairedDataMath object.HecMathExceptionpublic DataContainer getData() throws HecMathException
container.getData in class HecMathHecMathExceptionpublic void setCurve(java.lang.String curveName)
throws HecMathException
A paired data set may contains more than one set of y-values. However, a user may
wish to modify only one curve of the data set. For example, using the function
"add( 2.0 )" would by default add 2.0 to all y-values for all curves.
setCurve can be used to limit the operation to just one selected
set of y-values.
The function searches the paired data set list of curve labels
for a match to curveName. If a match is found, that curve
is set as the selected curve.
setCurve in class HecMathcurveNumber - the curve label to set as the selected curve.HecMathExceptionsetCurve( int )public void setCurve(int curveNumber)
throws HecMathException
A paired data set may contains more than one set of y-values. However, a user may
wish to modify only one curve of the data set. For example, using the function
"add( 2.0 )" would by default add 2.0 to all y-values for all curves.
setCurve can be used to limit the operation to just one selected
set of y-values.
The active curve is set to curveNumber. Curve numbering
with 0. To set all curve active, set curveNumber to -1. By
default, all curves are set active.
setCurve in class HecMathcurveNumber - the selected curve numberHecMathExceptionsetCurve( String )public int getSelectedCurve()
getSelectedCurve in class HecMathpublic HecMath add(HecMath math) throws HecMathException
add in class HecMathHecMathExceptionpublic HecMath subtract(HecMath math) throws HecMathException
subtract in class HecMathHecMathExceptionpublic HecMath divide(HecMath math) throws HecMathException
divide in class HecMathHecMathExceptionpublic HecMath multiply(HecMath math) throws HecMathException
multiply in class HecMathHecMathExceptionpublic HecMath add(double constant) throws HecMathException
add in class HecMathconstant - the value to be added to the y-values in the
current paired data set.HecMathExceptionsetCurve(int),
setCurve(String)public HecMath subtract(double constant) throws HecMathException
subtract in class HecMathconstant - the value to be subtracted from the y-values in the
current paired data set.HecMathExceptionsetCurve(int),
setCurve(String)public HecMath multiply(double constant) throws HecMathException
multiply in class HecMathconstant - the value to multiply the y-values in the
current paired data set.HecMathExceptionsetCurve(int),
setCurve(String)public HecMath divide(double constant) throws HecMathException
divide in class HecMathconstant - the value to divide the y-values in the
current paired data set.HecMathExceptionsetCurve(int),
setCurve(String)public HecMath replaceSpecificValues(HecDouble from, HecDouble to) throws HecMathException
replaceSpecificValues in class HecMathHecMathExceptionpublic HecMath exponentiation(double constant) throws HecMathException
constant.exponentiation in class HecMathconstant - the exponent value.HecMathExceptionsetCurve(int),
setCurve(String)public HecMath sqrt() throws HecMathException
sqrt in class HecMathHecMathExceptionsetCurve(int),
setCurve(String)public HecMath log() throws HecMathException
log in class HecMathHecMathExceptionsetCurve(int),
setCurve(String)public HecMath log10() throws HecMathException
log10 in class HecMathHecMathExceptionpublic HecMath abs() throws HecMathException
abs in class HecMathHecMathExceptionpublic HecMath truncate() throws HecMathException
truncate in class HecMathHecMathExceptionsetCurve(int),
setCurve(String)public HecMath round() throws HecMathException
round in class HecMathHecMathExceptionpublic HecMath sin() throws HecMathException
sin in class HecMathHecMathExceptionpublic HecMath cos() throws HecMathException
cos in class HecMathHecMathExceptionsetCurve(int),
setCurve(String)public HecMath tan() throws HecMathException
tan in class HecMathHecMathExceptionpublic HecMath inverse() throws HecMathException
inverse in class HecMathHecMathExceptionpublic 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 = 1roundOff in class HecMathdigitsPrecision - Number of digits of precision, between 1 and 8.powerOfTensPlace - Magnitude of ten to round to.HecMathExceptionpublic 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 different data sets 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 HecMath mergePairedDataSets(HecMath _pdMath) throws HecMathException
Will derive a new paired data set by merging curves in the current and
parameter, pdMath, paired data sets.
The x-ordinate values for the two data sets must be identical. Curve(s)
from pdMath are appended on to the set of curves in the current
paired data set. Either one selected curve or all curves from pdMath
are copied over to the new paired data set. Use setCurve( int ) or
setCurve( String ) to select the curve in pdMath for merging.
The selection status can be checked with getSelectedCurve().
mergePairedDataSets in class HecMathpdMath - a paired data set for merging with the current paired data set.HecMathException - if x-ordinates for the two paired data sets are not identical.public TimeSeriesMath conicInterpolation(HecMath tsMath, java.lang.String inputType, java.lang.String outputType, double storageScaleFactor) throws HecMathException
tsMath.The paired data set represents a table of Elevation-Area. However, the first paired data values contain the initial conic depth and the storage for the first elevation in the table. If the initial conic depth is undefined, the function will calculate a value. Elevation-Area values in the table are in ascending order.
tsMath is either a time series of reservoir elevation or storage,
and is specified by setting inputType as "S(TORAGE)" or
"E(LEVATION)". The desired output time series type is similarly
set using outputType. The valid settings for
outType are "S(TORAGE)", "E(LEVATION)" and "A(REA)".
inputType and outputType must not be the same.
storageScaleFactor is an optional parameter used to scale
input (by multiplying) and output (by dividing) storage values.
For example, if the area in the conic interpolation table is expressed in sq.ft.,
storageScaleFactor could be set to 43560 to convert
the storage output to acre-ft.
Parameter type in the new time series is set according to outputType.
If the output time series values are elevation, the time series units are set to
the paired data x-units label. If the output time series values are area
the time series units are set to the paired data y-units label. If the
output is storage, the units are not set and should be set by the user with
the setUnits function.
conicInterpolation in class HecMathtsMath - the input time series of elevation or storage.inputType - parameter type for input time series, "S(TORAGE)" or "E(LEVATION)".outputType - parameter type for output time series, "S(TORAGE)", "E(LEVATION)",
or "A(REA)".HecMathException - if outType or outputType are
not correctly defined.TimeSeriesMath.setUnits( String )public TimeSeriesMath ratingTableInterpolation(TimeSeriesMath tsMath) throws HecMathException
tsMath.
The rating table may be Log-Log.
The paired data set should be created with the rating table option to
set values for datum, shift, and offset in
PairedDataContainer. By default these values are 0.0.
The shift is added to, and the datum subtracted from all input time
series values. If the rating table is Log-Log, the table x-values are
adjusted by subtracting the offset.
Units and parameter type in the new time series are set to the y-units label
and parameter type of the current paired data set. All other names and labels
are copied over from tsMath.
tsMath - the input time series for rating table interpolation.HecMathExceptionpublic TimeSeriesMath reverseRatingTableInterpolation(TimeSeriesMath tsMath) throws HecMathException
tsMath.
The rating table may be Log-Log.
The paired data set should be created with the rating table option to
set values for datum, shift, and offset in
PairedDataContainer. By default these values are 0.0.
The shift is subtracted from, and the datum added to all input time
series values. If the rating table is Log-Log, the table x-values are
adjusted by subtracting the offset.
Units and parameter type in the new time series are set to the x-units label
and parameter type of the current paired data set. All other names and labels
are copied over from tsMath.
tsMath - the input time series for reverse rating table interpolation.HecMathExceptionpublic PairedDataMath translateXY() throws HecMathException
HecMathExceptionpublic PairedDataMath interpolate(double[] xarray, boolean linear, boolean doExtrapolation) throws HecMathException
xarray - double[]linear - booleandoExtrapolation - booleanHecMathExceptionpublic TimeSeriesMath twoVariableRatingTableInterpolation(TimeSeriesMath tsMathX, TimeSeriesMath tsMathZ) throws HecMathException
tsMathX and
tsMathZ. For two-variable rating table interpolation, the
current paired data set should have more than one curve (multiple sets of y-values).
The labels of the paired data curves are interpreted as values for interpolating
values of tsMathZ.
In performing the double interpolation, two bounding curves (using the
label values of the curves) of the paired data set are found which bracket
the time series value from tsMathZ. Interpolation between the
curves is done at the x-oridinate location defined by the time series value
from tsMathX.
No extrapolation is performed. If time series values from tsMathX or
tsMathZ are outside the range bounded by the paired data, the
new time series value is set to missing.
Units and paramter type in the new time series are set to the y-units label and
parameter of the current paired data set. All other names and labels are copied over
from tsMathX.
tsMathX - input time series interpreted as x-ordinate valuestsMathZ - input time series interpreted as z-ordinate values,
(value defined by the paired data curve labels).HecMathException - if tsMathX and tsMathZ are
not for identical times.public TimeSeriesMath polynomialTransformation(TimeSeriesMath tsMath) throws HecMathException
tsMath
using the polynomial coefficients defined in the current
paired data set. A new time series is computed using the
polynomial coefficients, Bn, and the input time series, tsIn, according to:
tsNew(i) = B1*tsIn(i) + B2*tsIn(i)**2 + ... + Bn*tsIn(i)**n
Before the above equation is applied, values in tsIn are first adjusted by subtracting
off the datum value for the paired data set (see PairedDataContainer).
If a value in the input time series is missing, the value remains missing in the
new time series.
The units label and parameter type in the new time series are the same as in tsMath.
tsMath - the input time series.tsMath.HecMathExceptionTimeSeriesMath.setUnits( String )public TimeSeriesMath polynomialTransformationWithIntegral(TimeSeriesMath tsMath) throws HecMathException
tsMath
using the polynomial coefficients defined in the current
paired data set. A new time series is computed using the
polynomial coefficients, Bn, and the input time series, tsIn, according to:
tsNew(i) = (B1/2)*tsIn(i)**2 + (B2/3)*tsIn(i)**3 + ... + (Bn/(n+1))*tsIn(i)**(n+1)
Before the above equation is applied, values in tsIn are first adjusted by subtracting
off the datum value for the paired data set (see PairedDataContainer).
If a value in the input time series is missing, the value remains missing in the
new time series.
The units label and parameter type in the new time series are the same as in tsMath.
tsMath - the input time series.tsMath.HecMathExceptionTimeSeriesMath.setUnits( String )public TimeSeriesMath applyMultipleLinearRegression(java.lang.String startTimeString, java.lang.String endTimeString, TimeSeriesMath[] tsMathArray, double minimumLimit, double maximumLimit) throws HecMathException
tsMathArray to develop a new time series.The regression coefficients can be used to generate a new regular interval time series based on the general linear regression equation:
tsNew(i) = B0 + B1*TS1(i) + B2*TS2(i) + B3*TS3(i) ...
where Bn are the set of regression coefficients and TSn are the time series contained
in tsMathArray.
Typically the regression coefficients are developed using the function,
TimeSeriesMath.multipleRegression( HecMath[] tsMathArray, double minimumLimit, double maximumLimit ).
To correctly construct the new time series, the time series in tsMathArray
must be in the same order as in the call to TimeSeriesMath.multipleRegression()
so that the right regression coefficient is applied to the right time series.
The time series in tsMathArray 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, the value in the new time series is set to missing. If the computed
time series value is less than minimumLimit or greater than
maximumLimit the value is reset to missing.
Names, parameter type and unit labels for the new time series are copied over from
the first time series in tsMathArray. The "Version" in the new
time series is set to "COMPUTED".
tsMathArray - an array of time series objects.minimumLimit - set to missing values in the new time series
if the computed value is below this limit.
Set to HecMath.UNDEFINED to disable this option.maximumLimit - set to missing values in the new time series
if the computed value is above this limit.
Set to HecMath.UNDEFINED to disable this option.tsMathArray.HecMathException - if the time series in tsMathArray
are not regular interval time series, all with the same time interval,
or if there is no concurrent data between the time series; or if
the number of regression coefficients in not equal to the number of time
series + 1.TimeSeriesMath.multipleRegression( HecMath[], double, double )public TimeSeriesMath modifiedPulsRouting(TimeSeriesMath tsMath, int numberSubreaches, double muskingumX) throws HecMathException
tsMath by the Modified Puls
hydrologic routing method.tsMath - the time series for routing.numberSubreaches - Number of routing subreaches.muskingumX - Muskingum "X" parameter, between 0.0 and 0.5.HecMathException - If tsMath is not a regular interval time series, or
if values for numberSubreaches or muskingumX are invalid;
or if the current paired data set is not a storage-flow table
with ascending x and y values.public PairedDataMath pairedDataOps(boolean reorder, int resample, boolean swapXY, int[] deleteCurves, int switchXY) throws HecMathException
HecMathExceptionpublic static boolean checkPairedData(PairedDataContainer pdc) throws HecMathException
pdc to ensure that
there is data.pdc - the hec.io.PairedDataContainer for testing.pdc is not empty.HecMathException - if pdc is empty or contains no valid data.PairedDataContainerpublic static boolean checkPairedDataCurve(PairedDataContainer pdc, int curveNumber) throws HecMathException
pdc to
ensure that data is available for the curve curveNumber.pdc - the hec.io.TimeSeriesContainer for testing.curveNumber.HecMathException - if there is no data for curveNumber.PairedDataContainerpublic boolean isValid(int index)
index
in the current paired data set is valid ( okay or not missing ).
If the paired data set is comprised of more than one
y-value curve, the selected curve number must first be set.isValid in class HecMathindex - the array index of the value of interest.index
is valid ( is okay or not missing ), otherwise false.setCurve( int ),
setCurve( String )public HecMath copy() throws HecMathException
copy in class HecMathHecMathExceptionpublic java.lang.String getName()
hec.data.IRatinggetName in interface hec.data.IRatingpublic void setName(java.lang.String name)
throws hec.data.RatingException
hec.data.IRatingsetName in interface hec.data.IRatingname - The new name of the ratinghec.data.RatingExceptionpublic java.lang.String[] getRatingParameters()
hec.data.IRatinggetRatingParameters in interface hec.data.IRatingpublic java.lang.String[] getRatingUnits()
hec.data.IRatinggetRatingUnits in interface hec.data.IRatingpublic java.lang.String[] getDataUnits()
hec.data.IRatinggetDataUnits in interface hec.data.IRatingpublic void setDataUnits(java.lang.String[] units)
throws hec.data.RatingException
hec.data.IRatingsetDataUnits in interface hec.data.IRatinghec.data.RatingExceptionpublic long getDefaultValueTime()
hec.data.IRatinggetDefaultValueTime in interface hec.data.IRatingpublic void setDefaultValueTime(long defaultValueTime)
hec.data.IRatingsetDefaultValueTime in interface hec.data.IRatingdefaultValueTime - The default value time in Java millisecondspublic void resetDefaultValuetime()
hec.data.IRatingresetDefaultValuetime in interface hec.data.IRatingpublic long getRatingTime()
hec.data.IRatinggetRatingTime in interface hec.data.IRatingpublic void setRatingTime(long ratingTime)
hec.data.IRatingsetRatingTime in interface hec.data.IRatingratingTime - The rating time in Java millisecondspublic void resetRatingTime()
hec.data.IRatingresetRatingTime in interface hec.data.IRatingpublic double rate(double indVal)
throws hec.data.RatingException
hec.data.IRatingrate in interface hec.data.IRatingindVal - The independent value to rate.hec.data.RatingExceptionpublic double rateOne(double... indVals)
throws hec.data.RatingException
hec.data.IRatingrateOne in interface hec.data.IRatingindVals - The independent parameters to ratehec.data.RatingExceptionpublic double rateOne2(double[] indVals)
throws hec.data.RatingException
hec.data.IRatingrateOne2 in interface hec.data.IRatingindVals - The independent parameters to ratehec.data.RatingExceptionpublic double[] rate(double[] indVals)
throws hec.data.RatingException
hec.data.IRatingrate in interface hec.data.IRatingindVals - The independent values to ratehec.data.RatingExceptionpublic double[] rate(double[][] indVals)
throws hec.data.RatingException
hec.data.IRatingrate in interface hec.data.IRatingindVals - The independent values to rate. Each set of independent values must be the same length.hec.data.RatingExceptionpublic double rate(long valTime,
double indVal)
throws hec.data.RatingException
hec.data.IRatingrate in interface hec.data.IRatingvalTime - The time associated with the value to rate, in Java millisecondsindVal - The independent value to ratehec.data.RatingExceptionpublic double rateOne(long valTime,
double... indVals)
throws hec.data.RatingException
hec.data.IRatingrateOne in interface hec.data.IRatingvalTime - The time associated with the set of value to rate, in Java millisecondsindVals - The independent parameters to ratehec.data.RatingExceptionpublic double rateOne2(long valTime,
double[] indVals)
throws hec.data.RatingException
hec.data.IRatingrateOne2 in interface hec.data.IRatingvalTime - The time associated with the set of value to rate, in Java millisecondsindVals - The independent parameters to ratehec.data.RatingExceptionpublic double[] rate(long valTime,
double[] indVals)
throws hec.data.RatingException
hec.data.IRatingrate in interface hec.data.IRatingvalTime - The time associated with the values to rate, in Java millisecondsindVals - The independent values to ratehec.data.RatingExceptionpublic double[] rate(long[] valTimes,
double[] indVals)
throws hec.data.RatingException
hec.data.IRatingrate in interface hec.data.IRatingvalTimes - The times associated with the values to rate, in Java millisecondsindVals - The independent values to ratehec.data.RatingExceptionpublic double[] rate(long valTime,
double[][] indVals)
throws hec.data.RatingException
hec.data.IRatingrate in interface hec.data.IRatingvalTime - The time associated with the values to rate, in Java millisecondsindVals - The independent values to rate. Each set of independent values must be the same length.hec.data.RatingExceptionpublic double[] rate(long[] valTimes,
double[][] indVals)
throws hec.data.RatingException
hec.data.IRatingrate in interface hec.data.IRatingvalTimes - The time associated with the values to rate, in Java millisecondsindVals - The independent values to rate. Each set of independent values must be the same length.hec.data.RatingExceptionpublic TimeSeriesContainer rate(TimeSeriesContainer tsc) throws hec.data.RatingException
hec.data.IRatingrate in interface hec.data.IRatingtsc - The TimeSeriesContainer of independent values.hec.data.RatingExceptionpublic TimeSeriesContainer rate(TimeSeriesContainer[] tscs) throws hec.data.RatingException
hec.data.IRatingrate in interface hec.data.IRatingtscs - The TimeSeriesContainers of independent values, one for each independent parameter.hec.data.RatingExceptionpublic TimeSeriesMath rate(TimeSeriesMath tsm) throws hec.data.RatingException
hec.data.IRatingrate in interface hec.data.IRatingtsm - The TimeSeriesMath of independent values.hec.data.RatingExceptionpublic TimeSeriesMath rate(TimeSeriesMath[] tsms) throws hec.data.RatingException
hec.data.IRatingrate in interface hec.data.IRatingtsms - The TimeSeriesMaths of independent values, one for each independent parameter.hec.data.RatingExceptionpublic double reverseRate(double depVal)
throws hec.data.RatingException
hec.data.IRatingreverseRate in interface hec.data.IRatingdepVal - The dependent value to rate.hec.data.RatingExceptionpublic double[] reverseRate(double[] depVals)
throws hec.data.RatingException
hec.data.IRatingreverseRate in interface hec.data.IRatingdepVals - The dependent values to ratehec.data.RatingExceptionpublic double reverseRate(long valTime,
double depVal)
throws hec.data.RatingException
hec.data.IRatingreverseRate in interface hec.data.IRatingvalTime - The time associated with the value to rate, in Java millisecondsdepVal - The dependent value to ratehec.data.RatingExceptionpublic double[] reverseRate(long valTime,
double[] depVals)
throws hec.data.RatingException
hec.data.IRatingreverseRate in interface hec.data.IRatingvalTime - The time associated with the values to rate, in Java millisecondsdepVals - The dependent values to ratehec.data.RatingExceptionpublic double[] reverseRate(long[] valTimes,
double[] depVals)
throws hec.data.RatingException
hec.data.IRatingreverseRate in interface hec.data.IRatingvalTimes - The times associated with the values to rate, in Java millisecondsdepVals - The dependent values to ratehec.data.RatingExceptionpublic TimeSeriesContainer reverseRate(TimeSeriesContainer tsc) throws hec.data.RatingException
hec.data.IRatingreverseRate in interface hec.data.IRatingtsc - The TimeSeriesContainer of dependent values.hec.data.RatingExceptionpublic TimeSeriesMath reverseRate(TimeSeriesMath tsm) throws hec.data.RatingException
hec.data.IRatingreverseRate in interface hec.data.IRatingtsm - The TimeSeriesMath of dependent values.hec.data.RatingExceptionpublic int getIndParamCount()
throws hec.data.RatingException
hec.data.IRatinggetIndParamCount in interface hec.data.IRatinghec.data.RatingExceptionpublic double[][] getRatingExtents()
throws hec.data.RatingException
hec.data.IRatinggetRatingExtents in interface hec.data.IRatinghec.data.RatingExceptionpublic double[][] getRatingExtents(long ratingTime)
throws hec.data.RatingException
hec.data.IRatinggetRatingExtents in interface hec.data.IRatingratingTime - The time to use in determining the rating extentshec.data.RatingExceptionpublic long[] getEffectiveDates()
hec.data.IRatinggetEffectiveDates in interface hec.data.IRatingpublic long[] getCreateDates()
hec.data.IRatinggetCreateDates in interface hec.data.IRating