stella.sensor
Class PolynomialConversion
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.sensor.AbstractConversion
stella.sensor.AbstractDerivative
stella.sensor.PolynomialConversion
- All Implemented Interfaces:
- Serializable, Cloneable, ConvertToPhysical, PhysicalDerivative, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying
- Direct Known Subclasses:
- LimitedPolynomialConversion
public class PolynomialConversion
- extends AbstractDerivative
A class to convert raw readings into physical quantities. This class uses
a polynom, defined with the KEY_POLYNOM key for this behalf. Note
that averaging over data events (see DataFactory) is error-free as
long as the conversion polynom is linear.
- See Also:
- Serialized Form
|
Field Summary |
private static String |
DEFPOLYNOM
Default polynom. |
private Polynom |
invert
The polynom used to render raw values from physical ones. |
static String |
KEY_INVERT
The key pointing to a comma-separated polynom-coefficient string. |
static String |
KEY_POLYNOM
The key pointing to a comma-separated polynom-coefficient string. |
private Polynom |
poly
The polynom used to render the physical value of the sensor. |
|
Method Summary |
double |
getDeviation(double x,
double std)
Returns the value of the deviation of the physical value. |
double |
getPhysical(double x)
Returns the polynomial approximation of the physical correct value. |
double |
getPhysicalDerivative(double d1,
double raw)
Returns the value of the first derivative in physically meaningful
units. |
double |
getRaw(double x)
Returns the polynomial approximation of the raw value. |
double |
getRawDerivative(double d1,
double phys)
Returns the value of the first raw derivative. |
| 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 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 |
KEY_POLYNOM
public static final transient String KEY_POLYNOM
- The key pointing to a comma-separated polynom-coefficient string.
- See Also:
- Constant Field Values
KEY_INVERT
public static final transient String KEY_INVERT
- The key pointing to a comma-separated polynom-coefficient string.
- See Also:
- Constant Field Values
DEFPOLYNOM
private static final transient String DEFPOLYNOM
- Default polynom. Constant of zero value.
- See Also:
- Constant Field Values
poly
private Polynom poly
- The polynom used to render the physical value of the sensor.
invert
private Polynom invert
- The polynom used to render raw values from physical ones.
PolynomialConversion
public PolynomialConversion(Map<String,String> prop)
- Constructs a new polynomial conversion object.
getDeviation
public double getDeviation(double x,
double std)
- Returns the value of the deviation of the physical value. Uses the first
derivative of the polynominal approximation following
δf = dp(x)/dx * δx
- Parameters:
x - The raw reading value.std - The standard deviation of the raw readings.
- Returns:
- The physical quantity corresponding to the standard deviation
of the raw readings.
getPhysical
public double getPhysical(double x)
- Returns the polynomial approximation of the physical correct value.
- Parameters:
x - The raw reading value.
- Returns:
- The physical quantity corresponding to the raw reading.
getRaw
public double getRaw(double x)
- Returns the polynomial approximation of the raw value.
getPhysicalDerivative
public double getPhysicalDerivative(double d1,
double raw)
- Returns the value of the first derivative in physically meaningful
units.
- Parameters:
d1 - The numerical derivative from raw values.raw - The raw reading of the sensor.
getRawDerivative
public double getRawDerivative(double d1,
double phys)
- Returns the value of the first raw derivative.
- Parameters:
d1 - The physical quantity of the first derivative.phys - The physical quantity.