stella.sensor
Interface ConvertToPhysical

All Known Subinterfaces:
PhysicalDerivative
All Known Implementing Classes:
AbstractConversion, AbstractDerivative, CosineConversion, DewPointConvert, IdenticalConversion, LimitedPolynomialConversion, PolynomialConversion

public interface ConvertToPhysical

An interface describing the capability of a sensor to interpret its reading in a physical sense. Note that it is not necessary for automated weather interpretation to convert the sensor reading to a physically meaningful value. For readability or visualization efforts, it is nevertheless advisable to do so.


Method Summary
 double getDeviation(double reading, double deviation)
          This second method calculates (standard) deviation of the physical value in physically meaningful units.
 double getPhysical(double reading)
          (Sensor) Classes defining this interface should know how to convert their sensor reading into physically meaningful results.
 double getRaw(double physical)
          Is the inversion of getPhysical(double).
 NumberFormat getSigmaValueFormat()
          Returns a decimal value formatter to be used with the sigma of the value.
 String getUnit()
          Returns a well-known description of the unit of the sensor value.
 NumberFormat getValueFormat()
          Returns a decimal value formatter to be used with the physical value.
 

Method Detail

getPhysical

double getPhysical(double reading)
(Sensor) Classes defining this interface should know how to convert their sensor reading into physically meaningful results. E.g. a temperature sensor should be able to converts its raw sensor reading to degrees Celcius.

Parameters:
reading - The raw reading value.
Returns:
The physical quantity corresponding to the raw reading.

getRaw

double getRaw(double physical)
Is the inversion of getPhysical(double). Calling this method with the physical meaningful quantity converts it back into the raw reading.


getDeviation

double getDeviation(double reading,
                    double deviation)
This second method calculates (standard) deviation of the physical value in physically meaningful units. For non-linear transformations, it is necessary to include not only the (standard) deviation of the measured value, but also the value itself.

Parameters:
reading - The raw reading value.
deviation - The standard deviation of the raw readings.
Returns:
The physical quantity corresponding to the standard deviation of the raw readings.
Since:
1.0.1

getUnit

String getUnit()
Returns a well-known description of the unit of the sensor value. Try to keep this short. E.g. C should be sufficient to describe a temperature in degrees Celcius.


getValueFormat

NumberFormat getValueFormat()
Returns a decimal value formatter to be used with the physical value.


getSigmaValueFormat

NumberFormat getSigmaValueFormat()
Returns a decimal value formatter to be used with the sigma of the value.