net.agmodel.weatherData
Class SolarRadiationImpl

java.lang.Object
  |
  +--net.agmodel.physical.GeneralSequenceImpl
        |
        +--net.agmodel.weatherData.GeneralMetSequenceImpl
              |
              +--net.agmodel.weatherData.SolarRadiationImpl
All Implemented Interfaces:
Cloneable, CompoundSequence, MetSequence, Sequence, Serializable, SolarRadiation

public class SolarRadiationImpl
extends GeneralMetSequenceImpl
implements SolarRadiation

Implements a solar radiation sequence using an array of Stores store values==null is used to indicate that no data of that type is available Radiation values are stored internally in W/m2 (except for PPFD in (µmol s-1m-2))

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.agmodel.weatherData.GeneralMetSequenceImpl
rb
 
Fields inherited from class net.agmodel.physical.GeneralSequenceImpl
dateRange, maximumTemporalInterpolation, summaryHistory
 
Constructor Summary
SolarRadiationImpl(Interval dateRange, SummaryHistory composition)
           
 
Method Summary
 SolarRadiationImpl average(Duration newResolution)
          Creates a new solar radiation sequence, averaging to a lower resolution.
 Object clone()
           
 JigsawQuantity getAverage(RadiationKind kind, Interval interval)
          Returns the average solar radiation over the interval.
 String getColumnHeading()
          Returned a localized label for the Sequence
 String getContentsAsString(Date time, String delimiter)
          Returns the measurement associated with a particular time as a string.
 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.
 JigsawQuantity getInstant(RadiationKind kind, Date time)
          Returns the instantaneous solar radiation at a particular point in time.
 JigsawQuantity getMaximum(RadiationKind kind, Interval interval)
          Returns the maximum solar radiation over the interval.
 JigsawQuantity getMinimum(RadiationKind kind, Interval interval)
          Returns the minimum solar radiation over the interval.
 int getNumberOfSubComponents()
          Get the number of sub-components in the sequence.
protected  Store getStore(RadiationKind rK)
           
 String getSubHeading(int index)
          Gets a brief description of the data stored in a Sequence subcomponent in the language of the default locale.
 JigsawQuantity getTotal(RadiationKind kind, Interval interval)
          Returns the accumulated solar energy over the interval in MJ/m2.
 String getUnitsHeading(int index)
          Gets a string representation of the measurement units of the column.
 boolean hasKind(RadiationKind kind)
          Returns true if the specified kind of radiation is available
 void makeStore(RadiationKind kind)
           
 void putAverageRadiationOverInterval(RadiationKind kind, Interval interval, float valueW)
          Records the average solar radiation over some subinterval.
 void putInstantRadiation(RadiationKind kind, Date time, float valueW)
          Records the instantaneous solar radiation at a particular time
 void putTotalRadiationOverInterval(RadiationKind kind, Interval interval, float valueMJ)
          Records the solar radiation over some subinterval.
protected  void setStore(RadiationKind rK, Store newStore)
           
 void setSubHeading(int index, String aHeading)
          Does nothing
 MetSequence summarize(Duration longerResolution)
          Creates a lower resolution sequence which summarizes this sequence
 
Methods inherited from class net.agmodel.weatherData.GeneralMetSequenceImpl
getName, getSequenceElement, getSequenceHeading, setColumnHeading, setName, setSequenceHeading, setUnitsHeading
 
Methods inherited from class net.agmodel.physical.GeneralSequenceImpl
cancelTemporalInterpolation, dumpSequence, getAllCoverage, getAllData, getCurrentResolution, getDateRange, getMaximumTemporalInterpolation, getResolution, getSubHeading, getSummaryHistory, getSummaryKind, getTemporalInterpolation, getUnitsHeading, setTemporalInterpolation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.agmodel.weatherData.MetSequence
getSequenceElement
 
Methods inherited from interface net.agmodel.physical.CompoundSequence
cancelTemporalInterpolation, getAllCoverage, getAllData, getMaximumTemporalInterpolation, getTemporalInterpolation, setSequenceHeading, setTemporalInterpolation, setUnitsHeading
 
Methods inherited from interface net.agmodel.physical.Sequence
dumpSequence, getCurrentResolution, getDateRange, getName, getResolution, getSequenceHeading, getSubHeading, getSummaryKind, getUnitsHeading, setColumnHeading, setName
 

Constructor Detail

SolarRadiationImpl

public SolarRadiationImpl(Interval dateRange,
                          SummaryHistory composition)
Method Detail

setStore

protected void setStore(RadiationKind rK,
                        Store newStore)

getStore

protected Store getStore(RadiationKind rK)

makeStore

public void makeStore(RadiationKind kind)

putInstantRadiation

public void putInstantRadiation(RadiationKind kind,
                                Date time,
                                float valueW)
Records the instantaneous solar radiation at a particular time

Parameters:
time - the point in time
valueW - the solar radiation at that time in W/m2
Throws:
IllegalArgumentException - if the time is outside the interval that the period is intended to store

putAverageRadiationOverInterval

public void putAverageRadiationOverInterval(RadiationKind kind,
                                            Interval interval,
                                            float valueW)
Records the average solar radiation over some subinterval.

Parameters:
interval - the period of time over which the measurement was taken.
valueW - the averagesolar radiation over that interval in W/m2
Throws:
IllegalArgumentException - if the subinterval is outside the interval that the sequence was constructed to store

putTotalRadiationOverInterval

public void putTotalRadiationOverInterval(RadiationKind kind,
                                          Interval interval,
                                          float valueMJ)
Records the solar radiation over some subinterval.

Parameters:
interval - the period of time over which the measurement was taken.
valueMJ - the total solar radiation over that interval in MJ/m2
Throws:
IllegalArgumentException - if the subinterval is outside the interval that the sequence was constructed to store

hasKind

public boolean hasKind(RadiationKind kind)
Description copied from interface: SolarRadiation
Returns true if the specified kind of radiation is available

Specified by:
hasKind in interface SolarRadiation
Parameters:
kind - a constant corresponding to the type of solar radiation

getMinimum

public JigsawQuantity getMinimum(RadiationKind kind,
                                 Interval interval)
Description copied from interface: SolarRadiation
Returns the minimum solar radiation over the interval. Sequence values at either end of the interval are included in the comparison if more than 50% of their duration lies within the interval of interest.

Specified by:
getMinimum in interface SolarRadiation
Parameters:
kind - a constant corresponding to the type of solar radiation
Returns:
the minimum value (W/m2)

getMaximum

public JigsawQuantity getMaximum(RadiationKind kind,
                                 Interval interval)
Description copied from interface: SolarRadiation
Returns the maximum solar radiation over the interval. Sequence values at either end of the interval are included in the comparison if more than 50% of their duration lies within the interval of interest.

Specified by:
getMaximum in interface SolarRadiation
Parameters:
kind - a constant corresponding to the type of solar radiation
Returns:
the maximum value (W/m2)

getInstant

public JigsawQuantity getInstant(RadiationKind kind,
                                 Date time)
Description copied from interface: SolarRadiation
Returns the instantaneous solar radiation at a particular point in time. If interpolation is requested, the value may be spatially and/or temporally interpolated from other data.

Specified by:
getInstant in interface SolarRadiation
Parameters:
kind - a constant corresponding to the type of solar radiation
Returns:
the instantaneous value (W/m2)

getAverage

public JigsawQuantity getAverage(RadiationKind kind,
                                 Interval interval)
Description copied from interface: SolarRadiation
Returns the average solar radiation over the interval. Sequence values at either end of the interval are included by weighting their values according to the proportion of their duration that lies in the period of interest.

Specified by:
getAverage in interface SolarRadiation
Parameters:
kind - a constant corresponding to the type of solar radiation
Returns:
the average value (W/m2)

getTotal

public JigsawQuantity getTotal(RadiationKind kind,
                               Interval interval)
Description copied from interface: SolarRadiation
Returns the accumulated solar energy over the interval in MJ/m2. Sequence values at either end of the interval are included by weighting their values according to the proportion of their duration that lies in the period of interest.

Specified by:
getTotal in interface SolarRadiation
Parameters:
kind - a constant corresponding to the type of solar radiation
Returns:
the total value in MJ/m2

getColumnHeading

public String getColumnHeading()
Deprecated.  

Description copied from interface: Sequence
Returned a localized label for the Sequence

Specified by:
getColumnHeading in interface Sequence
Overrides:
getColumnHeading in class GeneralMetSequenceImpl

getNumberOfSubComponents

public int getNumberOfSubComponents()
Description copied from interface: Sequence
Get the number of sub-components in the sequence. This indicates how many "columns" the sequence output will occupy.

Specified by:
getNumberOfSubComponents in interface Sequence
Specified by:
getNumberOfSubComponents in class GeneralMetSequenceImpl
Returns:
the number of sub-components
See Also:
Sequence.getSequenceHeading(String)

getSubHeading

public String getSubHeading(int index)
Description copied from interface: CompoundSequence
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.

Specified by:
getSubHeading in interface CompoundSequence
Specified by:
getSubHeading in class GeneralMetSequenceImpl
See Also:
Sequence.getNumberOfSubComponents(), Sequence.getSequenceHeading(String)

getUnitsHeading

public String getUnitsHeading(int index)
Description copied from interface: CompoundSequence
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.

Specified by:
getUnitsHeading in interface CompoundSequence
Overrides:
getUnitsHeading in class GeneralMetSequenceImpl
See Also:
Sequence.getNumberOfSubComponents(), Sequence.getSequenceHeading(String), CompoundSequence.getSubHeading(int)

setSubHeading

public void setSubHeading(int index,
                          String aHeading)
Does nothing

Specified by:
setSubHeading in interface CompoundSequence
Specified by:
setSubHeading in class GeneralMetSequenceImpl
Parameters:
aHeading - the new heading
index - the zero-based index of the heading
See Also:
Sequence.getNumberOfSubComponents(), Sequence.getSequenceHeading(String)

getContentsAsString

public String getContentsAsString(Date time,
                                  String delimiter)
Description copied from interface: Sequence
Returns the measurement associated with a particular time as a string. Used by dumpSequence.

Specified by:
getContentsAsString in interface Sequence
Specified by:
getContentsAsString in class GeneralSequenceImpl
Parameters:
time - the time of interest.
delimiter - a string to use between values if required.

average

public SolarRadiationImpl average(Duration newResolution)
Creates a new solar radiation sequence, averaging to a lower resolution.

Parameters:
newResolution - the target resolution required.
Returns:
a new solar radiation sequence

summarize

public MetSequence summarize(Duration longerResolution)
Description copied from interface: MetSequence
Creates a lower resolution sequence which summarizes this sequence

Specified by:
summarize in interface MetSequence
Parameters:
longerResolution - the new resolution to summarize to
Returns:
a summarized sequence.

getData

public double[] getData(int index)
Description copied from interface: CompoundSequence
Creates a one-dimensional array containing one subcomponent of the data. Use CompoundSequence.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.

Specified by:
getData in interface CompoundSequence
Specified by:
getData in class GeneralSequenceImpl
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)
Description copied from interface: CompoundSequence
Indicates which array elements returned by CompoundSequence.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.

Specified by:
getCoverage in interface CompoundSequence
Specified by:
getCoverage in class GeneralSequenceImpl
Parameters:
index - the zero-based index of the subcomponent
Returns:
a array of the same length as that returned by getData()

clone

public Object clone()
Specified by:
clone in interface Sequence
Overrides:
clone in class GeneralSequenceImpl