rweather-decoder
Decoders of various weather reports.
The decoders are command-line interface (CLI) applications that store decoded reports in JSON files, which are suitable for further machine processing.
Roadmap
- METAR / SPECI
- header, wind, visibility, clouds, temperature, dew point, pressure
- runway visual range, present and recent weather, wind shear, sea
- TREND
- REMARK
- TAF
- SYNOP
- ACARS
- ISD
Installation
To use this crate, you need to have Rust and Cargo installed on your machine. To install Rust, visit the official Rust website at https://www.rust-lang.org/learn/get-started and follow the installation instructions for the given operating system. Rust provides an installer that will install both Rust and Cargo.
After, run the following command:
[filip@fractal ~]$ cargo install rweather-decoder
Cargo will download the crate from the Rust package repository and compile it on your system. After the installation is complete, you can start using the CLI decoders.
Usage
To decode METAR reports, use the decode-metar CLI application, see the help:
[filip@fractal ~]$ decode-metar --help
rweather-decoder 0.2.0
CLI decoder of METAR reports
USAGE:
decode-metar [FLAGS] [OPTIONS] <input-globs>... <output>
FLAGS:
-h, --help Prints help information
-p, --pretty-print Enable pretty-printing of output JSON file
-q, --quiet Quiet
-V, --version Prints version information
OPTIONS:
-a, --anchor-time <anchor-time> Anchor time (YYYY-MM-DD) for the plain file format. Specifies a day close to the
one when the reports were collected. If given, the individual METAR day will be
matched against it to create a proper datetime representation
-f, --file-format <file-format> METAR file format (noaa-metar-cycles, plain) [default: noaa-metar-cycles]
ARGS:
<input-globs>... Input files (glob patterns separated by space)
<output> Output JSON file. Same input reports will be deduplicated
The decode-metar tool supports right now two METAR file formats:
- noaa-metar-cycles (default) - METAR reports stored in text files downloaded from the NOAA METAR cycles page located at https://tgftp.nws.noaa.gov/data/observations/metar/cycles/.
- plain - METAR reports stored in text files with one report per row.
Examples
To check for the latest METAR reports, visit https://tgftp.nws.noaa.gov/data/observations/metar/cycles/. From there you can download a specific file, for example 16Z.TXT (cycle 16Z), and use the decode-metar CLI tool as follows:
[filip@fractal ~]$ decode-metar -p 16Z.TXT 16Z.json
The decoded METAR reports will be saved to a JSON file 16Z.json. The -p option enables pretty-printing of the output JSON file for improved readability. The output file contains an array of decoded reports. Here is an example of a decoded METAR report for the LFBD airport (Bordeaux–Mérignac Airport):