5 Log Files
Mark Jessop edytuje tę stronę 2020-06-07 22:00:12 +09:30

Two types of log files are created in auto_rx/log:

  • 'System' Log files, which log things like scan results and errors. By default these are not written, but can be enabled using the --systemlog command-line argument. If enabled, these are written to log/<timestamp>_system.log, where the timestamp is set based on when auto_rx.py was started.
  • 'Sonde' Log files, which log radiosonde telemetry on a per-sonde basis. These are written to <timestamp>_<serial>_<sondetype>_<frequency>_sonde.log, where timestamp is the first time the sonde with a given serial number was heard. These are in a simple CSV format described below.

If running auto_rx via systemd, then all log messages are also written to /var/log/syslog, which is automatically rotated to save disk space. The auto_rx specific messages can be extracted from this log file using:

$ cat /var/log/syslog | grep auto_rx

Sonde Log Format

The sonde log files are in comma-separated-value format, with the following fields: 2020-06-07T11:49:45.001Z,R4930630,8242,-34.74629,138.53447,9666.5,2.7,25.4,46.2,-46.6,27.0,RS41-SG,401.500,31.1,750,10,2.8,-1,-1

Field Number Description Example Comment
0 Date / Time 2020-06-07T11:49:45.001Z ISO-8601 format
1 Serial Number R4930630
2 Sequence Number 8242 Ideally this number should be monotonically increasing throughout a flight, but some sonde types use a fairly short field, and will rollover during flight.
3 Latitude -34.74629 Decimal Degrees
4 Longitude 138.53447 Decimal Degrees
5 Altitude 9666.5 Metres (most likely above-mean-sea-level)
6 Ascent Rate 2.7 Metres/second
7 Ground Speed 25.4 Metres/second
8 Heading 46.2 Degrees True
9 Temperature -46.6 Degrees Celsius
10 Relative Humidity 27.0 Percentage (Note - the humidity calculations for most sondes are fairly crude, so should only be considered accurate to maybe 10% ).
11 Sonde Type RS41-SG The radiosonde type and/or sub-type (e.g. RS41-SGM, DFM17).
12 Frequency 401.501 Decoder centre frequency in MHz.
13 SNR 26.7 Eb/N0 Estimate from the fsk_demod decoder, in dB.
14 Frequency Error 750 Estimated signal offset from the decoder centre frequency, in Hz.
15 Num SVs 10 The number of satellites used in the sonde's GPS solution.
16 Burst Timer 08:21:15 RS41 Only - The time (HH:MM:SS) until the sonde will shut off, from either a 'burst timer' (shutdown X hours after burst), or 'kill timer' (shutdown X hours after launch).
17 Aux Data 00AABBCC..... Hexadecimal data from any attached auxiliary sensors (e.g. Ozone, Radiation)

Fields that do not have data available will be set to a nonsense value, e.g. -273 for temperature, -1 for humidity, -99 for SNR.

Log Processing Utilities

The following utilities are available to process the sonde log files generated by auto_rx.

Log File to KML

Within auto_rx/utils/ is the log_to_kml.py script, which can be used to process the sonde log files and convert them to KML.

This script requires the 'fastkml' and 'shapely' libraries, which can be installed using

$ sudo pip install fastkml shapely

Usage of this utility is as follows:

usage: log_to_kml.py [-h] [-i INPUT] [-o OUTPUT] [--clamp] [--noextrude]

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        Path to log file. May include wildcards, though the
                        path must be wrapped in quotes.
                        Default=../log/*_sonde.log
  -o OUTPUT, --output OUTPUT
                        KML output file name. Default=sondes.kml
  --clamp               Clamp tracks to ground instead of showing absolute
                        altitudes.
  --noextrude           Disable Extrusions for absolute flight paths.
  --lastonly            Only plot last-seen sonde positions, not the flight
                        paths.

For example, to process a single log file, you would call:

$ python log_to_kml.py -i ../log/path_to_log_file_sonde.log -o output.kml

You can use wildcards in the input file argument, (i.e. ../log/*_sondes.log), however these must be wrapped in quotes, else bash will auto-expand the wildcard into a list. For example:

$ python log_to_kml.py -i "../log/*_sonde.log" -o output.kml

Producing Soundings ('SkewT' Plots)

A Python script is available in the auto_rx/utils directory to produce SkewT plots from auto_rx sonde log files. Refer to the script header for more information: https://github.com/projecthorus/radiosonde_auto_rx/blob/master/auto_rx/utils/plot_sonde_log.py