stella.sensor
Class DewPoint

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by util.rmi.RmiPropertyContainer
                  extended by util.rmi.AbstractRmiCaster
                      extended by stella.sensor.AbstractSensor
                          extended by stella.sensor.TimerTaskSensor
                              extended by stella.sensor.DataSensor
                                  extended by stella.sensor.CumulativeSensor
                                      extended by stella.sensor.PredictiveSensor
                                          extended by stella.sensor.SmoothingSensor
                                              extended by stella.sensor.DerivativeSensor
                                                  extended by stella.sensor.WeatherSensor
                                                      extended by stella.sensor.DewPoint
All Implemented Interfaces:
Cloneable, Remote, Caster, DataCaster, RmiDataCaster, RmiErrorCaster, Cumulating, Deriving, Predicting, SensorDepending, Smoothing, Telemetering, WeatherJudging, WeatherCaster, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster, RmiPropertyBearing

public class DewPoint
extends WeatherSensor
implements SensorDepending

A class that calculates the difference between the ambient temperature and the dewpoint. Note that the ambient temperature and the temperature at given pressure may be different to allow e.g. calculation of the dewpoint offset from different sources.

The formula used in this class is deduced from formulas given ConvertToPhysical interface, which must be implemented by the sensors.

To allow this sensor to act as a weather sensor, only the raw-reading is given as the difference between the ambient temperature and the dewpoint. The physical value delivered by the dewpoint sensor is the true dewpoint derived from the outside temperature and the outside humidity.


Nested Class Summary
 
Nested classes/interfaces inherited from class stella.sensor.TimerTaskSensor
TimerTaskSensor.SensorRead
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  Telemetering ambient
          The sensor giving the ambient temperature.
private static double C1
          Constant C1.
private static double C15
          Constant C15.
private static double C2
          Constant C2.
private static double C3
          Constant C3.
private static double C4
          Constant C4.
private  Telemetering hum
          The sensor giving the humidity.
private static double KELVIN
          Converting degrees centigrade to Kelvin.
static String KEY_AMBIENT
          The String pointing to the name of the ambient temperature sensor.
static String KEY_HUMIDITY
          The String pointing to the name of the humidity sensor.
static String KEY_TEMPERATURE
          The String pointing to the name of the temperature sensor.
private  Telemetering temp
          The sensor giving the temperature to calculate the dew point from.
 
Fields inherited from class stella.sensor.WeatherSensor
KEY_DERIVATIVEINVALID, KEY_DERIVATIVEPARAMETER, KEY_INVERSE, KEY_INVERSEDERIVATIVE, KEY_JUDGEDERIVATIVE, KEY_JUDGEPREDICT, KEY_JUDGERAW, KEY_JUDGESMOOTH, KEY_PREDICTINVALID, KEY_PREDICTPARAMETER, KEY_RAWINVALID, KEY_RAWPARAMETER, KEY_RETARDBADDERIVATIVE, KEY_RETARDBADPREDICT, KEY_RETARDBADRAW, KEY_RETARDBADSMOOTH, KEY_RETARDGOODDERIVATIVE, KEY_RETARDGOODPREDICT, KEY_RETARDGOODRAW, KEY_RETARDGOODSMOOTH, KEY_SMOOTHINVALID, KEY_SMOOTHPARAMETER
 
Fields inherited from class stella.sensor.DerivativeSensor
DEFRAWDERIVATIVE, derive, KEY_DERIVATIVEADVISE, KEY_DERIVE, KEY_PATH, KEY_RAWDERIVATIVE, z
 
Fields inherited from class stella.sensor.SmoothingSensor
f, g, KEY_SMOOTH, KEY_SMOOTHADVISE
 
Fields inherited from class stella.sensor.PredictiveSensor
KEY_BASE, KEY_CHI, KEY_EXTRAPOLATE, KEY_FUTURE, KEY_PREDICTADVISE, predict
 
Fields inherited from class stella.sensor.CumulativeSensor
KEY_AVERAGE, KEY_MEMORY, KEY_PACK
 
Fields inherited from class stella.sensor.DataSensor
DEFRAWFORMAT, DEFREPORT, DEFSIGMAFORMAT, KEY_RAWFORMAT, KEY_REPORT, KEY_SIGMAFORMAT
 
Fields inherited from class stella.sensor.TimerTaskSensor
KEY_RESPAWN
 
Fields inherited from class stella.sensor.AbstractSensor
KEY_BIND, KEY_BINDNAME, KEY_CONVERT, KEY_DESCRIPTION, KEY_SENSORNAME
 
Fields inherited from class util.rmi.AbstractRmiCaster
ALTERNATEHOST, ALTERNATEPORT, KEY_EXPORTPORT, KEY_REGISTRYHOST, KEY_REGISTRYPORT
 
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 stella.rmi.RmiDataCaster
NAMING_EXTENSION
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
DewPoint(Map prop)
          Constructs a new dew-point sensor.
 
Method Summary
protected  double readSensor()
          Reads the sensor value.
 void registerSensor(Telemetering check)
          Registers the additional sensors necessary for interpreting this sensor reading.
 boolean validReading()
          Returns true if the reading is valid.
 
Methods inherited from class stella.sensor.WeatherSensor
addWeatherListener, conductOneMeasure, currentlyClear, currentlyRetarding, generateDataEvent, getMinClearUpTime, getSensorInitInfo, goodFromDerivative, goodFromPredict, goodFromRaw, goodFromSmooth, isDerivativeRetard, isPredictRetard, isRawRetard, isSmoothRetard, judgeWeather, notifyWeatherListener, removeWeatherListener, status
 
Methods inherited from class stella.sensor.DerivativeSensor
deriveAt, getDerivativeFormat, getDerivativeToggleInfo, getDerivator, getLastDerivative, isDerivativeAdvise, isDeriving, newData, regetDerive, registerDerivator
 
Methods inherited from class stella.sensor.SmoothingSensor
getLastSmooth, getSmoother, getSmoothToggleInfo, isSmoothAdvise, isSmoothing, regetSmooth, registerSmoother, smoothOne
 
Methods inherited from class stella.sensor.PredictiveSensor
getExtrapolation, getLastPredict, getPredictToggleInfo, isPredictAdvise, isPredicting, isReliable, predictFrom, regetPredict
 
Methods inherited from class stella.sensor.CumulativeSensor
cumulateOne, getLastRaw, getLastTime, getMaxSize, getMemory, getSize
 
Methods inherited from class stella.sensor.DataSensor
addDataListener, addRmiDataListener, exit, getRawFormat, getSigmaFormat, removeDataListener, removeRmiDataListener, report
 
Methods inherited from class stella.sensor.TimerTaskSensor
cancel, equals, getRawToggleInfo, getReading, getRespawn, getTimeOfRead, hashCode, initSensorTimerTask, isReady, regetRaw, setTimeOfRead, validReading
 
Methods inherited from class stella.sensor.AbstractSensor
addRmiErrorListener, createSensor, getBindName, getConvert, getSensorDescription, getSensorName, init, notifyErrorListener, removeRmiErrorListener, setConvert, toString
 
Methods inherited from class util.rmi.AbstractRmiCaster
bindAlternate, bindToRegistry, bindToRegistry, bindToRegistry, casterExit, casterExit, getBindName, isValid, unbindFromRegistry, unbindFromRegistry
 
Methods inherited from class util.rmi.RmiPropertyContainer
containsRemoteProperty, getRemoteProperties, getRemoteProperty, setRemoteProperty
 
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, 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
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.sensor.Cumulating
cumulateOne, getLastRaw, getLastTime, getMaxSize, getSize, getTimeOfRead, regetRaw
 
Methods inherited from interface util.rmi.RmiCaster
bindToRegistry, isValid, unbindFromRegistry
 
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.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

KEY_HUMIDITY

public static final String KEY_HUMIDITY
The String pointing to the name of the humidity sensor.

See Also:
Constant Field Values

KEY_AMBIENT

public static final String KEY_AMBIENT
The String pointing to the name of the ambient temperature sensor.

See Also:
Constant Field Values

KEY_TEMPERATURE

public static final String KEY_TEMPERATURE
The String pointing to the name of the temperature sensor.

See Also:
Constant Field Values

KELVIN

private static final double KELVIN
Converting degrees centigrade to Kelvin.

See Also:
Constant Field Values

C15

private static final double C15
Constant C15.

See Also:
Constant Field Values

C1

private static final double C1
Constant C1.

See Also:
Constant Field Values

C2

private static final double C2
Constant C2.

See Also:
Constant Field Values

C3

private static final double C3
Constant C3.

See Also:
Constant Field Values

C4

private static final double C4
Constant C4.

See Also:
Constant Field Values

hum

private Telemetering hum
The sensor giving the humidity.


ambient

private Telemetering ambient
The sensor giving the ambient temperature.


temp

private Telemetering temp
The sensor giving the temperature to calculate the dew point from.

Constructor Detail

DewPoint

public DewPoint(Map prop)
         throws RemoteException
Constructs a new dew-point sensor.

Throws:
RemoteException
Method Detail

registerSensor

public void registerSensor(Telemetering check)
Registers the additional sensors necessary for interpreting this sensor reading. The dew point need the relative humidity and the temperature. Additionally, to allow offset of the dew point temperature from a different ambient temperature, a different temperature sensor can be specified.
Note that the registered object must be a sensor and must implement the ConvertToPhysical interface.

Specified by:
registerSensor in interface SensorDepending

readSensor

protected double readSensor()
Reads the sensor value. The sensor value can only be calculated if the required sensors have been registered. In the latter case, Nan is returned.
The registered temperature sensors must deliver their temperature in degrees centigrade, while the humidity sensor must deliver a relative humidity in percent, i.e. values between zero and onehundred.

Specified by:
readSensor in class TimerTaskSensor
See Also:
ConvertToPhysical

validReading

public boolean validReading()
Returns true if the reading is valid. A dew-point reading is valid, if all the sensors it depends on are valid.

Specified by:
validReading in interface Telemetering