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 intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptiondoubleaverage(int step, int period) Calculates the period average for the values in the data starting atstepand going backperiod, if the value is negative or forwardperiod, if the value is positive.booleanintintdoublegetCumulativeTotal(int step, int period) get the cumulative total starting atstepand going backperiodsteps.doublegetCumulativeTotal(RunTimeStep rts, int period) get the cumulative total starting atrtsand going backperiodsteps.doublereturn the value for the current runtime stepdouble[]getDataArrayFor(int step, int period) Returns the values for the data starting atstepand either going backperiodsteps if the value is negative or forward if the value is positive.default doubleintgetIndex()intdouble[]getInterpolatedTSArray(HecTime startTime, HecTime endTime, int intervalTime) Interpolate time series data for a regular size time interval "intervalTime" in minutesdoublegetLaggedValue(RunTimeStep rts, int lagAmount) get the value at current runtime step minus the lag amountgetName()intdoublegetPeriodAverage(int step, int period) get the Period Average starting atRunTimeStepand going backperiodstepsdoublegetPeriodAverage(RunTimeStep rts, int period) get the Period Average starting atRunTimeStepand going backperiodstepsdoubleget 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 atstepand going forward, ifperiodis positive, or backwards, ifperiodis negative.intdouble[]Get the data array for the time series record.doublegetTSValueAt(HecTime time) getUnits()doublegetValue(int step) get the value at stepdoubleget the value at the given HecTimeintbooleaninitialize(int beginDate, int beginTime, int timeStepMin, int numSteps, String timeWindow) booleaninitialize(RunTimeWindow rtw) booleandefault booleanisInput()booleanbooleanbooleanbooleanbooleanloadTSData(HecTime startTime, HecTime endTime) doublemax(int step, int period) Finds the maximum value in the data starting atstepand going backperiod, if the value is negative or forwardperiod, if the value is positive.doublemin(int step, int period) Finds the minimum value in the data set starting atstepand going backperiod, if the value is negative or forwardperiod, if the value is positive.booleanreadData(BufferedReader input) Read write methods for storing TSRecords to an ASCII filebooleanreadDataFromRas(BufferedReader input) booleanvoidreset()voidsetCompressData(boolean compress) voidsetCurrentValue(int step, double value) set the value at the current run time stepvoidsetCurrentValue(RunTimeStep rts, double value) set the value at the current run time stepvoidsetDSSFilename(String fileName) voidsetDSSPathname(String pathname) voidsetDSSPathname(String[] parts) voidsetIndex(int idx) default voidsetInput(boolean isinput) voidsetInputDataPos(int inputPos) voidsetInterpUnitsType(String type) voidvoidsetParamName(String name) voidsetTimeWindow(HecTime start, HecTime end) voidsetTimeWindowString(String timestr) voidvoidsetUnitsType(String units) voidsetVariableId(int varid) voidvoidshiftLeft(RunTimeWindow rtw) doublestandardDeviation(int step, int period) Calculate the standard deviation of the time series values starting atstepand either going backperiodsteps if the value is negative or forward if the value is positive.doublesum(int step, int period) Calculates the sum for the values in the data starting atstepand going backperiod, if the value is negative or forwardperiod, if the value is positive.booleanwriteData(BufferedWriter out) booleanbooleanbooleanwriteTSDataAs(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 atRunTimeStepand going backperiodsteps- 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 atRunTimeStepand going backperiodsteps- 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 atrtsand going backperiodsteps.- 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 atstepand going backperiodsteps.- 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 atstepand either going backperiodsteps 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 atstepand 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 atstepand 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 atstepand 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 atstepand 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 atstepand either going backperiodsteps 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 atstepand going forward, ifperiodis positive, or backwards, ifperiodis 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)
-