public class SolZSensor extends WeatherSensor implements PI
WeatherSensor. It
calculates the height of the sun from the current date and returns it as a
sensor reading. It is also a WeatherSensor because it may produce
WeatherEvents when the sun's zenith distance crosses the threshold
value defined in its properties. This class is not very apt for testing the
various sensor aspects, use the subclass NoiseSolZSensor for this
purpose.
If one wants to implement updated versions for the site, sidereal time or solar position calculator, simple adds the fully qualified class name, like astro.SimpleSol to the properties. All of the updated classes must have an empty constructor.
This sensor adds the following properties if they are not set already:
ConvertToPhysical instance, the CosineConversion.| Modifier and Type | Class and Description |
|---|---|
static class |
SolZSensor.Test
Test purpose mainly.
|
TimerTaskSensor.SensorReadPropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private static String |
DEFINVERSE
The default inverse treatment.
|
private static Map |
DEFPROP
The default properties.
|
private static String |
DEFRAW
The default class name for raw-weather.
|
private static Class |
DEFSID
The default sidereal time calculator if non is given in the properties
file.
|
private static Class |
DEFSITE
The default site if non is given in the properties file.
|
private static Class |
DEFSOL
The default solar position calculator if non is given in the properties
file.
|
private static String |
DEFZ
The default z solar toggle value.
|
static String |
KEY_SIDEREAL
The key describing the sidereal time calculator.
|
static String |
KEY_SITE
The key describing the sensors location.
|
static String |
KEY_SOLARPOSITION
The key describing the solar position calculator.
|
private Site |
place
The location of this sensor.
|
private double |
sid
The last calculated sidereal time.
|
private SiderealTiming |
sidereal
The class converting dates into sidereal time.
|
private SolarPosition |
sol
The class converting dates into solar positions.
|
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_SMOOTHPARAMETERDEFRAWDERIVATIVE, derive, KEY_DERIVATIVEADVISE, KEY_DERIVE, KEY_PATH, KEY_RAWDERIVATIVE, zf, g, KEY_SMOOTH, KEY_SMOOTHADVISEKEY_CHI, KEY_EXTRAPOLATE, KEY_FUTURE, KEY_PREDICTADVISE, predictKEY_AVERAGE, KEY_MEMORY, KEY_PACKDEFRAWFORMAT, DEFREPORT, DEFSIGMAFORMAT, KEY_RAWFORMAT, KEY_REPORT, KEY_SIGMAFORMATKEY_LOGRAWABOVE, KEY_LOGRAWBELOW, KEY_LOGREADLAG, KEY_RESPAWNKEY_BIND, KEY_BINDNAME, KEY_CONVERT, KEY_DESCRIPTION, KEY_SENSORNAMEALTERNATEHOST, ALTERNATEPORT, KEY_EXPORTPORT, KEY_REGISTRYHOST, KEY_REGISTRYPORTKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORNAMING_EXTENSIONCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Modifier | Constructor and Description |
|---|---|
protected |
SolZSensor()
Empty constructor, do not use.
|
|
SolZSensor(Map qualify)
Constructs a fully-qualified sol z sensor.
|
| Modifier and Type | Method and Description |
|---|---|
protected double |
calculateZ(Date now)
Calculate the cosine of the solar zenith distance at the given time.
|
void |
deriveAt(double raw)
The implementation of the deriving interface.
|
SiderealTiming |
getSiderealTiming()
Returns the
SiderealTiming instance used to convert system
time to sidereal time. |
Site |
getSite()
Returns the
Site instance this sensor was constructed for. |
SolarPosition |
getSolarPosition()
Returns the
SolarPosition instance used to calculate the
Sun's position out of the actual date. |
protected void |
numericalDeriveAt(double raw)
An escape path for subclasses of sol z sensor that want to use the
original numerical derivator.
|
void |
predictFrom(double lastraw)
Predicts from the actual data point to the near future.
|
double |
readSensor()
Reads the sensor.
|
boolean |
validReading()
The solar height sensor is always valid if the observing site is defined.
|
addWeatherListener, conductOneMeasure, currentlyClear, currentlyRetarding, generateDataEvent, getMinClearUpTime, getSensorInitInfo, goodFromDerivative, goodFromPredict, goodFromRaw, goodFromSmooth, isDerivativeRetard, isPredictRetard, isRawRetard, isSmoothRetard, judgeWeather, notifyWeatherListener, removeWeatherListener, statusgetDerivativeFormat, getDerivativeToggleInfo, getDerivator, getLastDerivative, isDerivativeAdvise, isDeriving, newData, regetDerive, registerDerivatorgetLastSmooth, getSmoother, getSmoothToggleInfo, isSmoothAdvise, isSmoothing, regetSmooth, registerSmoother, smoothOnegetExtrapolation, getLastPredict, getPredictToggleInfo, init, isPredictAdvise, isPredicting, isReliable, regetPredictcumulateOne, getLastRaw, getLastTime, getMaxSize, getMemory, getSizeaddDataListener, addRmiDataListener, exit, getRawFormat, getSigmaFormat, removeDataListener, removeRmiDataListener, reportcancel, equals, getRawToggleInfo, getReading, getRespawn, getTimeOfRead, hashCode, initSensorTimerTask, isReady, regetRaw, setTimeOfRead, validReadingaddRmiErrorListener, createSensor, getBindName, getConvert, getSensorDescription, getSensorName, notifyErrorListener, removeRmiErrorListener, setConvert, toStringbindToRegistry, bindToRegistry, bindToRegistry, bindToRegistry, bindToRegistry, bindToRegistry, casterExit, casterExit, getBindName, isValid, unbindFromRegistry, unbindFromRegistrycontainsRemoteProperty, getRemoteProperties, getRemoteProperty, setRemotePropertyclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, 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, parseObject, reload, removeProperty, requires, rescanned, setObject, setProperties, setProperty, stringPropertiesfinalize, getClass, notify, notifyAll, wait, wait, waitcumulateOne, getLastRaw, getLastTime, getMaxSize, getSize, getTimeOfRead, regetRawbindToRegistry, isValid, unbindFromRegistrydefaultBoolean, 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, stringPropertiespublic static final String KEY_SITE
public static final String KEY_SIDEREAL
public static final String KEY_SOLARPOSITION
private static Class DEFSITE
private static Class DEFSID
private static Class DEFSOL
private static final String DEFRAW
private static final String DEFZ
private static final String DEFINVERSE
private static final Map DEFPROP
private Site place
private SiderealTiming sidereal
private SolarPosition sol
private double sid
protected SolZSensor()
throws RemoteException
RemoteExceptionpublic SolZSensor(Map qualify) throws ClassNotFoundException, InstantiationException, IllegalAccessException, RemoteException
group - The ThreadGroup this thread belongs to.name - The name of this thread (sensor).qualify - The Map object describing this sensor.ClassNotFoundException - Should never be thrown, only on implementation errors.InstantiationException - Should never be thrown, only on implementation errors.IllegalAccessException - Should never be thrown, only on implementation errors.RemoteExceptionpublic double readSensor()
readSensor in class TimerTaskSensorConvertToPhysicalprotected double calculateZ(Date now)
readSensor() method.public boolean validReading()
validReading in interface Telemeteringpublic Site getSite()
Site instance this sensor was constructed for.
Use of the fully qualified constructor guarantess that this property is
set.public SiderealTiming getSiderealTiming()
SiderealTiming instance used to convert system
time to sidereal time. Care must be taken to register the right
calculator for the systems clock time zone.public SolarPosition getSolarPosition()
SolarPosition instance used to calculate the
Sun's position out of the actual date.public void deriveAt(double raw)
SiderealTiming.SOL_TO_SID. To avoid recalculation of the sidereal
time, the raw-reading value (i.e. the cosine of the solar zenith
distance) is used in this method. Though the sidereal time was set at the
last calculation of sensor-raw, this sid is used to determine the sign of
the derivative.deriveAt in interface DerivingderiveAt in class DerivativeSensorraw - The actual raw reading of the sensor.public void predictFrom(double lastraw)
predictFrom in interface PredictingpredictFrom in class PredictiveSensorlastraw - The current raw measurementprotected void numericalDeriveAt(double raw)