net.agmodel.physical
Interface CompoundSequence

All Superinterfaces:
Sequence
All Known Subinterfaces:
AirTemperature, Humidity, LeafWetness, MetSequence, MultiQuantity, Rain, ScalarQuantity, SoilTemperature, SolarRadiation, Sunshine, WaterTemperature, Wind
All Known Implementing Classes:
AirTempMaxMinImpl, AirTempMaxMinMeanImpl, AirTempMultiImpl, AirTempSingleImpl, GeneralMetSequenceImpl, GeneralSequenceImpl, LeafWetnessMultiImpl, LeafWetnessSingleImpl, MultiImpl, RainImpl, RHImpl, SoilTemperatureImpl, SolarRadiationImpl, SunshineImpl, WaterTempSingleImpl, WetDryImpl, WindImpl, WindProfileImpl

public interface CompoundSequence
extends Sequence

Interface to sequences of measurements of some physical property.
Sequence is an parent for domain-specific descendents like MetSequence.
In some situations an implementor may contain several related time series of data (eg wet and dry bulb temperatures).
Implementors typically store data in one or more Store utility classes.
This separation is so different storage methods can be "plugged in" for different kinds of data
eg. rainfall data or leaf wetness data can readily be compressed by a kind of run length encoding. Hourly temperatures are less amenable to such compression.

Note that Sequences follow the same convention as Stores and MetRequests, which is that the range of data stored is partially closed (start,end].
This means in descendent classes you can call getInstantValue(end) but not getInstantValue(start).


Method Summary
 void cancelTemporalInterpolation()
          Cancels any temporal interpolation in subsequent calls to getXXXX
 float[][] getAllCoverage()
          Indicates which array elements returned by getAllData() are missing.
 double[][] getAllData()
          Creates a two-dimensional array containing the data.
 float[] getCoverage(int index)
          Indicates which array elements returned by getData(int) are missing.
 double[] getData(int index)
          Creates a one-dimensional array containing one subcomponent of the data.
 Duration getMaximumTemporalInterpolation()
          Returns the longest data gap over which values can be temporally interpolated
 String getSubHeading(int index)
          Gets a brief description of the data stored in a Sequence subcomponent in the language of the default locale.
 boolean getTemporalInterpolation()
          Indicates whether temporal interpolation is enabled
 String getUnitsHeading(int index)
          Gets a string representation of the measurement units of the column.
 void setSequenceHeading(String aHeading)
          Sets the brief top level description of the kind of data stored in the sequence in the language of the default locale.
 void setSubHeading(int index, String aHeading)
          Sets the brief description of the kind of data stored in the sequence in the language of the default locale.
 void setTemporalInterpolation(Duration maximumTemporalInterpolation)
          Sets the longest data gap over which values can be temporally interpolated.
 void setUnitsHeading(int index, String aHeading)
          Sets a string representation of the measurement units of the column.
 
Methods inherited from interface net.agmodel.physical.Sequence
clone, dumpSequence, getColumnHeading, getContentsAsString, getCurrentResolution, getDateRange, getName, getNumberOfSubComponents, getResolution, getSequenceHeading, getSubHeading, getSummaryKind, getUnitsHeading, setColumnHeading, setName
 

Method Detail

setTemporalInterpolation

public void setTemporalInterpolation(Duration maximumTemporalInterpolation)
Sets the longest data gap over which values can be temporally interpolated.


cancelTemporalInterpolation

public void cancelTemporalInterpolation()
Cancels any temporal interpolation in subsequent calls to getXXXX


getTemporalInterpolation

public boolean getTemporalInterpolation()
Indicates whether temporal interpolation is enabled

Returns:
true if data can be temporally interpolated, false otherwise
See Also:
getMaximumTemporalInterpolation()

getMaximumTemporalInterpolation

public Duration getMaximumTemporalInterpolation()
Returns the longest data gap over which values can be temporally interpolated

Returns:
the duration over which data can be interpolated, or null if interpolation is disabled
See Also:
getTemporalInterpolation()

setSequenceHeading

public void setSequenceHeading(String aHeading)
Sets the brief top level description of the kind of data stored in the sequence in the language of the default locale. This value can be used as a column heading if the sequence is listed.

Parameters:
aHeading - the new heading
See Also:
Sequence.getNumberOfSubComponents(), Sequence.getSequenceHeading(String)

getSubHeading

public String getSubHeading(int index)
Gets a brief description of the data stored in a Sequence subcomponent in the language of the default locale. This value can be used as a column sub heading if the sequence is listed. It is assumed to be in the context of an overall column heading.

See Also:
Sequence.getNumberOfSubComponents(), Sequence.getSequenceHeading(String)

setSubHeading

public void setSubHeading(int index,
                          String aHeading)
Sets the brief description of the kind of data stored in the sequence in the language of the default locale. This value can be used as a column sub heading if the sequence is listed. It is assumed to be in the context of an overall column heading.

Parameters:
aHeading - the new heading
index - the zero-based index of the heading
See Also:
Sequence.getNumberOfSubComponents(), Sequence.getSequenceHeading(String)

getUnitsHeading

public String getUnitsHeading(int index)
Gets a string representation of the measurement units of the column. This value is typically used as part of the column heading when the sequence is listed. It is assumed to be in the context of an overall column heading.

See Also:
Sequence.getNumberOfSubComponents(), Sequence.getSequenceHeading(String), getSubHeading(int)

setUnitsHeading

public void setUnitsHeading(int index,
                            String aHeading)
Sets a string representation of the measurement units of the column. This value is typically used as part of the column heading when the sequence is listed. It is assumed to be in the context of an overall column heading.

Parameters:
index - the zero-based index of the heading
aHeading - the new heading
See Also:
Sequence.getNumberOfSubComponents(), setSequenceHeading(String), setSubHeading(int,String)

getAllData

public double[][] getAllData()
Creates a two-dimensional array containing the data. The subcomponent is represented by the first index (row), and time by the second index (column). This is because Java handles 2D arrays as arrays of arrays - it is about 4 x faster to create several large arrays rather than many small ones. Use getAllCoverage() to test for missing values (at present these are returned as Double.NaN but don't rely on this).
Note that the first element of the array corresponds to getStart() and is therefore empty in most cases.
eg. To print all the data:
 double[][] theData=getAllData();
 int components=getNumberOfSubComponents();
 for (int timeIndex=1;timeIndex

Returns:
the data within the sequence, with each row representing one interval of time.

getAllCoverage

public float[][] getAllCoverage()
Indicates which array elements returned by getAllData() are missing. Coverage values are in the range JigsawQuantity.DEVOID to JigsawQuantity.COMPLETE.
Note that the first element of the array corresponds to getStart() and is therefore empty in most cases.

Returns:
an array with the same layout as that returned by getAllData()

getData

public double[] getData(int index)
Creates a one-dimensional array containing one subcomponent of the data. Use getCoverage(int) to test for missing values (at present these are returned as Double.NaN but don't rely on this).
Note that the first element of the array corresponds to getStart() and is therefore empty in most cases.

Parameters:
index - the zero-based index of the subcomponent
Returns:
the subcomponent as a timeseries array.
See Also:
Sequence.getNumberOfSubComponents()

getCoverage

public float[] getCoverage(int index)
Indicates which array elements returned by getData(int) are missing. Coverage values are in the range JigsawQuantity.DEVOID to JigsawQuantity.COMPLETE.
Note that the first element of the array corresponds to getStart() and is therefore empty in most cases.

Parameters:
index - the zero-based index of the subcomponent
Returns:
a array of the same length as that returned by getData()