Crate rust_grib_decoder

Crate rust_grib_decoder 

Source
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§

param_alias

Structs§

DecodedField
Decoded field helper returned by high-level decoders.
FileSummary
File-level summary
Grib1Decoded
Grib1LatLonGrid
GRIB1 regular lat/lon grid metadata (similar layout to GRIB2 helper)
Grib2LatLonGrid
GRIB2 regular lat/lon grid metadata (template 3.0)
MessageSummary
Message-level summary for diagnostics and matching
ProbeField
Probe result entry returned by probe_all_fields_at_lat_lon.
Template42Params
Template42 params extracted from a Section5 payload

Enums§

MatchReason
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 the grib crate 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; None if 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 / MessageSummary for diagnostics.