Expand description
rust-grib-decoder
Small helper library extracted from atmosGUI for decoding GRIB2 CCSDS/AEC (template 5.0=42) payloads and extracting Section 7 payloads grouped by GRIB message.
Modules§
Structs§
- Decoded
Field - Decoded field helper returned by high-level decoders.
- File
Summary - File-level summary
- Grib1
Decoded - Grib1
LatLon Grid - GRIB1 regular lat/lon grid metadata (similar layout to GRIB2 helper)
- Grib2
LatLon Grid - GRIB2 regular lat/lon grid metadata (template 3.0)
- Message
Summary - Message-level summary for diagnostics and matching
- Probe
Field - Probe result entry returned by
probe_all_fields_at_lat_lon. - Template42
Params - Template42 params extracted from a Section5 payload
Enums§
- Match
Reason - Match reason when a message matches a parameter alias
Functions§
- decode_
grib1_ first_ message - Decode the first GRIB1 message into an array of floats (supports simple packing & optional bitmap)
- decode_
grib1_ simple_ packed_ values - Decode simple-packed GRIB1 BDS packed values (supports optional bitmap)
- decode_
grib2_ first_ field - Decode the first available field in the GRIB2 file.
- decode_
template42_ first_ message - Convenience helper: decode the first template42 message in the file (if any).
Returns Ok(Some(Vec
)) if a template42 message was found and decoded successfully, Ok(None) if no suitable message was found, or Err on file/IO errors. - decode_
template42_ for_ file_ by_ message - High-level helper: read Section7 payloads and Section5 template42 params for the file, then batch decode template42 messages and return per-message decoded arrays (or None).
- decode_
template42_ from_ payload_ list - Batch decode a list of Section7 payload slices using corresponding template42 params.
Returns a Vec of Option<Vec
> where None indicates no params or decode skipped/failed. - decode_
template42_ rust_ from_ params - Read first Section7 payload and decode template 5.0=42 using it (convenience wrapper)
- decode_
template42_ rust_ from_ params_ with_ payload - Decode template 5.0=42 using rust-aec given a Section7 payload and template params
- decode_
template42_ try_ message_ payload - Try to decode a specific message index using its Section7 payload if available; otherwise fall back to using the first Section7 payload in the file. Useful when per-message payload discovery may be unreliable.
- detect_
grib_ edition - Detect GRIB edition: returns 1 or 2
- find_
candidates_ for_ param - Find candidate messages for a parameter (using the existing alias matching heuristics).
- has_
grib_ support - Return whether this crate was compiled with
grib-support(enables using thegribcrate paths) - parse_
grib1_ latlon_ grid - Parse a GRIB1 message and extract a lat/lon grid (returns (grid, data_representation_type))
- probe_
all_ fields_ at_ lat_ lon - Probe all fields (GRIB1 and GRIB2) at a lat/lon and return Vec
. For GRIB2 this delegates to probe_all_grib2_latlon. For GRIB1 a message-by-message scan is performed. - probe_
all_ grib2_ latlon - Probe all GRIB2 fields at a lat/lon and return Vec
. Uses the grib crate (requires grib-support) and the crate’s decoding helpers to fetch/compute values. - read_
all_ grib2_ section7_ payloads - Read all Section7 payloads and return them in discovery order (may be empty)
- read_
first_ grib2_ latlon_ grid - Read the first GRIB2 regular lat/lon grid (template 3.0) from the file and return metadata.
- read_
first_ grib2_ section7_ payload - Read first Section7 payload (returns payload of the first Section7 found in the file)
- read_
grib1_ first_ message - Read the first GRIB1 message from file (returns the raw message bytes)
- read_
grib2_ section4_ parameter_ ids_ by_ message - Read Section4 (Product Definition Section) parameter identifiers per GRIB message in file order. Returns Vec where each entry is Some((discipline, category, number)) if Section4 present and fields可解析.
- read_
grib2_ section5_ template42_ params_ by_ message - Read Section5 template 5.0=42 parameters per GRIB message in file order.
Returns a Vec where each entry corresponds to a GRIB message;
Noneif the message does not contain a template 5.0=42 in its Section5 or if Section5 is missing. - read_
grib2_ section7_ payloads_ by_ message - Read Section 7 payloads grouped by GRIB message (message order). Returns Vec of payload bytes found for each message in order (messages with no Section7 are skipped).
- summarize_
file - Summarize a GRIB file into
FileSummary/MessageSummaryfor diagnostics.