stella.sensor
Class CosineConversion

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.sensor.AbstractConversion
                  extended by stella.sensor.AbstractDerivative
                      extended by stella.sensor.CosineConversion
All Implemented Interfaces:
Serializable, Cloneable, ConvertToPhysical, PhysicalDerivative, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, PI

public class CosineConversion
extends AbstractDerivative
implements PI

The converter class used by the solz sensor. It converts the cosine of z, which is the raw sensor reading into a 'true' z in degrees.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
 
Fields inherited from class stella.sensor.AbstractDerivative
KEY_VALUEDERIVATIVE
 
Fields inherited from class stella.sensor.AbstractConversion
KEY_UNIT, KEY_VALUEFORMAT, KEY_VALUESIGMA
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface vec_math.PI
HOUR, PIHALF, PITWO, RADIAN
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
CosineConversion(Map info)
          Constructs a new cosine converter.
 
Method Summary
 double getDeviation(double cosz, double dummy)
          Returns the estimated standard deviation in physical units of the physical mean.
 double getPhysical(double sinh)
          Returns the physical interpretation of this sensors raw reading value.
 double getPhysicalDerivative(double dcosz, double h)
          Returns the derivative of the physical interpreted raw measure value.
 double getRaw(double h)
          Returns the raw value from the physical one.
 double getRawDerivative(double dhdt, double h)
          Converts the derivative of the solar height, given in degrees per second in the raw derivative, which is the derivative of sin(h) with respect to solar time in radians.
 
Methods inherited from class stella.sensor.AbstractDerivative
getDerivativeValueFormat
 
Methods inherited from class stella.sensor.AbstractConversion
createConversion, getSigmaValueFormat, getUnit, getValueFormat
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, init, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.sensor.ConvertToPhysical
getSigmaValueFormat, getUnit, getValueFormat
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 
Methods inherited from interface util.Initializable
init
 

Constructor Detail

CosineConversion

public CosineConversion(Map info)
Constructs a new cosine converter. Since the conversion does not need any additional parameters, all the properties defined for the decimal formats should be given in the properties of the solz sensor itself. Its properties are also used to construct this converter.

Method Detail

getPhysical

public double getPhysical(double sinh)
Returns the physical interpretation of this sensors raw reading value. For a solar z sensor, the raw value is the cosine of the solar zenith distance, while the physical interpretation is the true solar height, in degrees.

Specified by:
getPhysical in interface ConvertToPhysical
Parameters:
cosz - The cosine of the solar zenith distance.
Returns:
The solar height above the horizon, in degrees.

getRaw

public double getRaw(double h)
Returns the raw value from the physical one.

Specified by:
getRaw in interface ConvertToPhysical
Parameters:
h - The height of the sun in degrees.
Returns:
The sine of the solar height.

getDeviation

public double getDeviation(double cosz,
                           double dummy)
Returns the estimated standard deviation in physical units of the physical mean. Again, as solar z is a calculating sensor, this standard deviation is defined to be zero, although there is of course a numerical value of a standard deviation because the solar z value changes over the time intervall considered. To unmistakably mark a calculated (i.e. exact) sensor, this deviation is set to zero.

Specified by:
getDeviation in interface ConvertToPhysical
Parameters:
cosz - The raw reading value.
dummy - The standard deviation of the raw readings.
Returns:
Double.NaN to indicate that this sensor is an exact sensor.

getPhysicalDerivative

public double getPhysicalDerivative(double dcosz,
                                    double h)
Returns the derivative of the physical interpreted raw measure value. Because sol z is a calculating sensor, there is no need to consider a numerically, smoothened first derivative value. To convert the raw derivative, which takes the derivative of cos(z) in respect to solar time in radians, one has to devide the result through 240 to get the result in degrees per seconds.

Specified by:
getPhysicalDerivative in interface PhysicalDerivative
Parameters:
dcosz - The derivative of cos(z).
h - The cosine of the solar height.
Returns:
The first derivative of the solar height in degrees per solar time in seconds.

getRawDerivative

public double getRawDerivative(double dhdt,
                               double h)
Converts the derivative of the solar height, given in degrees per second in the raw derivative, which is the derivative of sin(h) with respect to solar time in radians.

Specified by:
getRawDerivative in interface PhysicalDerivative
Parameters:
dhdt - The physical quantity of the first derivative.
h - The physical quantity.