gases_sampler - bruno-beloff/scs_dev GitHub Wiki
docs > software repositories > scs_dev > commands > environmental sampling
DESCRIPTION
The gases_sampler utility reads a set of values from a South Coast Science digital front-end (DFE) board hosting an Alphasense analogue front-end (AFE) board. The also utility reads an NDIR CO2 sensor, if the appropriate configuration document is present.
The gases_sampler utility reports raw electrode voltages, temperature-compensated voltages, and gas concentrations (in parts per billion) derived according to the relevant Alphasense application notes. If the AFE board includes a Pt1000 temperature sensor, then the gases_sampler utility may also report the Pt1000 voltage and temperature.
The DFE board supports AFEs with up to four electrochemical sensors, or three electrochemical sensors plus one photo-ionisation detector (PID). Before using the gases_sampler utility, the configuration of the AFE must be specified using the scs_mfr/afe_calib utility.
Temperature must be known in order to perform a simple data interpretation. The gases_sampler utility applies an order of precedence for temperature sources, depending on availability:
- Sensirion SHT in A4 package
- Free-to-air Sensirion SHT
- AFE Pt1000 sensor
The presence of the DFE subsystem, and the availability of the Pt1000 sensor on the AFE is specified using the scs_mfr/interface_conf utility. The configuration of Sensirion SHT sensor(s) is specified using the scs_mfr/sht_conf utility.
Gas concentrations for each sensor are adjusted according to a baseline value, which is specified using the scs_mfr/afe_baseline utility. This provides a simple way of managing zero-offset drift for each sensor expressed in parts per billion.
The gases_sampler writes its output to stdout. As for all sensing utilities, the output format is a JSON document with fields for:
- the unique tag of the device (if the system ID is set)
- the recording datetime in ISO 8601 format
- a value field containing the sensed values
Command-line options allow for single-shot reading, multiple readings with specified time intervals, or readings controlled by an independent scheduling process via a Unix semaphore.
SYNOPSIS
gases_sampler.py [{ -s SEMAPHORE | -i INTERVAL [-n SAMPLES] }] [{ -v | -d }]
Options | |
---|---|
--version | show program's version number and exit |
-h, --help | show this help message and exit |
-s SEMAPHORE, --semaphore=SEMAPHORE | sampling controlled by SEMAPHORE |
-i INTERVAL, --interval=INTERVAL | sampling interval in seconds |
-n SAMPLES, --samples=SAMPLES | number of samples (1 if interval not specified) |
-v, --verbose | report narrative to stderr |
-d, --debug | report detailed narrative to stderr |
EXAMPLES
./gases_sampler.py -i10
FILES
~/SCS/conf/afe_baseline.json
~/SCS/conf/afe_calib.json
~/SCS/conf/interface_conf.json
~/SCS/conf/pt1000_calib
~/SCS/conf/scd30_conf.json
~/SCS/conf/sht_conf.json
~/SCS/conf/schedule.json
~/SCS/conf/system_id.json
DOCUMENT EXAMPLE - v0
{"rec": "2021-10-11T11:00:32Z", "tag": "scs-bgx-431", "val": {"CO2": {"cnc": 417.2}, "NO2": {"weV": 0.28388, "aeV": 0.27657, "weC": 1e-05, "cnc": 15.0}, "Ox": {"weV": 0.40332, "aeV": 0.40332, "weC": 0.00015, "cnc": 43.4}, "NO": {"weV": 0.29882, "aeV": 0.28919, "weC": 0.01382, "cnc": -192.2}, "CO": {"weV": 0.30882, "aeV": 0.27632, "weC": 0.01929, "cnc": 4.1}, "sht": {"hmd": 55.4, "tmp": 16.2}}, "exg": {"vB20": {"NO2": {"cnc": 21.6}}}}
DOCUMENT EXAMPLE - v2
{"rec": "2021-10-11T15:48:19Z", "tag": "scs-be2-3", "ver": 2.0, "src": "AFE", "val": {"NO2": {"weV": 0.29019, "aeV": 0.29494, "weC": 0.00181, "cnc": 22.8, "vCal": 15.858}, "Ox": {"weV": 0.40057, "aeV": 0.39907, "weC": 0.00083, "cnc": 51.4, "vCal": 7.123, "xCal": -0.389858}, "CO": {"weV": 0.59401, "aeV": 0.27619, "weC": 0.29396, "cnc": 1159.1, "vCal": 1236.165}, "sht": {"hmd": 49.3, "tmp": 22.9}}, "exg": {"src": "vB20", "val": {"NO2": {"cnc": 22.5}}}}
SEE ALSO
scs_mfr/afe_baseline
scs_mfr/afe_calib
scs_mfr/gas_baseline
scs_mfr/gas_model_conf
scs_mfr/interface_conf
scs_mfr/pt1000_calib
scs_mfr/schedule
scs_mfr/scd30_baseline
scs_mfr/scd30_conf
scs_mfr/sht_conf
scs_mfr/system_id
RESOURCES
Data formats/Topic: gases
ISO 8601
Alphasense Application Note AAN 803-02