Package hec.model
Class SeasonalPairedValues
java.lang.Object
hec.model.PairedValuesExt
hec.model.SeasonalPairedValues
- All Implemented Interfaces:
AsciiSerializable,FieldAccessor,Serializable,Cloneable
Extends the PairedValuesExt class to use the paired values curve labels to store
date/time
- See Also:
-
Field Summary
Fields inherited from class hec.model.PairedValuesExt
INTERP_CUBIC, INTERP_CUBIC_ID, INTERP_LINEAR, INTERP_LINEAR_ID, INTERP_STEP, INTERP_STEP_ID, INTERP_STRINGS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidempty data arrays ( but not _dataVectorclone()Creates a new object of the same class as this object.intfindTimeInterval(int rundate) find interval time for interpolationstatic StringgetDateString(int minutes) Convert a julian time ( minutes ) into a string of DDMMMgetFieldObject(Field fld) required AsciiSerialized method.intReturns the time zone that this data is defined for.static intgetJulianMinute(String dateStr) static intgetJulianMinute(String dateStr, int startYear) Return a PairedValues object developed from the first SeasonalPairedValues curveintgetTime(int id) returns the time at the specified array locationint[]intintgetYears()get the length of the seasonal record (years)booleanvoidinit()initialize the PairedValueExt object.doubleinterpolate(int interpTime, double xval) Interpolate in time and function x-valuedoubleinterpolate(HecTime htime, double xval) Interpolate in time and function x-valuedoubleinterpolate(RunTime runtime, double xval) Interpolate in time and function x-valuedoubleinterpolate(RunTimeStep runtime, double xval) Interpolate in time and function x-valuestatic voidprotected booleanbooleanresetWaterYearStart(String waterYearStart) voidscaleValues(double scl) voidsetArrays(double[] xArray, double[][] yArrays, int[] timeArray) set xvalues, single or multiple yvalue curves, and times (as int julian minutes)booleanset x-ordinates and multiple yvalue curves.voidsetData(PairedValues pv, String startDate) Develop a one curve SeasonalPairedValues object from a PairedValues objectvoidDevelop a SeasonalPairedValues object from a SeasonalRecordbooleansetFieldObject(Field fld, Object fobj) required AsciiSerialized method.voidsetGmtOffset(int offset) voidsetHasSeasonalVariation(boolean tf) Set use seasonal variation.voidsetTimeInterpolationType(int type) set type of interpolation in timeMethods inherited from class hec.model.PairedValuesExt
addPair, addPair, canInterpX, debugString, findInterval, findInterval, getCurve, getCurveLabels, getCurveLabelValues, getData, getDataVector, getDssIdentifier, getInterpolationType, getLargestValue, getNumberCurves, getNumY, getPairedDataContainer, getParametersId, getParametersIds, getParamXId, getParamXString, getParamXUnitsString, getParamYId, getParamYString, getParamYUnitsString, getParamZId, getParamZString, getParamZUnitsString, getUnitSystem, getXArray, getXValue, getXValue, getXValue, getYArray, getYArray, getYData, getYValue, getYValue, getYValue, getYValue, getYValue, getYValue, hasCurveLabels, insertCurve, interpolate, interpolate, interpolate, interpolateStepValue, interpolateStepValue, interpolateValue, interpolateValue, interpolateValueCubicSpline, interpolateValueCubicSpline, interpolateY, interpolateY, interpolateY, isXValueOutOfRange, isZValueOutOfRange, removeCurve, removePair, setArrays, setArrays, setArrays, setCurveLabels, setData, setDssIdentifier, setInterpolationType, setNumY, setParamXId, setParamYId, setParamZId, setUnitSystem, size, toString, toTableForm
-
Constructor Details
-
SeasonalPairedValues
public SeasonalPairedValues()
-
-
Method Details
-
setGmtOffset
public void setGmtOffset(int offset) -
getGmtOffset
public int getGmtOffset()Returns the time zone that this data is defined for. -
scaleValues
public void scaleValues(double scl) -
clone
Creates a new object of the same class as this object.
It then initializes each of the new object's fields by assigning it the same value as the corresponding field in this object. No
constructor is called.- Overrides:
clonein classPairedValuesExt
-
init
public void init()Description copied from class:PairedValuesExtinitialize the PairedValueExt object. validate that the data is valid and that the xvalues and yvalues are continuously increasing sequences- Overrides:
initin classPairedValuesExt
-
makeLeapYearTimeArray
protected boolean makeLeapYearTimeArray() -
setTimeInterpolationType
public void setTimeInterpolationType(int type) set type of interpolation in time -
getTimeInterpolationType
public int getTimeInterpolationType() -
setData
set x-ordinates and multiple yvalue curves. Times are assumed to be contained in the PairedDataContainer curve labels.- Overrides:
setDatain classPairedValuesExt- Parameters:
pdc- the PairedDataContainer to copy the data from- Returns:
- true
-
setData
Develop a SeasonalPairedValues object from a SeasonalRecord -
setData
Develop a one curve SeasonalPairedValues object from a PairedValues object -
getPairedValues
Return a PairedValues object developed from the first SeasonalPairedValues curve -
getTimeArray
public int[] getTimeArray() -
setArrays
public void setArrays(double[] xArray, double[][] yArrays, int[] timeArray) set xvalues, single or multiple yvalue curves, and times (as int julian minutes) -
clearValues
public void clearValues()empty data arrays ( but not _dataVector- Overrides:
clearValuesin classPairedValuesExt
-
setHasSeasonalVariation
public void setHasSeasonalVariation(boolean tf) Set use seasonal variation. If no seasonal variation, then just the first y-value curve is used for interpolation, etc. -
hasSeasonalVariation
public boolean hasSeasonalVariation() -
interpolate
Interpolate in time and function x-value -
interpolate
Interpolate in time and function x-value -
interpolate
Interpolate in time and function x-value -
interpolate
public double interpolate(int interpTime, double xval) Interpolate in time and function x-value -
findTimeInterval
public int findTimeInterval(int rundate) find interval time for interpolation -
resetWaterYearStart
-
getDateString
Convert a julian time ( minutes ) into a string of DDMMM -
getJulianMinute
-
getJulianMinute
-
main
-
getTime
public int getTime(int id) returns the time at the specified array location -
getYears
public int getYears()get the length of the seasonal record (years) -
getFieldObject
Description copied from class:PairedValuesExtrequired AsciiSerialized method. publicially callable only because of an implementation detail. Should not be called by anything other than the AsciiSerializer- Specified by:
getFieldObjectin interfaceFieldAccessor- Overrides:
getFieldObjectin classPairedValuesExt- Parameters:
fld- The field to get.- Returns:
- The data object that is stored in the given field
-
setFieldObject
Description copied from class:PairedValuesExtrequired AsciiSerialized method. publicially callable only because of an implementation detail. Should not be called by anything other than the AsciiDeserializer- Specified by:
setFieldObjectin interfaceFieldAccessor- Overrides:
setFieldObjectin classPairedValuesExt- Parameters:
fld- The java field object representing the member field to be setfobj- The data to set in that field- Returns:
- returns true if successful
-