bufr2synop 0.24.0
|
file with the code to read table B data (code and flag tables) More...
#include "bufrdeco.h"
Go to the source code of this file.
Macros | |
#define | BUFR_TABLEB_CHANGED_BITS (1) |
#define | BUFR_TABLEB_CHANGED_SCALE (2) |
#define | BUFR_TABLEB_CHANGED_REFERENCE (4) |
Functions | |
int | bufr_read_tableB (struct bufrdeco *b) |
int | bufr_restore_original_tableB_item (struct bufr_tableB *tb, struct bufrdeco *b, uint8_t mode, char *key) |
Restores the original table B parameters for a BUFR descriptor. More... | |
int | bufr_find_tableB_index (buf_t *index, struct bufr_tableB *tb, const char *key) |
found a descriptor index in a struct bufr_tableB More... | |
int | bufrdeco_tableB_compressed (struct bufrdeco_compressed_ref *r, struct bufrdeco *b, struct bufr_descriptor *d, int mode) |
get data from table B when parsing compressed data references More... | |
int | bufrdeco_tableB_val (struct bufr_atom_data *a, struct bufrdeco *b, struct bufr_descriptor *d) |
Get data from a table B descriptor. More... | |
Variables | |
const int32_t | pow10pos_int [10] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000} |
const double | pow10pos [8] = {1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, 10000000.0} |
const double | pow10neg [8] = {1.0, 0.1, 0.01, 0.001, 0.0001, 0.00001, 0.000001, 0.0000001} |
file with the code to read table B data (code and flag tables)
Definition in file bufrdeco_tableB.c.
#define BUFR_TABLEB_CHANGED_BITS (1) |
Definition at line 26 of file bufrdeco_tableB.c.
#define BUFR_TABLEB_CHANGED_REFERENCE (4) |
Definition at line 28 of file bufrdeco_tableB.c.
#define BUFR_TABLEB_CHANGED_SCALE (2) |
Definition at line 27 of file bufrdeco_tableB.c.
int bufr_find_tableB_index | ( | buf_t * | index, |
struct bufr_tableB * | tb, | ||
const char * | key | ||
) |
found a descriptor index in a struct bufr_tableB
index | pointer to a size_t where to set the result if success |
tb | pointer to struct bufr_tableB where are stored all table B data |
key | descriptor string in format FXXYYY |
Definition at line 205 of file bufrdeco_tableB.c.
References bufr_descriptor::c, bufr_tableB::item, bufr_tableB::num, uint32_t_to_descriptor(), bufr_descriptor::x, bufr_tableB_decoded_item::x, bufr_tableB::x_start, bufr_descriptor::y, bufr_tableB_decoded_item::y, and bufr_tableB::y_ref.
Referenced by bufr_restore_original_tableB_item(), bufrdeco_fprint_tree_recursive(), and bufrdeco_print_json_tree_recursive().
int bufr_read_tableB | ( | struct bufrdeco * | b | ) |
Definition at line 42 of file bufrdeco_tableB.c.
References bufr_tables::b, BUFR_MAXLINES_TABLEB, bufr_descriptor::c, bufr_tableB_decoded_item::changed, CSV_MAXL, bufrdeco::error, bufr_tableB::item, bufr_tableB_decoded_item::key, bufr_tableB_decoded_item::name, bufr_tableB_decoded_item::nbits, bufr_tableB_decoded_item::nbits_ori, bufr_tableB::nlines, bufr_tableB::num, bufr_tableB::old_path, parse_csv_line(), bufr_tableB::path, bufr_tableB_decoded_item::reference, bufr_tableB_decoded_item::reference_ori, bufr_tableB_decoded_item::scale, bufr_tableB_decoded_item::scale_ori, bufrdeco::tables, uint32_t_to_descriptor(), bufr_tableB_decoded_item::unit, bufr_tableB::wmo_table, bufr_descriptor::x, bufr_tableB_decoded_item::x, bufr_tableB::x_start, bufr_descriptor::y, bufr_tableB_decoded_item::y, and bufr_tableB::y_ref.
Referenced by bufr_read_tables().
int bufr_restore_original_tableB_item | ( | struct bufr_tableB * | tb, |
struct bufrdeco * | b, | ||
uint8_t | mode, | ||
char * | key | ||
) |
Restores the original table B parameters for a BUFR descriptor.
tb | pointer to struct bufr_tableB where are stored all table B data |
b | pointer to the basic struct bufrdeco |
mode | integer with bit mask about changed parameteres by operator descriptors |
key | descriptor string in format FXXYYY |
Definition at line 163 of file bufrdeco_tableB.c.
References bufr_find_tableB_index(), BUFR_TABLEB_CHANGED_BITS, BUFR_TABLEB_CHANGED_REFERENCE, BUFR_TABLEB_CHANGED_SCALE, bufrdeco_assert, bufr_tableB_decoded_item::changed, bufrdeco::error, bufr_tableB::item, bufr_tableB_decoded_item::nbits, bufr_tableB_decoded_item::nbits_ori, bufr_tableB_decoded_item::reference, bufr_tableB_decoded_item::reference_ori, bufr_tableB_decoded_item::scale, and bufr_tableB_decoded_item::scale_ori.
int bufrdeco_tableB_compressed | ( | struct bufrdeco_compressed_ref * | r, |
struct bufrdeco * | b, | ||
struct bufr_descriptor * | d, | ||
int | mode | ||
) |
get data from table B when parsing compressed data references
r | pointer to a struct bufrdeco_compressed_ref where to set results |
b | basic container struct bufrdeco |
d | pointer to the reference struct bufr_descriptor |
mode | If 0 then we are getting the data itself for a descriptor. If mode = 1 then we are dealing with associated bits |
Definition at line 250 of file bufrdeco_tableB.c.
References bufrdeco_decoding_data_state::added_bit_length, bufrdeco_decoding_data_state::added_scale, bufrdeco_decoding_data_state::assoc_bits, bufr_tables::b, bufrdeco_compressed_ref::bit0, bufrdeco_decoding_data_state::bit_offset, bufrdeco_compressed_ref::bits, bufrdeco_assert, bufr_descriptor::c, bufrdeco_decoding_data_state::changing_reference, bufrdeco_compressed_ref::cref0, bufrdeco_compressed_ref::desc, bufrdeco::error, bufrdeco_compressed_ref::escale, bufrdeco_decoding_data_state::fixed_ccitt, get_bits_as_char_array(), get_bits_as_uint32_t(), get_table_b_reference_from_uint32_t(), bufrdeco_compressed_ref::has_data, bufrdeco_compressed_ref::inc_bits, is_a_delayed_descriptor(), is_a_local_descriptor(), is_a_short_delayed_descriptor(), bufrdeco_compressed_ref::is_associated, bufr_tableB::item, bufrdeco_decoding_data_state::local_bit_reserved, bufrdeco_compressed_ref::name, bufr_tableB_decoded_item::name, bufr_tableB_decoded_item::nbits, bufr_sec4::raw, bufrdeco_compressed_ref::ref, bufrdeco_compressed_ref::ref0, bufr_tableB_decoded_item::reference, bufr_tableB_decoded_item::reference_ori, bufr_tableB_decoded_item::scale, bufrdeco::sec3, bufrdeco::sec4, bufrdeco::state, strcpy_safe, bufr_sec3::subsets, bufrdeco::tables, bufrdeco_compressed_ref::unit, bufr_tableB_decoded_item::unit, bufr_descriptor::x, bufr_tableB::x_start, bufr_descriptor::y, and bufr_tableB::y_ref.
Referenced by bufrdeco_decode_replicated_subsequence_compressed(), and bufrdeco_parse_compressed_recursive().
int bufrdeco_tableB_val | ( | struct bufr_atom_data * | a, |
struct bufrdeco * | b, | ||
struct bufr_descriptor * | d | ||
) |
Get data from a table B descriptor.
a | pointer to a struct bufr_atom_data where to set the results |
b | pointer to the basic struct bufrdeco |
d | pointer to the target descriptor |
Definition at line 451 of file bufrdeco_tableB.c.
References 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, bufr_atom_data::associated, bufr_tables::b, bufrdeco_decoding_data_state::bit_offset, bufrdeco_explained_flag_val(), bufrdeco_explained_table_val(), bufr_descriptor::c, bufr_tables::c, bufrdeco_decoding_data_state::changing_reference, bufr_atom_data::ctable, bufr_atom_data::cval, bufr_atom_data::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_decoding_data_state::dstat_active, bufrdeco::error, bufr_atom_data::escale, bufrdeco_decoding_data_state::factor_reference, bufrdeco_decoding_data_state::fixed_ccitt, get_bits_as_char_array(), get_bits_as_uint32_t(), get_table_b_reference_from_uint32_t(), is_a_local_descriptor(), bufr_tableB::item, bufrdeco_decoding_data_state::local_bit_reserved, bufr_atom_data::mask, MISSING_INTEGER, MISSING_REAL, bufr_atom_data::name, bufr_tableB_decoded_item::name, bufr_tableB_decoded_item::nbits, pow10neg, pow10pos, bufr_sec4::raw, bufr_tableB_decoded_item::reference, bufr_tableB_decoded_item::scale, bufrdeco::sec4, bufrdeco::state, strcpy_safe, bufr_tableB_decoded_item::tableC_ref, bufrdeco::tables, bufr_atom_data::unit, bufr_tableB_decoded_item::unit, bufr_atom_data::val, bufr_descriptor::x, bufr_tableB::x_start, bufr_descriptor::y, and bufr_tableB::y_ref.
Referenced by bufrdeco_decode_replicated_subsequence(), and bufrdeco_decode_subset_data_recursive().
const double pow10neg[8] = {1.0, 0.1, 0.01, 0.001, 0.0001, 0.00001, 0.000001, 0.0000001} |
Definition at line 32 of file bufrdeco_tableB.c.
Referenced by bufrdeco_tableB_val().
const double pow10pos[8] = {1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, 10000000.0} |
Definition at line 31 of file bufrdeco_tableB.c.
Referenced by bufrdeco_tableB_val().
const int32_t pow10pos_int[10] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000} |
Definition at line 30 of file bufrdeco_tableB.c.
Referenced by bufrdeco_parse_f2_compressed(), and bufrdeco_parse_f2_descriptor().