rust-grib-decoder
Utilities to decode GRIB2 CCSDS/AEC (template 5.0=42) payloads and to extract Section 7 payloads on a per-message basis.
This crate provides a small, focused set of helpers useful for tooling and CLI utilities:
read_grib2_section7_payloads_by_message(path: &Path) -> Result<Vec<Vec<u8>>, String>read_first_grib2_section7_payload(path: &Path) -> Result<Vec<u8>, String>read_grib2_section5_template42_params_by_message(path: &Path) -> Result<Vec<Option<Template42Params>>, String>decode_template42_rust_from_params_with_payload(...)(pure-Rustrust-aecdecoder)probe_all_fields_at_lat_lon(path, lat, lon)— convenience probe helpersummarize_file(path) -> FileSummaryandfind_candidates_for_param(path, param)— CLI diagnostics helpers
Quickstart ✨
Add to your Cargo.toml (crates.io):
= "0.1"
For local/workspace development use the path override:
# Local development
# rust-grib-decoder = { path = "crates/rust-grib-decoder", default-features = true }
Usage example
use Path;
use ;
let path = new;
let grid = read_first_grib2_latlon_grid?;
if let Ok = decode_template42_first_message
Documentation & publishing
Before publishing, ensure repository and authors in Cargo.toml are set and a LICENSE file is present.
(See examples/ for runnable examples. This crate includes an extract_param example that shows how to summarize a file, find candidate messages for a parameter like msl or 2t, and decode an interpolated value at a lon/lat: cargo run -p rust-grib-decoder --example extract_param -- file.grib2 msl 113.363 22.962.)