XLINK 500/100 Operations & Maintenance Manual page # 183
@MEASUREMENT
def dew_point(inval):
"""
Computes dew point based on relative humidity and air
temperature.
It is assumed that two other measurements have been setup, one
called AT and another called RH.
This script should be associated with a third measurement that
is setup as a Manual Entry.
Manual Entry is used because this measurement is based on the
inputs of two other sensors rather than the
input associated with this measurement.
:param inval: this value is ignored
:return: dew point
:rtype: float
"""
from math import log10
# retrieve relative humidity from another measurement which
must be labeled RH
rh = measure("RH").value
# retrieve temperature from meas labeled AT
at = measure("AT").value
# compute dew point
dp = 0.057906 * (log10(rh/100) / 1.1805) + (at / (at+238.3))
dp = dp * 238.3 / (1 - dp)
return dp
19.2.
Transmission Formatting and Scripts
Scripts may be used to alter the data transmitted by the station. There are several standard
transmission formats including SHEF and Pseudobinary. With the use of scripts, other formats
may be achieved.
The relevant settings are
Custom Script Format
and
Format Function
.
When setup to use formatting scripts, the station will go through this flow:
Format the transmission data in a standard way. If SHEF is the chosen transmission
format, then the transmission will be formatted into SHEF. This is identical to what the
station does when there is no formatting script.
The formatting script function is invoked.
The standard formatted transmission data is provided to the script function as a
parameter.
The script may perform any action on the provided transmission data. It may simply
append additional data. Or it may completely disregard the provided transmission data
and create a completely new set of data.
The script ends by returning the new set of transmission data.
19.2.1.
Append Info Script Formatting Example
Here is the transmission data with a standard SHEF format, without scripts: