Package hec.model
Interface TSRecord
- All Known Subinterfaces:
LocalTSRecord
- All Known Implementing Classes:
AbstractTSRecord
public interface TSRecord
Maps a time series location to a DSS record.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptiondouble
average
(int step, int period) Calculates the period average for the values in the data starting atstep
and going backperiod
, if the value is negative or forwardperiod
, if the value is positive.boolean
int
int
double
getCumulativeTotal
(int step, int period) get the cumulative total starting atstep
and going backperiod
steps.double
getCumulativeTotal
(RunTimeStep rts, int period) get the cumulative total starting atrts
and going backperiod
steps.double
return the value for the current runtime stepdouble[]
getDataArrayFor
(int step, int period) Returns the values for the data starting atstep
and either going backperiod
steps if the value is negative or forward if the value is positive.default double
int
getIndex()
int
double[]
getInterpolatedTSArray
(HecTime startTime, HecTime endTime, int intervalTime) Interpolate time series data for a regular size time interval "intervalTime" in minutesdouble
getLaggedValue
(RunTimeStep rts, int lagAmount) get the value at current runtime step minus the lag amountgetName()
int
double
getPeriodAverage
(int step, int period) get the Period Average starting atRunTimeStep
and going backperiod
stepsdouble
getPeriodAverage
(RunTimeStep rts, int period) get the Period Average starting atRunTimeStep
and going backperiod
stepsdouble
get the value previous to the current runtime stepdouble[]
int[]
get the TimeSeriesContainer for the TSRecord.getTimeSeriesContainerFor
(int step, int period) Creates a TimeSeriesContainer filled with data from the TSRecord starting atstep
and going forward, if
period
is positive, or backwards, ifperiod
is negative.int
double[]
Get the data array for the time series record.double
getTSValueAt
(HecTime time) getUnits()
double
getValue
(int step) get the value at stepdouble
get the value at the given HecTimeint
boolean
initialize
(int beginDate, int beginTime, int timeStepMin, int numSteps, String timeWindow) boolean
initialize
(RunTimeWindow rtw) boolean
default boolean
isInput()
boolean
boolean
boolean
boolean
boolean
loadTSData
(HecTime startTime, HecTime endTime) double
max
(int step, int period) Finds the maximum value in the data starting atstep
and going backperiod
, if the value is negative or forwardperiod
, if the value is positive.double
min
(int step, int period) Finds the minimum value in the data set starting atstep
and going backperiod
, if the value is negative or forwardperiod
, if the value is positive.boolean
readData
(BufferedReader input) Read write methods for storing TSRecords to an ASCII fileboolean
readDataFromRas
(BufferedReader input) boolean
void
reset()
void
setCompressData
(boolean compress) void
setCurrentValue
(int step, double value) set the value at the current run time stepvoid
setCurrentValue
(RunTimeStep rts, double value) set the value at the current run time stepvoid
setDSSFilename
(String fileName) void
setDSSPathname
(String pathname) void
setDSSPathname
(String[] parts) void
setIndex
(int idx) default void
setInput
(boolean isinput) void
setInputDataPos
(int inputPos) void
setInterpUnitsType
(String type) void
void
setParamName
(String name) void
setTimeWindow
(HecTime start, HecTime end) void
setTimeWindowString
(String timestr) void
void
setUnitsType
(String units) void
setVariableId
(int varid) void
void
shiftLeft
(RunTimeWindow rtw) double
standardDeviation
(int step, int period) Calculate the standard deviation of the time series values starting atstep
and either going backperiod
steps if the value is negative or forward if the value is positive.double
sum
(int step, int period) Calculates the sum for the values in the data starting atstep
and going backperiod
, if the value is negative or forwardperiod
, if the value is positive.boolean
writeData
(BufferedWriter out) boolean
boolean
boolean
writeTSDataAs
(String pathname, String interpUnitType)
-
Field Details
-
OBS_INPUT
static final int OBS_INPUT- See Also:
-
DEFAULT_INPUT
static final int DEFAULT_INPUT- See Also:
-
SUMMARY_AVG
static final int SUMMARY_AVG- See Also:
-
SUMMARY_MIN
static final int SUMMARY_MIN- See Also:
-
SUMMARY_MAX
static final int SUMMARY_MAX- See Also:
-
SUMMARY_CNT
static final int SUMMARY_CNT- See Also:
-
SUMMARY_NUMID
static final int SUMMARY_NUMID- See Also:
-
-
Method Details
-
setIndex
void setIndex(int idx) -
getIndex
int getIndex() -
getName
String getName() -
setName
-
getParamName
String getParamName() -
setParamName
-
getDSSFilename
String getDSSFilename() -
setDSSFilename
-
getDSSPathname
String getDSSPathname() -
setDSSPathname
-
setDSSPathname
-
getUnits
String getUnits() -
getUnitsType
String getUnitsType() -
setUnits
-
setUnitsType
-
getInterpUnitsType
String getInterpUnitsType() -
setInterpUnitsType
-
getBeginDate
int getBeginDate() -
getBeginTime
int getBeginTime() -
getTimeStepMinutes
int getTimeStepMinutes() -
getTimeWindowString
String getTimeWindowString() -
getNumSteps
int getNumSteps() -
isDefaultData
boolean isDefaultData() -
isObservedData
boolean isObservedData() -
getInputDataPos
int getInputDataPos() -
setInputDataPos
void setInputDataPos(int inputPos) -
getPeriodAverage
get the Period Average starting atRunTimeStep
and going backperiod
steps- Parameters:
rts
- the RunTimeStepperiod
- the period to go back- Returns:
- the period average of rts.step - period
-
getPeriodAverage
double getPeriodAverage(int step, int period) get the Period Average starting atRunTimeStep
and going backperiod
steps- Parameters:
step
- the starting stepperiod
- the number of steps to go back.- Returns:
- the period average of step - period
-
getPreviousValue
get the value previous to the current runtime step- Parameters:
rts
- the RunTimeStep- Returns:
- the value one step back (rts.step-1)
-
setCurrentValue
set the value at the current run time step- Parameters:
rts
- the RunTimeStepvalue
- the value to set
-
setCurrentValue
void setCurrentValue(int step, double value) set the value at the current run time step- Parameters:
step
- the index into the data arrayvalue
- the value to set
-
getCurrentValue
return the value for the current runtime step- Parameters:
rts
- the RunTimeStep- Returns:
- the value at RunTimeStep.step
-
getValue
double getValue(int step) get the value at step- Parameters:
step
- the index into the data array- Returns:
- the value at step
-
getLaggedValue
get the value at current runtime step minus the lag amount- Parameters:
rts
- the RunTimeWindowlagAmount
- the lag amount- Returns:
- the value at rts.step-lagAmount
-
getValue
get the value at the given HecTime- Parameters:
time
- the HecTime for which data will be retrieved- Returns:
- the value at step
-
getTSValueAt
-
getCumulativeTotal
get the cumulative total starting atrts
and going backperiod
steps.- Parameters:
rts
- the RunTimeStepperiod
- the number of steps to go back- Returns:
- the cumulative total of rts.step - period
-
getCumulativeTotal
double getCumulativeTotal(int step, int period) get the cumulative total starting atstep
and going backperiod
steps.- Parameters:
step
- the starting stepperiod
- the number of steps to go back- Returns:
- the cumulative total of step - period
-
getTimeArray
int[] getTimeArray() -
getTSArray
double[] getTSArray()Get the data array for the time series record.- Returns:
- double array containing all data values for record
-
getTSContainer
doubleArrayContainer getTSContainer() -
getTimeSeriesContainer
TimeSeriesContainer getTimeSeriesContainer()get the TimeSeriesContainer for the TSRecord. The TimeSeriesContainer and the TSRecord share the same underlying data model so changes in the data or times in one are reflected in the other. the TimeSeriesContainer will have no quality.- Returns:
- the TimeSeriesContainer
-
getSummaryArray
double[] getSummaryArray() -
writeTSData
boolean writeTSData() -
writeTSDataAs
-
loadTSData
boolean loadTSData() -
loadTSData
-
loadRawTSData
boolean loadRawTSData() -
checkTSData
boolean checkTSData() -
isValidValue
boolean isValidValue() -
shiftLeft
-
shiftLeft
-
setVariableId
void setVariableId(int varid) -
getVariableId
int getVariableId() -
setTimeWindow
-
setTimeWindowString
-
setCompressData
void setCompressData(boolean compress) -
getInterpolatedTSArray
Interpolate time series data for a regular size time interval "intervalTime" in minutes -
reset
void reset() -
initialize
-
initialize
-
reinitialize
-
readData
Read write methods for storing TSRecords to an ASCII file -
writeData
-
writeDataToRas
-
readDataFromRas
-
getDataArrayFor
double[] getDataArrayFor(int step, int period) Returns the values for the data starting atstep
and either going backperiod
steps if the value is negative or forward if the value is positive.- Parameters:
step
- the starting stepperiod
- the number of steps to go back if a negative number or forward is a positive number- Returns:
- double[] of the values for the given time span
-
max
double max(int step, int period) Finds the maximum value in the data starting atstep
and going backperiod
, if the value is negative or forwardperiod
, if the value is positive.- Parameters:
step
- , the starting stepperiod
- , the number of steps to go back if a negative number or forward is a positive number- Returns:
- the maximum value in the given time range
-
min
double min(int step, int period) Finds the minimum value in the data set starting atstep
and going backperiod
, if the value is negative or forwardperiod
, if the value is positive.- Parameters:
step
- , the starting stepperiod
- , the number of steps to go back if a negative number or forward is a positive number- Returns:
- the minimum value in the given time range
-
average
double average(int step, int period) Calculates the period average for the values in the data starting atstep
and going backperiod
, if the value is negative or forwardperiod
, if the value is positive. Does not include undefined or missing values.- Parameters:
step
- , the starting stepperiod
- , the number of steps to go back if a negative number or forward is a positive number- Returns:
- double the period average for the values in the given time range
-
sum
double sum(int step, int period) Calculates the sum for the values in the data starting atstep
and going backperiod
, if the value is negative or forwardperiod
, if the value is positive. Does not include undefined or missing values.- Parameters:
step
- , the starting stepperiod
- , the number of steps to go back if a negative number or forward is a positive number- Returns:
- double the total sum for the values in the given time range
-
standardDeviation
double standardDeviation(int step, int period) Calculate the standard deviation of the time series values starting atstep
and either going backperiod
steps if the value is negative or forward if the value is positive.- Parameters:
step
- , the starting stepperiod
- , the number of steps to go back if a negative number or forward is a positive number- Returns:
- double the sample standard deviation
-
getTimeSeriesContainerFor
Creates a TimeSeriesContainer filled with data from the TSRecord starting atstep
and going forward, if
period
is positive, or backwards, ifperiod
is negative.- Parameters:
step
- , the starting stepperiod
- , the number of steps to go back when a negative number or forward if a positive number
-
isInput
default boolean isInput() -
getFactor
default double getFactor() -
setInput
default void setInput(boolean isinput)
-