bufr2synop 0.24.0
|
This file has the code to deal with compressed bufr reports. More...
#include "bufrdeco.h"
Go to the source code of this file.
This file has the code to deal with compressed bufr reports.
Definition in file bufrdeco_compressed.c.
int bufr_decode_subset_data_compressed | ( | struct bufrdeco_subset_sequence_data * | s, |
struct bufrdeco_compressed_data_references * | r, | ||
struct bufrdeco * | b | ||
) |
Get data for a given subset in a compressed data bufr.
s | pointer to a struct bufrdeco_subset_sequence_data where to set the results |
r | pointer to the struct bufrdeco_compressed_data_references with the info about how and where to get the data |
b | basic container struct bufrdeco |
Definition at line 965 of file bufrdeco_compressed.c.
References BUFRDECO_COMPRESSED_REF_DATA_DESCRIPTOR_BITMASK, BUFRDECO_COMPRESSED_REF_OPERATOR_DESCRIPTOR, BUFRDECO_COMPRESSED_REF_REPLICATOR_DESCRIPTOR, BUFRDECO_COMPRESSED_REF_SEQUENCE_FINAL_BITMASK, BUFRDECO_COMPRESSED_REF_SEQUENCE_INIT_BITMASK, bufrdeco_get_atom_data_from_compressed_data_ref(), bufrdeco_increase_data_array(), BUFRDECO_OUTPUT_JSON_SUBSET_DATA, bufrdeco_print_json_object_atom_data(), bufrdeco_print_json_object_operator_descriptor(), bufrdeco_print_json_object_replicator_descriptor(), bufrdeco_print_json_separator(), bufrdeco_print_json_sequence_descriptor_final(), bufrdeco_print_json_sequence_descriptor_header(), bufrdeco_print_json_subset_data_epilogue(), bufrdeco_print_json_subset_data_prologue(), bufrdeco_compressed_ref::desc, bufrdeco_subset_sequence_data::dim, bufrdeco::error, bufrdeco_compressed_ref::is_associated, bufrdeco_compressed_ref::mask, bufrdeco::mask, bufrdeco_subset_sequence_data::nd, bufrdeco_compressed_data_references::nd, bufrdeco::out, bufrdeco_compressed_data_references::refs, bufrdeco_compressed_ref::replicated_desc, bufrdeco_compressed_ref::replicated_loop, bufrdeco_compressed_ref::replicated_ndesc, bufrdeco_compressed_ref::replicated_nloop, bufrdeco_compressed_ref::seq, bufrdeco_subset_sequence_data::sequence, bufrdeco_subset_sequence_data::ss, bufrdeco::state, and bufrdeco_decoding_data_state::subset.
Referenced by bufrdeco_decode_data_subset().
int bufrdeco_decode_replicated_subsequence_compressed | ( | struct bufrdeco_compressed_data_references * | r, |
struct bufr_replicator * | rep, | ||
struct bufrdeco * | b | ||
) |
decodes a repicated subsequence
r | pointer to target struct bufrdeco_compressed_data_references where to set results |
rep | pointer to a replicator which contains the data for replication |
b | basic container struct bufrdeco |
Definition at line 352 of file bufrdeco_compressed.c.
References bufr_sequence_index_range::active, bufrdeco_decoding_data_state::assoc_bits, bufrdeco::bitmap, bufrdeco_bitmap::bitmap_to, bufrdeco_compressed_ref::bitmap_to, bufrdeco_decoding_data_state::bitmaping, bufrdeco_compressed_ref::bits, bufrdeco_bitmap_array::bmap, BUFR_MAX_QUALITY_DATA, bufrdeco_add_to_bitmap(), BUFRDECO_COMPRESSED_REF_DATA_DESCRIPTOR_BITMASK, BUFRDECO_COMPRESSED_REF_OPERATOR_DESCRIPTOR, BUFRDECO_COMPRESSED_REF_REPLICATOR_DESCRIPTOR, bufrdeco_decode_replicated_subsequence_compressed(), bufrdeco_increase_compressed_data_references_count(), bufrdeco_parse_compressed_recursive(), bufrdeco_parse_f2_compressed(), bufrdeco_tableB_compressed(), bufrdeco_compressed_ref::desc, bufrdeco_decoding_data_state::dstat_active, bufrdeco_bitmap::dstat_desc, bufrdeco::error, bufr_descriptor::f, bufr_sequence_index_range::first, bufrdeco_compressed_ref::is_bitmaped_by, bufr_replicator::ixdel, bufr_replicator::ixrep, bufr_sequence_index_range::last, bufr_sequence::lseq, bufrdeco_compressed_ref::mask, bufrdeco_bitmap_array::nba, bufrdeco_compressed_data_references::nd, bufr_replicator::ndesc, bufrdeco_bitmap::nds, bufr_replicator::nloops, bufr_sequence::no_data_present, bufrdeco_bitmap::nq, bufrdeco_bitmap::ns1, bufrdeco_bitmap::quality, bufrdeco_decoding_data_state::quality_active, bufrdeco_compressed_ref::ref, bufrdeco_compressed_ref::ref0, bufrdeco_compressed_data_references::refs, bufrdeco_compressed_ref::related_to, bufrdeco_compressed_ref::replicated_desc, bufrdeco_compressed_ref::replicated_loop, bufrdeco_compressed_ref::replicated_ndesc, bufrdeco_compressed_ref::replicated_nloop, bufrdeco_bitmap::retain, bufrdeco_decoding_data_state::retained_active, bufr_replicator::s, bufrdeco_compressed_ref::seq, bufr_sequence::sons, bufrdeco_bitmap::stat1, bufrdeco_decoding_data_state::stat1_active, bufrdeco_bitmap::stat1_desc, bufrdeco::state, bufrdeco_bitmap::subs, bufrdeco_decoding_data_state::subs_active, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_decode_replicated_subsequence_compressed(), and bufrdeco_parse_compressed_recursive().
int bufrdeco_get_atom_data_from_compressed_data_ref | ( | struct bufr_atom_data * | a, |
struct bufrdeco_compressed_ref * | r, | ||
buf_t | subset, | ||
struct bufrdeco * | b | ||
) |
Get atom data from a descriptor for a given subset.
a | pointer to the target struct bufr_atom_data where to set the results |
r | pointer to the struct bufrdeco_compressed_ref with the info to know how and where get the data |
subset | index for solicited subset. First subset has index 0 |
b | basic container struct bufrdeco |
Definition at line 742 of file bufrdeco_compressed.c.
References bufr_atom_data::associated, bufr_tables::b, bufrdeco_compressed_ref::bit0, bufr_atom_data::bitmap_to, bufrdeco_compressed_ref::bitmap_to, bufrdeco_compressed_ref::bits, bufrdeco_explained_flag_val(), bufrdeco_explained_table_val(), bufr_descriptor::c, bufr_tables::c, bufrdeco_compressed_ref::cref0, bufr_atom_data::ctable, bufr_atom_data::cval, bufr_atom_data::desc, bufrdeco_compressed_ref::desc, DESCRIPTOR_HAVE_CODE_TABLE_STRING, DESCRIPTOR_HAVE_FLAG_TABLE_STRING, DESCRIPTOR_HAVE_STRING_VALUE, DESCRIPTOR_IS_CODE_TABLE, DESCRIPTOR_IS_FLAG_TABLE, DESCRIPTOR_IS_LOCAL, DESCRIPTOR_VALUE_MISSING, bufrdeco::error, bufr_atom_data::escale, bufrdeco_compressed_ref::escale, get_bits_as_char_array(), get_bits_as_uint32_t(), bufrdeco_compressed_ref::has_data, bufrdeco_compressed_ref::inc_bits, is_a_local_descriptor(), bufrdeco_compressed_ref::is_associated, bufr_atom_data::is_bitmaped_by, bufrdeco_compressed_ref::is_bitmaped_by, bufr_tableB::item, bufr_atom_data::mask, MISSING_INTEGER, MISSING_REAL, bufr_atom_data::name, bufrdeco_compressed_ref::name, bufr_sec4::raw, bufrdeco_compressed_ref::ref, bufrdeco_compressed_ref::ref0, bufr_atom_data::related_to, bufrdeco_compressed_ref::related_to, bufrdeco::sec4, bufr_tableB_decoded_item::tableC_ref, bufrdeco::tables, bufr_atom_data::unit, bufrdeco_compressed_ref::unit, bufr_atom_data::val, bufr_descriptor::x, bufr_tableB::x_start, bufr_descriptor::y, and bufr_tableB::y_ref.
Referenced by bufr_decode_subset_data_compressed().
int bufrdeco_increase_compressed_data_references_count | ( | struct bufrdeco_compressed_data_references * | r, |
struct bufrdeco * | b | ||
) |
Increment the count of a struct bufrdeco_compressed_data_references.
r | pointer to the target struct |
b | pointer to the current active struct bufrdeco |
Definition at line 1089 of file bufrdeco_compressed.c.
References BUFR_NMAXSEQ, bufrdeco::error, and bufrdeco_compressed_data_references::nd.
Referenced by bufrdeco_decode_replicated_subsequence_compressed(), and bufrdeco_parse_compressed_recursive().
int bufrdeco_parse_compressed | ( | struct bufrdeco_compressed_data_references * | r, |
struct bufrdeco * | b | ||
) |
Preliminary parse of a compressed data bufr.
r | pointer to a struct bufrdeco_compressed_data_references where to set the results |
b | basic container struct bufrdeco |
When a bufr report has compressed data, it is needed to do a first parse step to get references about where to find the data for every descriptor in subsets. This is what this function does. If succeeded the struct r will have all needed data to decode individual subsets.
Also be mind that the descriptors tree have to be already parsed when calling this function
Definition at line 40 of file bufrdeco_compressed.c.
References bufrdeco_init_compressed_data_references(), bufrdeco_parse_compressed_recursive(), bufrdeco::error, bufrdeco_expanded_tree::nseq, and bufrdeco::tree.
Referenced by bufrdeco_decode_data_subset(), and bufrdeco_get_target_subset_sequence_data().
int bufrdeco_parse_compressed_recursive | ( | struct bufrdeco_compressed_data_references * | r, |
struct bufr_sequence * | l, | ||
struct bufrdeco * | b | ||
) |
Parse recursively the compressed data in a bufr report to get references where to get data for every descriptor in a subset.
r | pointer to target struct bufrdeco_compressed_data_references where to set results |
l | pointer to a struct bufr_sequence to parse in this call. If NULL then it is first root sequence |
b | basic container struct bufrdeco |
Definition at line 76 of file bufrdeco_compressed.c.
References bufr_sequence_index_range::active, bufrdeco_decoding_data_state::added_bit_length, bufrdeco_decoding_data_state::added_reference, bufrdeco_decoding_data_state::added_scale, bufrdeco_decoding_data_state::assoc_bits, bufrdeco_decoding_data_state::bit_offset, bufrdeco_decoding_data_state::bitmap, bufrdeco::bitmap, bufrdeco_decoding_data_state::bitmaping, bufrdeco_bitmap_array::bmap, BUFR_MAX_QUALITY_DATA, BUFRDECO_COMPRESSED_REF_DATA_DESCRIPTOR_BITMASK, BUFRDECO_COMPRESSED_REF_OPERATOR_DESCRIPTOR, BUFRDECO_COMPRESSED_REF_REPLICATOR_DESCRIPTOR, BUFRDECO_COMPRESSED_REF_SEQUENCE_FINAL_BITMASK, BUFRDECO_COMPRESSED_REF_SEQUENCE_INIT_BITMASK, bufrdeco_decode_replicated_subsequence_compressed(), bufrdeco_increase_compressed_data_references_count(), bufrdeco_parse_compressed_recursive(), bufrdeco_parse_f2_compressed(), bufrdeco_tableB_compressed(), bufr_descriptor::c, bufrdeco_decoding_data_state::changing_reference, bufrdeco_compressed_ref::desc, bufrdeco_decoding_data_state::dstat_active, bufrdeco_bitmap::dstat_desc, bufrdeco::error, bufr_descriptor::f, bufrdeco_decoding_data_state::factor_reference, bufr_sequence_index_range::first, bufrdeco_decoding_data_state::fixed_ccitt, bufr_replicator::ixdel, bufr_replicator::ixrep, bufrdeco_decoding_data_state::local_bit_reserved, bufr_sequence::lseq, bufrdeco_compressed_ref::mask, bufrdeco_bitmap_array::nba, bufrdeco_compressed_data_references::nd, bufr_replicator::ndesc, bufr_sequence::ndesc, bufrdeco_bitmap::nds, bufr_replicator::nloops, bufr_sequence::no_data_present, bufrdeco_bitmap::ns1, bufrdeco_decoding_data_state::quality_active, bufrdeco_compressed_ref::ref0, bufrdeco_compressed_data_references::refs, bufrdeco_decoding_data_state::retained_active, bufr_replicator::s, bufrdeco_expanded_tree::seq, bufrdeco_compressed_ref::seq, bufr_sequence::sons, bufrdeco_decoding_data_state::stat1_active, bufrdeco_bitmap::stat1_desc, bufrdeco::state, bufrdeco_decoding_data_state::subs_active, bufrdeco::tree, bufr_descriptor::x, and bufr_descriptor::y.
Referenced by bufrdeco_decode_replicated_subsequence_compressed(), bufrdeco_parse_compressed(), and bufrdeco_parse_compressed_recursive().