From 8e8a5eb2b8a641e811a8201e0f9897f42b7ae689 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 26 Jun 2020 19:37:53 +0100 Subject: [PATCH] ECC-1126: BUFR: ECMWF Local use section key 'ident' should be trimmed (Part 1) --- definitions/bufr/section.3.def | 5 +- src/CMakeLists.txt | 1 + src/Makefile.am | 1 + src/bufr_util.c | 12 +- src/grib_accessor_class.h | 1 + src/grib_accessor_class_trim.c | 212 +++++++ src/grib_accessor_classes_hash.c | 942 ++++++++++++++-------------- src/grib_accessor_factory.h | 1 + src/grib_accessor_factory_hash_list | 1 + src/grib_dumper_class_bufr_simple.c | 4 + src/grib_dumper_class_json.c | 4 +- tests/bufr_get.sh | 6 +- 12 files changed, 724 insertions(+), 466 deletions(-) create mode 100644 src/grib_accessor_class_trim.c diff --git a/definitions/bufr/section.3.def b/definitions/bufr/section.3.def index f6661e43d..5d20c60c9 100644 --- a/definitions/bufr/section.3.def +++ b/definitions/bufr/section.3.def @@ -82,8 +82,9 @@ if (section2Present && bufrHeaderCentre==98 && section2Length==52) { } else { meta ls.localLatitude bits(keyData,72,25,-9000000,100000) : dump,no_copy; meta ls.localLongitude bits(keyData,40,26,-18000000,100000) : dump,no_copy; - meta mars.ident sprintf("%s", keyMore) : string_type, no_copy; - alias ls.ident=keyMore : dump,string_type,no_copy; + meta identTrimmed trim(keyMore,1,1): no_copy, hidden; + meta mars.ident sprintf("%s", identTrimmed) : string_type, no_copy; + alias ls.ident=identTrimmed : dump,string_type,no_copy; } } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 51e478a82..ef91a859e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -184,6 +184,7 @@ list( APPEND grib_api_srcs grib_accessor_class_spectral_truncation.c grib_accessor_class_time.c grib_accessor_class_transient.c + grib_accessor_class_trim.c grib_accessor_class_transient_darray.c grib_accessor_class_values.c grib_accessor_class_simple_packing_error.c diff --git a/src/Makefile.am b/src/Makefile.am index 5a67d7535..c483bf548 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -201,6 +201,7 @@ libeccodes_la_prototypes= \ grib_accessor_class_spectral_truncation.c \ grib_accessor_class_time.c \ grib_accessor_class_transient.c \ + grib_accessor_class_trim.c \ grib_accessor_class_values.c \ grib_accessor_class_simple_packing_error.c \ grib_accessor_class_data_simple_packing.c \ diff --git a/src/bufr_util.c b/src/bufr_util.c index e44e264ca..0c4fdda41 100644 --- a/src/bufr_util.c +++ b/src/bufr_util.c @@ -261,7 +261,7 @@ static int bufr_decode_extra_rdb_keys(const void* message, long offset_section2, } } else { - size_t i = 0; + size_t i = 0, j = 0; long lValue = 0; start = 72; lValue = (long)grib_decode_unsigned_long(pKeyData, &start, 25); @@ -272,9 +272,15 @@ static int bufr_decode_extra_rdb_keys(const void* message, long offset_section2, /* interpret keyMore as a string */ for (i = 0; i < 8; ++i) { - hdr->ident[i] = *pKeyMore++; + const char c = *pKeyMore; + //printf("Lookin at %c, i=%lu, j=%lu\n", c, i, j); + if (c != ' ') { + //printf(" not space so copy to %lu\n", j); + hdr->ident[j++] = c; + } + pKeyMore++; } - hdr->ident[i] = '\0'; + hdr->ident[j] = '\0'; } return GRIB_SUCCESS; diff --git a/src/grib_accessor_class.h b/src/grib_accessor_class.h index 2d73fc61b..31292b4cb 100644 --- a/src/grib_accessor_class.h +++ b/src/grib_accessor_class.h @@ -208,6 +208,7 @@ extern grib_accessor_class* grib_accessor_class_to_integer; extern grib_accessor_class* grib_accessor_class_to_string; extern grib_accessor_class* grib_accessor_class_transient; extern grib_accessor_class* grib_accessor_class_transient_darray; +extern grib_accessor_class* grib_accessor_class_trim; extern grib_accessor_class* grib_accessor_class_uint16; extern grib_accessor_class* grib_accessor_class_uint16_little_endian; extern grib_accessor_class* grib_accessor_class_uint32; diff --git a/src/grib_accessor_class_trim.c b/src/grib_accessor_class_trim.c new file mode 100644 index 000000000..46159d7ba --- /dev/null +++ b/src/grib_accessor_class_trim.c @@ -0,0 +1,212 @@ +/* + * (C) Copyright 2005- ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * + * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by + * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. + */ + +#include "grib_api_internal.h" +/* + This is used by make_class.pl + + START_CLASS_DEF + CLASS = accessor + SUPER = grib_accessor_class_ascii + IMPLEMENTS = unpack_string;pack_string + IMPLEMENTS = init + MEMBERS= const char* input + MEMBERS= int trimleft + MEMBERS= int trimright + END_CLASS_DEF + + */ + +/* START_CLASS_IMP */ + +/* + +Don't edit anything between START_CLASS_IMP and END_CLASS_IMP +Instead edit values between START_CLASS_DEF and END_CLASS_DEF +or edit "accessor.class" and rerun ./make_class.pl + +*/ + +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static void init(grib_accessor*, const long, grib_arguments*); +static void init_class(grib_accessor_class*); + +typedef struct grib_accessor_trim +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in ascii */ + /* Members defined in trim */ + const char* input; + int trimleft; + int trimright; +} grib_accessor_trim; + +extern grib_accessor_class* grib_accessor_class_ascii; + +static grib_accessor_class _grib_accessor_class_trim = { + &grib_accessor_class_ascii, /* super */ + "trim", /* name */ + sizeof(grib_accessor_trim), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + 0, /* grib_unpack procedures double */ + &pack_string, /* grib_pack procedures string */ + &unpack_string, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ +}; + + +grib_accessor_class* grib_accessor_class_trim = &_grib_accessor_class_trim; + + +static void init_class(grib_accessor_class* c) +{ + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->value_count = (*(c->super))->value_count; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->unpack_double = (*(c->super))->unpack_double; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; +} + +/* END_CLASS_IMP */ + +static void init(grib_accessor* a, const long l, grib_arguments* arg) +{ + int n = 0; + grib_accessor_trim* self = (grib_accessor_trim*)a; + grib_handle* h = grib_handle_of_accessor(a); + + self->input = grib_arguments_get_name(h, arg, n++); + self->trimleft = grib_arguments_get_long(h, arg, n++); + self->trimright= grib_arguments_get_long(h, arg, n++); + DebugAssert(self->trimleft == 0 || self->trimleft == 1); + DebugAssert(self->trimright == 0 || self->trimright == 1); +} + +static void trim(char** x) +{ + char* p = 0; + while (**x == ' ' && **x != '\0') + (*x)++; + if (**x == '\0') + return; + p = (*x) + strlen(*x) - 1; + while (*p == ' ') { + *p = '\0'; + p--; + } + if (*p == ' ') + *p = '\0'; +} + +static int unpack_string(grib_accessor* a, char* val, size_t* len) +{ + grib_accessor_trim* self = (grib_accessor_trim*)a; + + int err = 0; + grib_handle* h = grib_handle_of_accessor(a); + char input[256] = {0,}; + size_t size = sizeof(input) / sizeof(*input); + char* pInput = input; + + err = grib_get_string(h, self->input, input, &size); + if (err) return err; + DebugAssert(size < 9); + + trim(&pInput); + sprintf(val, "%s", pInput); + size = strlen(val); + *len = size + 1; + return err; +} + +static int pack_string(grib_accessor* a, const char* val, size_t* len) +{ + char input[256] = {0,}; + + size_t inputLen = 256; + char buf[256] = {0,}; + char* pBuf = NULL; + int err; + grib_handle* h = grib_handle_of_accessor(a); + grib_accessor_trim* self = (grib_accessor_trim*)a; + grib_accessor* inputAccesstor = grib_find_accessor(h, self->input); + if (!inputAccesstor) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Accessor for %s not found", self->input); + return GRIB_NOT_FOUND; + } + + if ((err = grib_get_string(h, self->input, input, &inputLen)) != GRIB_SUCCESS) + return err; + + sprintf(buf, "%s", val); + pBuf = buf; + trim(&pBuf); + + return grib_pack_string(inputAccesstor, pBuf, len); +} diff --git a/src/grib_accessor_classes_hash.c b/src/grib_accessor_classes_hash.c index 7daa566f9..306873272 100644 --- a/src/grib_accessor_classes_hash.c +++ b/src/grib_accessor_classes_hash.c @@ -37,12 +37,12 @@ error "gperf generated tables don't work with this execution character set. Plea #line 6 "accessor_class_list.gperf" struct accessor_class_hash { char *name; grib_accessor_class **cclass;}; -#define TOTAL_KEYWORDS 226 +#define TOTAL_KEYWORDS 227 #define MIN_WORD_LENGTH 1 #define MAX_WORD_LENGTH 44 #define MIN_HASH_VALUE 1 -#define MAX_HASH_VALUE 552 -/* maximum key range = 552, duplicates = 0 */ +#define MAX_HASH_VALUE 618 +/* maximum key range = 618, duplicates = 0 */ #ifdef __GNUC__ @@ -56,32 +56,32 @@ grib_accessor_classes_get_id (const char *str, unsigned int len) { static const unsigned short asso_values[] = { - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 0, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 10, 44, - 14, 0, 24, 553, 28, 553, 0, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 0, 553, 0, 158, 74, - 0, 0, 119, 29, 145, 1, 7, 14, 146, 207, - 13, 63, 20, 553, 87, 1, 53, 103, 160, 9, - 7, 30, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 553, 553, 553, 553, 553, 553 + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 0, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 0, 60, + 18, 14, 21, 619, 23, 619, 4, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 0, 619, 0, 134, 189, + 0, 3, 187, 28, 45, 1, 17, 0, 165, 217, + 14, 64, 55, 619, 109, 3, 2, 98, 201, 3, + 1, 60, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619 }; register int hval = len; @@ -117,559 +117,589 @@ static const struct accessor_class_hash classes[] = {""}, #line 9 "accessor_class_list.gperf" {" "}, - {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, +#line 211 "accessor_class_list.gperf" + {"time", &grib_accessor_class_time}, #line 199 "accessor_class_list.gperf" {"size", &grib_accessor_class_size}, #line 14 "accessor_class_list.gperf" {"ascii", &grib_accessor_class_ascii}, + {""}, +#line 212 "accessor_class_list.gperf" + {"times", &grib_accessor_class_times}, + {""}, #line 196 "accessor_class_list.gperf" {"signed", &grib_accessor_class_signed}, - {""}, {""}, {""}, {""}, {""}, -#line 197 "accessor_class_list.gperf" - {"signed_bits", &grib_accessor_class_signed_bits}, - {""}, + {""}, {""}, #line 75 "accessor_class_list.gperf" {"data_raw_packing", &grib_accessor_class_data_raw_packing}, {""}, +#line 205 "accessor_class_list.gperf" + {"statistics", &grib_accessor_class_statistics}, #line 142 "accessor_class_list.gperf" {"int8", &grib_accessor_class_int8}, {""}, +#line 197 "accessor_class_list.gperf" + {"signed_bits", &grib_accessor_class_signed_bits}, + {""}, #line 80 "accessor_class_list.gperf" {"data_simple_packing", &grib_accessor_class_data_simple_packing}, #line 76 "accessor_class_list.gperf" {"data_secondary_bitmap", &grib_accessor_class_data_secondary_bitmap}, -#line 190 "accessor_class_list.gperf" - {"section", &grib_accessor_class_section}, -#line 176 "accessor_class_list.gperf" - {"pad", &grib_accessor_class_pad}, -#line 202 "accessor_class_list.gperf" - {"spd", &grib_accessor_class_spd}, + {""}, #line 82 "accessor_class_list.gperf" {"dictionary", &grib_accessor_class_dictionary}, - {""}, {""}, {""}, +#line 206 "accessor_class_list.gperf" + {"statistics_spectral", &grib_accessor_class_statistics_spectral}, +#line 190 "accessor_class_list.gperf" + {"section", &grib_accessor_class_section}, +#line 164 "accessor_class_list.gperf" + {"nearest", &grib_accessor_class_nearest}, #line 74 "accessor_class_list.gperf" {"data_png_packing", &grib_accessor_class_data_png_packing}, + {""}, {""}, +#line 208 "accessor_class_list.gperf" + {"step_in_units", &grib_accessor_class_step_in_units}, +#line 126 "accessor_class_list.gperf" + {"gen", &grib_accessor_class_gen}, + {""}, #line 192 "accessor_class_list.gperf" {"section_padding", &grib_accessor_class_section_padding}, #line 193 "accessor_class_list.gperf" {"section_pointer", &grib_accessor_class_section_pointer}, -#line 126 "accessor_class_list.gperf" - {"gen", &grib_accessor_class_gen}, #line 138 "accessor_class_list.gperf" {"int32", &grib_accessor_class_int32}, - {""}, #line 66 "accessor_class_list.gperf" {"data_g22order_packing", &grib_accessor_class_data_g22order_packing}, -#line 83 "accessor_class_list.gperf" - {"dirty", &grib_accessor_class_dirty}, -#line 50 "accessor_class_list.gperf" - {"data_apply_bitmap", &grib_accessor_class_data_apply_bitmap}, -#line 70 "accessor_class_list.gperf" - {"data_g2shsimple_packing", &grib_accessor_class_data_g2shsimple_packing}, {""}, -#line 88 "accessor_class_list.gperf" - {"expanded_descriptors", &grib_accessor_class_expanded_descriptors}, -#line 189 "accessor_class_list.gperf" - {"second_order_bits_per_value", &grib_accessor_class_second_order_bits_per_value}, -#line 191 "accessor_class_list.gperf" - {"section_length", &grib_accessor_class_section_length}, #line 140 "accessor_class_list.gperf" {"int64", &grib_accessor_class_int64}, -#line 53 "accessor_class_list.gperf" - {"data_apply_gdsnotpresent", &grib_accessor_class_data_apply_gdsnotpresent}, -#line 124 "accessor_class_list.gperf" - {"gds_is_present", &grib_accessor_class_gds_is_present}, -#line 51 "accessor_class_list.gperf" - {"data_apply_boustrophedonic", &grib_accessor_class_data_apply_boustrophedonic}, +#line 70 "accessor_class_list.gperf" + {"data_g2shsimple_packing", &grib_accessor_class_data_g2shsimple_packing}, #line 136 "accessor_class_list.gperf" {"int16", &grib_accessor_class_int16}, +#line 88 "accessor_class_list.gperf" + {"expanded_descriptors", &grib_accessor_class_expanded_descriptors}, + {""}, +#line 124 "accessor_class_list.gperf" + {"gds_is_present", &grib_accessor_class_gds_is_present}, + {""}, {""}, +#line 191 "accessor_class_list.gperf" + {"section_length", &grib_accessor_class_section_length}, +#line 189 "accessor_class_list.gperf" + {"second_order_bits_per_value", &grib_accessor_class_second_order_bits_per_value}, #line 127 "accessor_class_list.gperf" {"getenv", &grib_accessor_class_getenv}, -#line 121 "accessor_class_list.gperf" - {"g2step", &grib_accessor_class_g2step}, +#line 235 "accessor_class_list.gperf" + {"when", &grib_accessor_class_when}, #line 117 "accessor_class_list.gperf" {"g2grid", &grib_accessor_class_g2grid}, +#line 115 "accessor_class_list.gperf" + {"g2date", &grib_accessor_class_g2date}, +#line 121 "accessor_class_list.gperf" + {"g2step", &grib_accessor_class_g2step}, +#line 113 "accessor_class_list.gperf" + {"g2bitmap", &grib_accessor_class_g2bitmap}, + {""}, +#line 176 "accessor_class_list.gperf" + {"pad", &grib_accessor_class_pad}, +#line 116 "accessor_class_list.gperf" + {"g2end_step", &grib_accessor_class_g2end_step}, + {""}, +#line 202 "accessor_class_list.gperf" + {"spd", &grib_accessor_class_spd}, + {""}, {""}, {""}, +#line 120 "accessor_class_list.gperf" + {"g2lon", &grib_accessor_class_g2lon}, +#line 83 "accessor_class_list.gperf" + {"dirty", &grib_accessor_class_dirty}, + {""}, {""}, +#line 125 "accessor_class_list.gperf" + {"gds_not_present_bitmap", &grib_accessor_class_gds_not_present_bitmap}, + {""}, {""}, +#line 50 "accessor_class_list.gperf" + {"data_apply_bitmap", &grib_accessor_class_data_apply_bitmap}, + {""}, {""}, +#line 143 "accessor_class_list.gperf" + {"iterator", &grib_accessor_class_iterator}, #line 73 "accessor_class_list.gperf" {"data_jpeg2000_packing", &grib_accessor_class_data_jpeg2000_packing}, {""}, +#line 215 "accessor_class_list.gperf" + {"to_string", &grib_accessor_class_to_string}, +#line 53 "accessor_class_list.gperf" + {"data_apply_gdsnotpresent", &grib_accessor_class_data_apply_gdsnotpresent}, + {""}, +#line 51 "accessor_class_list.gperf" + {"data_apply_boustrophedonic", &grib_accessor_class_data_apply_boustrophedonic}, + {""}, +#line 56 "accessor_class_list.gperf" + {"data_constant_field", &grib_accessor_class_data_constant_field}, +#line 64 "accessor_class_list.gperf" + {"data_g1shsimple_packing", &grib_accessor_class_data_g1shsimple_packing}, +#line 130 "accessor_class_list.gperf" + {"gts_header", &grib_accessor_class_gts_header}, + {""}, +#line 55 "accessor_class_list.gperf" + {"data_complex_packing", &grib_accessor_class_data_complex_packing}, #line 52 "accessor_class_list.gperf" {"data_apply_boustrophedonic_bitmap", &grib_accessor_class_data_apply_boustrophedonic_bitmap}, -#line 116 "accessor_class_list.gperf" - {"g2end_step", &grib_accessor_class_g2end_step}, +#line 122 "accessor_class_list.gperf" + {"g2step_range", &grib_accessor_class_g2step_range}, + {""}, +#line 177 "accessor_class_list.gperf" + {"padding", &grib_accessor_class_padding}, + {""}, +#line 214 "accessor_class_list.gperf" + {"to_integer", &grib_accessor_class_to_integer}, #line 71 "accessor_class_list.gperf" {"data_g2simple_packing", &grib_accessor_class_data_g2simple_packing}, #line 68 "accessor_class_list.gperf" {"data_g2complex_packing", &grib_accessor_class_data_g2complex_packing}, -#line 177 "accessor_class_list.gperf" - {"padding", &grib_accessor_class_padding}, -#line 211 "accessor_class_list.gperf" - {"time", &grib_accessor_class_time}, - {""}, -#line 212 "accessor_class_list.gperf" - {"times", &grib_accessor_class_times}, -#line 120 "accessor_class_list.gperf" - {"g2lon", &grib_accessor_class_g2lon}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 64 "accessor_class_list.gperf" - {"data_g1shsimple_packing", &grib_accessor_class_data_g1shsimple_packing}, -#line 111 "accessor_class_list.gperf" - {"g2_eps", &grib_accessor_class_g2_eps}, - {""}, {""}, {""}, -#line 164 "accessor_class_list.gperf" - {"nearest", &grib_accessor_class_nearest}, -#line 72 "accessor_class_list.gperf" - {"data_g2simple_packing_with_preprocessing", &grib_accessor_class_data_g2simple_packing_with_preprocessing}, - {""}, {""}, {""}, {""}, +#line 97 "accessor_class_list.gperf" + {"g1date", &grib_accessor_class_g1date}, #line 95 "accessor_class_list.gperf" {"g1area", &grib_accessor_class_g1area}, -#line 187 "accessor_class_list.gperf" - {"scale", &grib_accessor_class_scale}, -#line 208 "accessor_class_list.gperf" - {"step_in_units", &grib_accessor_class_step_in_units}, -#line 56 "accessor_class_list.gperf" - {"data_constant_field", &grib_accessor_class_data_constant_field}, -#line 55 "accessor_class_list.gperf" - {"data_complex_packing", &grib_accessor_class_data_complex_packing}, -#line 122 "accessor_class_list.gperf" - {"g2step_range", &grib_accessor_class_g2step_range}, -#line 65 "accessor_class_list.gperf" - {"data_g1simple_packing", &grib_accessor_class_data_g1simple_packing}, -#line 58 "accessor_class_list.gperf" - {"data_g1complex_packing", &grib_accessor_class_data_g1complex_packing}, - {""}, -#line 178 "accessor_class_list.gperf" - {"padto", &grib_accessor_class_padto}, - {""}, -#line 183 "accessor_class_list.gperf" - {"raw", &grib_accessor_class_raw}, -#line 93 "accessor_class_list.gperf" - {"g1_message_length", &grib_accessor_class_g1_message_length}, -#line 54 "accessor_class_list.gperf" - {"data_ccsds_packing", &grib_accessor_class_data_ccsds_packing}, - {""}, -#line 15 "accessor_class_list.gperf" - {"assert", &grib_accessor_class_assert}, - {""}, {""}, {""}, {""}, -#line 105 "accessor_class_list.gperf" - {"g1p1p2", &grib_accessor_class_g1p1p2}, +#line 96 "accessor_class_list.gperf" + {"g1bitmap", &grib_accessor_class_g1bitmap}, + {""}, {""}, {""}, {""}, {""}, +#line 209 "accessor_class_list.gperf" + {"sum", &grib_accessor_class_sum}, #line 69 "accessor_class_list.gperf" {"data_g2secondary_bitmap", &grib_accessor_class_data_g2secondary_bitmap}, #line 67 "accessor_class_list.gperf" {"data_g2bifourier_packing", &grib_accessor_class_data_g2bifourier_packing}, -#line 115 "accessor_class_list.gperf" - {"g2date", &grib_accessor_class_g2date}, - {""}, -#line 113 "accessor_class_list.gperf" - {"g2bitmap", &grib_accessor_class_g2bitmap}, -#line 165 "accessor_class_list.gperf" - {"non_alpha", &grib_accessor_class_non_alpha}, -#line 184 "accessor_class_list.gperf" - {"rdbtime_guess_date", &grib_accessor_class_rdbtime_guess_date}, -#line 209 "accessor_class_list.gperf" - {"sum", &grib_accessor_class_sum}, - {""}, -#line 224 "accessor_class_list.gperf" +#line 111 "accessor_class_list.gperf" + {"g2_eps", &grib_accessor_class_g2_eps}, +#line 225 "accessor_class_list.gperf" {"uint8", &grib_accessor_class_uint8}, -#line 220 "accessor_class_list.gperf" - {"uint32", &grib_accessor_class_uint32}, - {""}, {""}, {""}, -#line 107 "accessor_class_list.gperf" - {"g1step_range", &grib_accessor_class_g1step_range}, -#line 194 "accessor_class_list.gperf" - {"select_step_template", &grib_accessor_class_select_step_template}, -#line 109 "accessor_class_list.gperf" - {"g2_aerosol", &grib_accessor_class_g2_aerosol}, -#line 125 "accessor_class_list.gperf" - {"gds_not_present_bitmap", &grib_accessor_class_gds_not_present_bitmap}, -#line 205 "accessor_class_list.gperf" - {"statistics", &grib_accessor_class_statistics}, + {""}, {""}, +#line 93 "accessor_class_list.gperf" + {"g1_message_length", &grib_accessor_class_g1_message_length}, +#line 183 "accessor_class_list.gperf" + {"raw", &grib_accessor_class_raw}, +#line 72 "accessor_class_list.gperf" + {"data_g2simple_packing_with_preprocessing", &grib_accessor_class_data_g2simple_packing_with_preprocessing}, #line 57 "accessor_class_list.gperf" {"data_dummy_field", &grib_accessor_class_data_dummy_field}, +#line 218 "accessor_class_list.gperf" + {"trim", &grib_accessor_class_trim}, +#line 78 "accessor_class_list.gperf" + {"data_sh_unpacked", &grib_accessor_class_data_sh_unpacked}, + {""}, +#line 15 "accessor_class_list.gperf" + {"assert", &grib_accessor_class_assert}, +#line 221 "accessor_class_list.gperf" + {"uint32", &grib_accessor_class_uint32}, +#line 118 "accessor_class_list.gperf" + {"g2latlon", &grib_accessor_class_g2latlon}, +#line 79 "accessor_class_list.gperf" + {"data_shsimple_packing", &grib_accessor_class_data_shsimple_packing}, +#line 207 "accessor_class_list.gperf" + {"step_human_readable", &grib_accessor_class_step_human_readable}, +#line 109 "accessor_class_list.gperf" + {"g2_aerosol", &grib_accessor_class_g2_aerosol}, +#line 178 "accessor_class_list.gperf" + {"padto", &grib_accessor_class_padto}, #line 145 "accessor_class_list.gperf" {"julian_day", &grib_accessor_class_julian_day}, -#line 144 "accessor_class_list.gperf" - {"julian_date", &grib_accessor_class_julian_date}, -#line 13 "accessor_class_list.gperf" - {"array", &grib_accessor_class_array}, - {""}, {""}, -#line 143 "accessor_class_list.gperf" - {"iterator", &grib_accessor_class_iterator}, - {""}, -#line 206 "accessor_class_list.gperf" - {"statistics_spectral", &grib_accessor_class_statistics_spectral}, -#line 12 "accessor_class_list.gperf" - {"apply_operators", &grib_accessor_class_apply_operators}, - {""}, -#line 63 "accessor_class_list.gperf" - {"data_g1secondary_bitmap", &grib_accessor_class_data_g1secondary_bitmap}, - {""}, -#line 97 "accessor_class_list.gperf" - {"g1date", &grib_accessor_class_g1date}, - {""}, -#line 96 "accessor_class_list.gperf" - {"g1bitmap", &grib_accessor_class_g1bitmap}, -#line 123 "accessor_class_list.gperf" - {"gaussian_grid_name", &grib_accessor_class_gaussian_grid_name}, - {""}, {""}, -#line 222 "accessor_class_list.gperf" - {"uint64", &grib_accessor_class_uint64}, -#line 214 "accessor_class_list.gperf" - {"to_integer", &grib_accessor_class_to_integer}, - {""}, -#line 129 "accessor_class_list.gperf" - {"group", &grib_accessor_class_group}, -#line 61 "accessor_class_list.gperf" - {"data_g1second_order_general_packing", &grib_accessor_class_data_g1second_order_general_packing}, - {""}, {""}, -#line 62 "accessor_class_list.gperf" - {"data_g1second_order_row_by_row_packing", &grib_accessor_class_data_g1second_order_row_by_row_packing}, - {""}, {""}, {""}, -#line 59 "accessor_class_list.gperf" - {"data_g1second_order_constant_width_packing", &grib_accessor_class_data_g1second_order_constant_width_packing}, #line 216 "accessor_class_list.gperf" {"transient", &grib_accessor_class_transient}, -#line 60 "accessor_class_list.gperf" - {"data_g1second_order_general_extended_packing", &grib_accessor_class_data_g1second_order_general_extended_packing}, -#line 167 "accessor_class_list.gperf" - {"number_of_points", &grib_accessor_class_number_of_points}, -#line 227 "accessor_class_list.gperf" - {"unsigned", &grib_accessor_class_unsigned}, -#line 218 "accessor_class_list.gperf" - {"uint16", &grib_accessor_class_uint16}, -#line 186 "accessor_class_list.gperf" - {"round", &grib_accessor_class_round}, -#line 148 "accessor_class_list.gperf" - {"laplacian", &grib_accessor_class_laplacian}, + {""}, +#line 223 "accessor_class_list.gperf" + {"uint64", &grib_accessor_class_uint64}, +#line 144 "accessor_class_list.gperf" + {"julian_date", &grib_accessor_class_julian_date}, + {""}, +#line 107 "accessor_class_list.gperf" + {"g1step_range", &grib_accessor_class_g1step_range}, +#line 94 "accessor_class_list.gperf" + {"g1_section4_length", &grib_accessor_class_g1_section4_length}, #line 217 "accessor_class_list.gperf" {"transient_darray", &grib_accessor_class_transient_darray}, -#line 234 "accessor_class_list.gperf" - {"when", &grib_accessor_class_when}, -#line 228 "accessor_class_list.gperf" - {"unsigned_bits", &grib_accessor_class_unsigned_bits}, -#line 204 "accessor_class_list.gperf" - {"sprintf", &grib_accessor_class_sprintf}, -#line 168 "accessor_class_list.gperf" - {"number_of_points_gaussian", &grib_accessor_class_number_of_points_gaussian}, +#line 184 "accessor_class_list.gperf" + {"rdbtime_guess_date", &grib_accessor_class_rdbtime_guess_date}, +#line 222 "accessor_class_list.gperf" + {"uint32_little_endian", &grib_accessor_class_uint32_little_endian}, +#line 65 "accessor_class_list.gperf" + {"data_g1simple_packing", &grib_accessor_class_data_g1simple_packing}, +#line 58 "accessor_class_list.gperf" + {"data_g1complex_packing", &grib_accessor_class_data_g1complex_packing}, #line 16 "accessor_class_list.gperf" {"bit", &grib_accessor_class_bit}, #line 18 "accessor_class_list.gperf" {"bits", &grib_accessor_class_bits}, -#line 146 "accessor_class_list.gperf" - {"ksec1expver", &grib_accessor_class_ksec1expver}, + {""}, #line 17 "accessor_class_list.gperf" {"bitmap", &grib_accessor_class_bitmap}, -#line 231 "accessor_class_list.gperf" - {"values", &grib_accessor_class_values}, -#line 118 "accessor_class_list.gperf" - {"g2latlon", &grib_accessor_class_g2latlon}, -#line 94 "accessor_class_list.gperf" - {"g1_section4_length", &grib_accessor_class_g1_section4_length}, -#line 48 "accessor_class_list.gperf" - {"data_2order_packing", &grib_accessor_class_data_2order_packing}, +#line 165 "accessor_class_list.gperf" + {"non_alpha", &grib_accessor_class_non_alpha}, {""}, -#line 225 "accessor_class_list.gperf" - {"unexpanded_descriptors", &grib_accessor_class_unexpanded_descriptors}, +#line 224 "accessor_class_list.gperf" + {"uint64_little_endian", &grib_accessor_class_uint64_little_endian}, + {""}, {""}, +#line 63 "accessor_class_list.gperf" + {"data_g1secondary_bitmap", &grib_accessor_class_data_g1secondary_bitmap}, {""}, +#line 105 "accessor_class_list.gperf" + {"g1p1p2", &grib_accessor_class_g1p1p2}, + {""}, +#line 228 "accessor_class_list.gperf" + {"unsigned", &grib_accessor_class_unsigned}, #line 19 "accessor_class_list.gperf" {"bits_per_value", &grib_accessor_class_bits_per_value}, -#line 99 "accessor_class_list.gperf" - {"g1end_of_interval_monthly", &grib_accessor_class_g1end_of_interval_monthly}, -#line 49 "accessor_class_list.gperf" - {"data_2order_packing_count", &grib_accessor_class_data_2order_packing_count}, -#line 207 "accessor_class_list.gperf" - {"step_human_readable", &grib_accessor_class_step_human_readable}, -#line 221 "accessor_class_list.gperf" - {"uint32_little_endian", &grib_accessor_class_uint32_little_endian}, + {""}, {""}, {""}, {""}, +#line 229 "accessor_class_list.gperf" + {"unsigned_bits", &grib_accessor_class_unsigned_bits}, +#line 123 "accessor_class_list.gperf" + {"gaussian_grid_name", &grib_accessor_class_gaussian_grid_name}, +#line 61 "accessor_class_list.gperf" + {"data_g1second_order_general_packing", &grib_accessor_class_data_g1second_order_general_packing}, +#line 102 "accessor_class_list.gperf" + {"g1monthlydate", &grib_accessor_class_g1monthlydate}, {""}, -#line 215 "accessor_class_list.gperf" - {"to_string", &grib_accessor_class_to_string}, -#line 203 "accessor_class_list.gperf" - {"spectral_truncation", &grib_accessor_class_spectral_truncation}, -#line 78 "accessor_class_list.gperf" - {"data_sh_unpacked", &grib_accessor_class_data_sh_unpacked}, -#line 198 "accessor_class_list.gperf" - {"simple_packing_error", &grib_accessor_class_simple_packing_error}, - {""}, {""}, {""}, -#line 79 "accessor_class_list.gperf" - {"data_shsimple_packing", &grib_accessor_class_data_shsimple_packing}, - {""}, {""}, -#line 89 "accessor_class_list.gperf" - {"forward", &grib_accessor_class_forward}, -#line 100 "accessor_class_list.gperf" - {"g1fcperiod", &grib_accessor_class_g1fcperiod}, -#line 128 "accessor_class_list.gperf" - {"global_gaussian", &grib_accessor_class_global_gaussian}, -#line 134 "accessor_class_list.gperf" - {"ieeefloat", &grib_accessor_class_ieeefloat}, -#line 173 "accessor_class_list.gperf" - {"offset_file", &grib_accessor_class_offset_file}, -#line 36 "accessor_class_list.gperf" - {"bytes", &grib_accessor_class_bytes}, +#line 62 "accessor_class_list.gperf" + {"data_g1second_order_row_by_row_packing", &grib_accessor_class_data_g1second_order_row_by_row_packing}, {""}, -#line 195 "accessor_class_list.gperf" - {"sexagesimal2decimal", &grib_accessor_class_sexagesimal2decimal}, -#line 43 "accessor_class_list.gperf" - {"concept", &grib_accessor_class_concept}, -#line 92 "accessor_class_list.gperf" - {"g1_increment", &grib_accessor_class_g1_increment}, +#line 131 "accessor_class_list.gperf" + {"hash_array", &grib_accessor_class_hash_array}, +#line 219 "accessor_class_list.gperf" + {"uint16", &grib_accessor_class_uint16}, +#line 59 "accessor_class_list.gperf" + {"data_g1second_order_constant_width_packing", &grib_accessor_class_data_g1second_order_constant_width_packing}, + {""}, +#line 60 "accessor_class_list.gperf" + {"data_g1second_order_general_extended_packing", &grib_accessor_class_data_g1second_order_general_extended_packing}, + {""}, {""}, {""}, {""}, #line 114 "accessor_class_list.gperf" {"g2bitmap_present", &grib_accessor_class_g2bitmap_present}, -#line 182 "accessor_class_list.gperf" - {"proj_string", &grib_accessor_class_proj_string}, - {""}, -#line 210 "accessor_class_list.gperf" - {"suppressed", &grib_accessor_class_suppressed}, - {""}, {""}, -#line 223 "accessor_class_list.gperf" - {"uint64_little_endian", &grib_accessor_class_uint64_little_endian}, -#line 86 "accessor_class_list.gperf" - {"element", &grib_accessor_class_element}, -#line 181 "accessor_class_list.gperf" - {"position", &grib_accessor_class_position}, +#line 13 "accessor_class_list.gperf" + {"array", &grib_accessor_class_array}, +#line 148 "accessor_class_list.gperf" + {"laplacian", &grib_accessor_class_laplacian}, #line 149 "accessor_class_list.gperf" {"latitudes", &grib_accessor_class_latitudes}, {""}, -#line 160 "accessor_class_list.gperf" - {"md5", &grib_accessor_class_md5}, -#line 44 "accessor_class_list.gperf" - {"constant", &grib_accessor_class_constant}, -#line 166 "accessor_class_list.gperf" - {"number_of_coded_values", &grib_accessor_class_number_of_coded_values}, -#line 154 "accessor_class_list.gperf" - {"long", &grib_accessor_class_long}, -#line 161 "accessor_class_list.gperf" - {"message", &grib_accessor_class_message}, -#line 85 "accessor_class_list.gperf" - {"double", &grib_accessor_class_double}, +#line 186 "accessor_class_list.gperf" + {"round", &grib_accessor_class_round}, {""}, -#line 158 "accessor_class_list.gperf" - {"mars_param", &grib_accessor_class_mars_param}, -#line 112 "accessor_class_list.gperf" - {"g2_mars_labeling", &grib_accessor_class_g2_mars_labeling}, -#line 180 "accessor_class_list.gperf" - {"padtomultiple", &grib_accessor_class_padtomultiple}, - {""}, -#line 219 "accessor_class_list.gperf" +#line 86 "accessor_class_list.gperf" + {"element", &grib_accessor_class_element}, +#line 220 "accessor_class_list.gperf" {"uint16_little_endian", &grib_accessor_class_uint16_little_endian}, {""}, {""}, +#line 146 "accessor_class_list.gperf" + {"ksec1expver", &grib_accessor_class_ksec1expver}, + {""}, +#line 167 "accessor_class_list.gperf" + {"number_of_points", &grib_accessor_class_number_of_points}, + {""}, +#line 203 "accessor_class_list.gperf" + {"spectral_truncation", &grib_accessor_class_spectral_truncation}, +#line 198 "accessor_class_list.gperf" + {"simple_packing_error", &grib_accessor_class_simple_packing_error}, + {""}, +#line 99 "accessor_class_list.gperf" + {"g1end_of_interval_monthly", &grib_accessor_class_g1end_of_interval_monthly}, +#line 48 "accessor_class_list.gperf" + {"data_2order_packing", &grib_accessor_class_data_2order_packing}, +#line 181 "accessor_class_list.gperf" + {"position", &grib_accessor_class_position}, +#line 12 "accessor_class_list.gperf" + {"apply_operators", &grib_accessor_class_apply_operators}, +#line 168 "accessor_class_list.gperf" + {"number_of_points_gaussian", &grib_accessor_class_number_of_points_gaussian}, + {""}, +#line 129 "accessor_class_list.gperf" + {"group", &grib_accessor_class_group}, +#line 49 "accessor_class_list.gperf" + {"data_2order_packing_count", &grib_accessor_class_data_2order_packing_count}, +#line 112 "accessor_class_list.gperf" + {"g2_mars_labeling", &grib_accessor_class_g2_mars_labeling}, +#line 187 "accessor_class_list.gperf" + {"scale", &grib_accessor_class_scale}, #line 21 "accessor_class_list.gperf" {"box", &grib_accessor_class_box}, +#line 36 "accessor_class_list.gperf" + {"bytes", &grib_accessor_class_bytes}, +#line 226 "accessor_class_list.gperf" + {"unexpanded_descriptors", &grib_accessor_class_unexpanded_descriptors}, {""}, -#line 229 "accessor_class_list.gperf" - {"validity_date", &grib_accessor_class_validity_date}, -#line 230 "accessor_class_list.gperf" - {"validity_time", &grib_accessor_class_validity_time}, - {""}, -#line 233 "accessor_class_list.gperf" - {"vector", &grib_accessor_class_vector}, +#line 182 "accessor_class_list.gperf" + {"proj_string", &grib_accessor_class_proj_string}, {""}, +#line 54 "accessor_class_list.gperf" + {"data_ccsds_packing", &grib_accessor_class_data_ccsds_packing}, #line 84 "accessor_class_list.gperf" {"divdouble", &grib_accessor_class_divdouble}, {""}, +#line 232 "accessor_class_list.gperf" + {"values", &grib_accessor_class_values}, +#line 128 "accessor_class_list.gperf" + {"global_gaussian", &grib_accessor_class_global_gaussian}, + {""}, {""}, {""}, {""}, +#line 230 "accessor_class_list.gperf" + {"validity_date", &grib_accessor_class_validity_date}, +#line 231 "accessor_class_list.gperf" + {"validity_time", &grib_accessor_class_validity_time}, + {""}, {""}, +#line 160 "accessor_class_list.gperf" + {"md5", &grib_accessor_class_md5}, +#line 195 "accessor_class_list.gperf" + {"sexagesimal2decimal", &grib_accessor_class_sexagesimal2decimal}, + {""}, +#line 210 "accessor_class_list.gperf" + {"suppressed", &grib_accessor_class_suppressed}, + {""}, {""}, {""}, +#line 158 "accessor_class_list.gperf" + {"mars_param", &grib_accessor_class_mars_param}, +#line 159 "accessor_class_list.gperf" + {"mars_step", &grib_accessor_class_mars_step}, + {""}, +#line 161 "accessor_class_list.gperf" + {"message", &grib_accessor_class_message}, +#line 132 "accessor_class_list.gperf" + {"headers_only", &grib_accessor_class_headers_only}, + {""}, +#line 154 "accessor_class_list.gperf" + {"long", &grib_accessor_class_long}, + {""}, +#line 85 "accessor_class_list.gperf" + {"double", &grib_accessor_class_double}, + {""}, +#line 92 "accessor_class_list.gperf" + {"g1_increment", &grib_accessor_class_g1_increment}, +#line 200 "accessor_class_list.gperf" + {"smart_table", &grib_accessor_class_smart_table}, + {""}, {""}, +#line 24 "accessor_class_list.gperf" + {"bufr_data", &grib_accessor_class_bufr_data}, +#line 22 "accessor_class_list.gperf" + {"budgdate", &grib_accessor_class_budgdate}, + {""}, {""}, +#line 201 "accessor_class_list.gperf" + {"smart_table_column", &grib_accessor_class_smart_table_column}, + {""}, +#line 25 "accessor_class_list.gperf" + {"bufr_data_array", &grib_accessor_class_bufr_data_array}, #line 77 "accessor_class_list.gperf" {"data_sh_packed", &grib_accessor_class_data_sh_packed}, - {""}, {""}, -#line 135 "accessor_class_list.gperf" - {"ifs_param", &grib_accessor_class_ifs_param}, -#line 130 "accessor_class_list.gperf" - {"gts_header", &grib_accessor_class_gts_header}, + {""}, {""}, {""}, +#line 26 "accessor_class_list.gperf" + {"bufr_data_element", &grib_accessor_class_bufr_data_element}, {""}, -#line 162 "accessor_class_list.gperf" - {"message_copy", &grib_accessor_class_message_copy}, - {""}, {""}, -#line 131 "accessor_class_list.gperf" - {"hash_array", &grib_accessor_class_hash_array}, - {""}, -#line 102 "accessor_class_list.gperf" - {"g1monthlydate", &grib_accessor_class_g1monthlydate}, #line 163 "accessor_class_list.gperf" {"missing", &grib_accessor_class_missing}, {""}, -#line 188 "accessor_class_list.gperf" - {"scale_values", &grib_accessor_class_scale_values}, - {""}, {""}, {""}, {""}, -#line 179 "accessor_class_list.gperf" - {"padtoeven", &grib_accessor_class_padtoeven}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, -#line 39 "accessor_class_list.gperf" - {"codeflag", &grib_accessor_class_codeflag}, - {""}, -#line 91 "accessor_class_list.gperf" - {"g1_half_byte_codeflag", &grib_accessor_class_g1_half_byte_codeflag}, - {""}, {""}, -#line 159 "accessor_class_list.gperf" - {"mars_step", &grib_accessor_class_mars_step}, -#line 24 "accessor_class_list.gperf" - {"bufr_data", &grib_accessor_class_bufr_data}, - {""}, {""}, {""}, {""}, {""}, -#line 25 "accessor_class_list.gperf" - {"bufr_data_array", &grib_accessor_class_bufr_data_array}, - {""}, -#line 26 "accessor_class_list.gperf" - {"bufr_data_element", &grib_accessor_class_bufr_data_element}, -#line 152 "accessor_class_list.gperf" - {"library_version", &grib_accessor_class_library_version}, - {""}, {""}, #line 33 "accessor_class_list.gperf" {"bufr_simple_thinning", &grib_accessor_class_bufr_simple_thinning}, - {""}, {""}, {""}, -#line 37 "accessor_class_list.gperf" - {"change_scanning_direction", &grib_accessor_class_change_scanning_direction}, {""}, +#line 89 "accessor_class_list.gperf" + {"forward", &grib_accessor_class_forward}, #line 35 "accessor_class_list.gperf" {"bufrdc_expanded_descriptors", &grib_accessor_class_bufrdc_expanded_descriptors}, + {""}, {""}, +#line 100 "accessor_class_list.gperf" + {"g1fcperiod", &grib_accessor_class_g1fcperiod}, #line 32 "accessor_class_list.gperf" {"bufr_has_delayed_replication", &grib_accessor_class_bufr_has_delayed_replication}, - {""}, {""}, -#line 169 "accessor_class_list.gperf" - {"number_of_values", &grib_accessor_class_number_of_values}, - {""}, {""}, -#line 226 "accessor_class_list.gperf" - {"unpack_bufr_values", &grib_accessor_class_unpack_bufr_values}, +#line 134 "accessor_class_list.gperf" + {"ieeefloat", &grib_accessor_class_ieeefloat}, +#line 43 "accessor_class_list.gperf" + {"concept", &grib_accessor_class_concept}, +#line 204 "accessor_class_list.gperf" + {"sprintf", &grib_accessor_class_sprintf}, {""}, -#line 147 "accessor_class_list.gperf" - {"label", &grib_accessor_class_label}, -#line 174 "accessor_class_list.gperf" - {"offset_values", &grib_accessor_class_offset_values}, -#line 175 "accessor_class_list.gperf" - {"pack_bufr_values", &grib_accessor_class_pack_bufr_values}, +#line 173 "accessor_class_list.gperf" + {"offset_file", &grib_accessor_class_offset_file}, {""}, -#line 171 "accessor_class_list.gperf" - {"octahedral_gaussian", &grib_accessor_class_octahedral_gaussian}, - {""}, {""}, -#line 132 "accessor_class_list.gperf" - {"headers_only", &grib_accessor_class_headers_only}, - {""}, {""}, -#line 155 "accessor_class_list.gperf" - {"long_vector", &grib_accessor_class_long_vector}, -#line 20 "accessor_class_list.gperf" - {"blob", &grib_accessor_class_blob}, -#line 170 "accessor_class_list.gperf" - {"number_of_values_data_raw_packing", &grib_accessor_class_number_of_values_data_raw_packing}, -#line 90 "accessor_class_list.gperf" - {"from_scale_factor_scaled_value", &grib_accessor_class_from_scale_factor_scaled_value}, - {""}, -#line 150 "accessor_class_list.gperf" - {"latlon_increment", &grib_accessor_class_latlon_increment}, -#line 133 "accessor_class_list.gperf" - {"ibmfloat", &grib_accessor_class_ibmfloat}, -#line 232 "accessor_class_list.gperf" - {"variable", &grib_accessor_class_variable}, - {""}, {""}, {""}, -#line 157 "accessor_class_list.gperf" - {"lookup", &grib_accessor_class_lookup}, -#line 45 "accessor_class_list.gperf" - {"count_file", &grib_accessor_class_count_file}, - {""}, {""}, -#line 22 "accessor_class_list.gperf" - {"budgdate", &grib_accessor_class_budgdate}, -#line 156 "accessor_class_list.gperf" - {"longitudes", &grib_accessor_class_longitudes}, -#line 87 "accessor_class_list.gperf" - {"evaluate", &grib_accessor_class_evaluate}, -#line 200 "accessor_class_list.gperf" - {"smart_table", &grib_accessor_class_smart_table}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 201 "accessor_class_list.gperf" - {"smart_table_column", &grib_accessor_class_smart_table_column}, -#line 98 "accessor_class_list.gperf" - {"g1day_of_the_year_date", &grib_accessor_class_g1day_of_the_year_date}, -#line 11 "accessor_class_list.gperf" - {"abstract_vector", &grib_accessor_class_abstract_vector}, - {""}, {""}, {""}, {""}, -#line 139 "accessor_class_list.gperf" - {"int32_little_endian", &grib_accessor_class_int32_little_endian}, - {""}, {""}, {""}, -#line 38 "accessor_class_list.gperf" - {"check_internal_version", &grib_accessor_class_check_internal_version}, +#line 194 "accessor_class_list.gperf" + {"select_step_template", &grib_accessor_class_select_step_template}, {""}, {""}, #line 213 "accessor_class_list.gperf" {"to_double", &grib_accessor_class_to_double}, +#line 234 "accessor_class_list.gperf" + {"vector", &grib_accessor_class_vector}, + {""}, {""}, +#line 44 "accessor_class_list.gperf" + {"constant", &grib_accessor_class_constant}, + {""}, +#line 98 "accessor_class_list.gperf" + {"g1day_of_the_year_date", &grib_accessor_class_g1day_of_the_year_date}, +#line 34 "accessor_class_list.gperf" + {"bufr_string_values", &grib_accessor_class_bufr_string_values}, + {""}, {""}, {""}, {""}, +#line 180 "accessor_class_list.gperf" + {"padtomultiple", &grib_accessor_class_padtomultiple}, + {""}, {""}, {""}, {""}, +#line 162 "accessor_class_list.gperf" + {"message_copy", &grib_accessor_class_message_copy}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 91 "accessor_class_list.gperf" + {"g1_half_byte_codeflag", &grib_accessor_class_g1_half_byte_codeflag}, + {""}, {""}, +#line 37 "accessor_class_list.gperf" + {"change_scanning_direction", &grib_accessor_class_change_scanning_direction}, + {""}, +#line 20 "accessor_class_list.gperf" + {"blob", &grib_accessor_class_blob}, + {""}, {""}, {""}, {""}, +#line 133 "accessor_class_list.gperf" + {"ibmfloat", &grib_accessor_class_ibmfloat}, + {""}, {""}, {""}, +#line 87 "accessor_class_list.gperf" + {"evaluate", &grib_accessor_class_evaluate}, + {""}, {""}, {""}, {""}, +#line 171 "accessor_class_list.gperf" + {"octahedral_gaussian", &grib_accessor_class_octahedral_gaussian}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 166 "accessor_class_list.gperf" + {"number_of_coded_values", &grib_accessor_class_number_of_coded_values}, + {""}, {""}, +#line 179 "accessor_class_list.gperf" + {"padtoeven", &grib_accessor_class_padtoeven}, + {""}, {""}, +#line 169 "accessor_class_list.gperf" + {"number_of_values", &grib_accessor_class_number_of_values}, +#line 157 "accessor_class_list.gperf" + {"lookup", &grib_accessor_class_lookup}, + {""}, +#line 147 "accessor_class_list.gperf" + {"label", &grib_accessor_class_label}, + {""}, {""}, +#line 156 "accessor_class_list.gperf" + {"longitudes", &grib_accessor_class_longitudes}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, +#line 170 "accessor_class_list.gperf" + {"number_of_values_data_raw_packing", &grib_accessor_class_number_of_values_data_raw_packing}, +#line 152 "accessor_class_list.gperf" + {"library_version", &grib_accessor_class_library_version}, +#line 31 "accessor_class_list.gperf" + {"bufr_group", &grib_accessor_class_bufr_group}, +#line 155 "accessor_class_list.gperf" + {"long_vector", &grib_accessor_class_long_vector}, + {""}, +#line 150 "accessor_class_list.gperf" + {"latlon_increment", &grib_accessor_class_latlon_increment}, + {""}, {""}, {""}, {""}, {""}, {""}, +#line 135 "accessor_class_list.gperf" + {"ifs_param", &grib_accessor_class_ifs_param}, + {""}, {""}, {""}, +#line 174 "accessor_class_list.gperf" + {"offset_values", &grib_accessor_class_offset_values}, +#line 38 "accessor_class_list.gperf" + {"check_internal_version", &grib_accessor_class_check_internal_version}, + {""}, {""}, {""}, +#line 175 "accessor_class_list.gperf" + {"pack_bufr_values", &grib_accessor_class_pack_bufr_values}, + {""}, {""}, {""}, +#line 233 "accessor_class_list.gperf" + {"variable", &grib_accessor_class_variable}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 139 "accessor_class_list.gperf" + {"int32_little_endian", &grib_accessor_class_int32_little_endian}, {""}, {""}, #line 141 "accessor_class_list.gperf" {"int64_little_endian", &grib_accessor_class_int64_little_endian}, -#line 108 "accessor_class_list.gperf" - {"g1verificationdate", &grib_accessor_class_g1verificationdate}, - {""}, {""}, + {""}, #line 137 "accessor_class_list.gperf" {"int16_little_endian", &grib_accessor_class_int16_little_endian}, - {""}, {""}, -#line 119 "accessor_class_list.gperf" - {"g2level", &grib_accessor_class_g2level}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, #line 40 "accessor_class_list.gperf" {"codetable", &grib_accessor_class_codetable}, -#line 31 "accessor_class_list.gperf" - {"bufr_group", &grib_accessor_class_bufr_group}, - {""}, {""}, -#line 34 "accessor_class_list.gperf" - {"bufr_string_values", &grib_accessor_class_bufr_string_values}, -#line 30 "accessor_class_list.gperf" - {"bufr_extract_subsets", &grib_accessor_class_bufr_extract_subsets}, - {""}, {""}, {""}, {""}, -#line 28 "accessor_class_list.gperf" - {"bufr_extract_area_subsets", &grib_accessor_class_bufr_extract_area_subsets}, -#line 185 "accessor_class_list.gperf" - {"reference_value_error", &grib_accessor_class_reference_value_error}, - {""}, + {""}, {""}, {""}, {""}, {""}, +#line 108 "accessor_class_list.gperf" + {"g1verificationdate", &grib_accessor_class_g1verificationdate}, #line 81 "accessor_class_list.gperf" {"decimal_precision", &grib_accessor_class_decimal_precision}, -#line 29 "accessor_class_list.gperf" - {"bufr_extract_datetime_subsets", &grib_accessor_class_bufr_extract_datetime_subsets}, - {""}, {""}, -#line 106 "accessor_class_list.gperf" - {"g1param", &grib_accessor_class_g1param}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 151 "accessor_class_list.gperf" - {"latlonvalues", &grib_accessor_class_latlonvalues}, -#line 172 "accessor_class_list.gperf" - {"octect_number", &grib_accessor_class_octect_number}, - {""}, -#line 153 "accessor_class_list.gperf" - {"local_definition", &grib_accessor_class_local_definition}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 47 "accessor_class_list.gperf" - {"count_total", &grib_accessor_class_count_total}, - {""}, -#line 10 "accessor_class_list.gperf" - {"abstract_long_vector", &grib_accessor_class_abstract_long_vector}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 46 "accessor_class_list.gperf" - {"count_missing", &grib_accessor_class_count_missing}, - {""}, {""}, {""}, {""}, #line 41 "accessor_class_list.gperf" {"codetable_title", &grib_accessor_class_codetable_title}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, +#line 188 "accessor_class_list.gperf" + {"scale_values", &grib_accessor_class_scale_values}, + {""}, {""}, #line 23 "accessor_class_list.gperf" {"bufr_clear_tables", &grib_accessor_class_bufr_clear_tables}, + {""}, {""}, {""}, {""}, +#line 119 "accessor_class_list.gperf" + {"g2level", &grib_accessor_class_g2level}, + {""}, +#line 106 "accessor_class_list.gperf" + {"g1param", &grib_accessor_class_g1param}, + {""}, {""}, +#line 153 "accessor_class_list.gperf" + {"local_definition", &grib_accessor_class_local_definition}, + {""}, {""}, {""}, +#line 227 "accessor_class_list.gperf" + {"unpack_bufr_values", &grib_accessor_class_unpack_bufr_values}, + {""}, +#line 27 "accessor_class_list.gperf" + {"bufr_elements_table", &grib_accessor_class_bufr_elements_table}, + {""}, {""}, +#line 47 "accessor_class_list.gperf" + {"count_total", &grib_accessor_class_count_total}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 30 "accessor_class_list.gperf" + {"bufr_extract_subsets", &grib_accessor_class_bufr_extract_subsets}, + {""}, {""}, +#line 151 "accessor_class_list.gperf" + {"latlonvalues", &grib_accessor_class_latlonvalues}, + {""}, +#line 28 "accessor_class_list.gperf" + {"bufr_extract_area_subsets", &grib_accessor_class_bufr_extract_area_subsets}, +#line 39 "accessor_class_list.gperf" + {"codeflag", &grib_accessor_class_codeflag}, + {""}, +#line 11 "accessor_class_list.gperf" + {"abstract_vector", &grib_accessor_class_abstract_vector}, +#line 29 "accessor_class_list.gperf" + {"bufr_extract_datetime_subsets", &grib_accessor_class_bufr_extract_datetime_subsets}, +#line 45 "accessor_class_list.gperf" + {"count_file", &grib_accessor_class_count_file}, + {""}, {""}, {""}, {""}, +#line 185 "accessor_class_list.gperf" + {"reference_value_error", &grib_accessor_class_reference_value_error}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 110 "accessor_class_list.gperf" + {"g2_chemical", &grib_accessor_class_g2_chemical}, + {""}, +#line 46 "accessor_class_list.gperf" + {"count_missing", &grib_accessor_class_count_missing}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, +#line 42 "accessor_class_list.gperf" + {"codetable_units", &grib_accessor_class_codetable_units}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, +#line 90 "accessor_class_list.gperf" + {"from_scale_factor_scaled_value", &grib_accessor_class_from_scale_factor_scaled_value}, +#line 10 "accessor_class_list.gperf" + {"abstract_long_vector", &grib_accessor_class_abstract_long_vector}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, #line 104 "accessor_class_list.gperf" {"g1number_of_coded_values_sh_simple", &grib_accessor_class_g1number_of_coded_values_sh_simple}, #line 103 "accessor_class_list.gperf" {"g1number_of_coded_values_sh_complex", &grib_accessor_class_g1number_of_coded_values_sh_complex}, - {""}, {""}, {""}, {""}, -#line 27 "accessor_class_list.gperf" - {"bufr_elements_table", &grib_accessor_class_bufr_elements_table}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, +#line 172 "accessor_class_list.gperf" + {"octect_number", &grib_accessor_class_octect_number}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, #line 101 "accessor_class_list.gperf" - {"g1forecastmonth", &grib_accessor_class_g1forecastmonth}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 42 "accessor_class_list.gperf" - {"codetable_units", &grib_accessor_class_codetable_units}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, -#line 110 "accessor_class_list.gperf" - {"g2_chemical", &grib_accessor_class_g2_chemical} + {"g1forecastmonth", &grib_accessor_class_g1forecastmonth} }; static const struct accessor_class_hash * diff --git a/src/grib_accessor_factory.h b/src/grib_accessor_factory.h index 95b3ef49e..e53058a17 100644 --- a/src/grib_accessor_factory.h +++ b/src/grib_accessor_factory.h @@ -207,6 +207,7 @@ { "to_string", &grib_accessor_class_to_string, }, { "transient", &grib_accessor_class_transient, }, { "transient_darray", &grib_accessor_class_transient_darray, }, +{ "trim", &grib_accessor_class_trim, }, { "uint16", &grib_accessor_class_uint16, }, { "uint16_little_endian", &grib_accessor_class_uint16_little_endian, }, { "uint32", &grib_accessor_class_uint32, }, diff --git a/src/grib_accessor_factory_hash_list b/src/grib_accessor_factory_hash_list index be806bdad..80aee104d 100644 --- a/src/grib_accessor_factory_hash_list +++ b/src/grib_accessor_factory_hash_list @@ -208,6 +208,7 @@ to_integer, &grib_accessor_class_to_integer to_string, &grib_accessor_class_to_string transient, &grib_accessor_class_transient transient_darray, &grib_accessor_class_transient_darray +trim, &grib_accessor_class_trim uint16, &grib_accessor_class_uint16 uint16_little_endian, &grib_accessor_class_uint16_little_endian uint32, &grib_accessor_class_uint32 diff --git a/src/grib_dumper_class_bufr_simple.c b/src/grib_dumper_class_bufr_simple.c index 22e313a38..eecf302d1 100644 --- a/src/grib_dumper_class_bufr_simple.c +++ b/src/grib_dumper_class_bufr_simple.c @@ -649,9 +649,13 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) /* ECC-356: Solution for the special local section key 'keyMore' and its alias 'ident' */ int skip = 1; if ((a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0) { + /* We've come across a key which is hidden */ if (strcmp(a->name, "keyMore") == 0 && grib_is_defined(h, "ls.ident")) { + grib_accessor* acc = NULL; skip = 0; acc_name = "ident"; + acc = grib_find_accessor(h, "identTrimmed"); + if (acc) a = acc; } } if (skip) diff --git a/src/grib_dumper_class_json.c b/src/grib_dumper_class_json.c index 5d2f525eb..d01042161 100644 --- a/src/grib_dumper_class_json.c +++ b/src/grib_dumper_class_json.c @@ -460,8 +460,8 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) /* ECC-356: Solution for the special local section key 'keyMore' and its alias 'ident' */ int skip = 1; if ((a->flags & GRIB_ACCESSOR_FLAG_HIDDEN) != 0) { - grib_handle* h = grib_handle_of_accessor(a); - if (strcmp(a->name, "keyMore") == 0 && grib_is_defined(h, "ls.ident")) { + //grib_handle* h = grib_handle_of_accessor(a); + if (strcmp(a->name, "identTrimmed") == 0) { skip = 0; acc_name = "ident"; } diff --git a/tests/bufr_get.sh b/tests/bufr_get.sh index 0fb60bfc6..d0b3d77d8 100755 --- a/tests/bufr_get.sh +++ b/tests/bufr_get.sh @@ -70,15 +70,15 @@ result=`${tools_dir}/bufr_get -s unpack=1 -p satelliteIdentifier wavb_134.bufr` result=`${tools_dir}/bufr_get -m aaen_55.bufr` [ "$result" = "55 20121102 0000" ] result=`${tools_dir}/bufr_get -m syno_1.bufr` -[ "$result" = "1 20121030 0000 91334 " ] +[ "$result" = "1 20121030 0000 91334" ] #------------------------------------------- # Local ECMWF section: 'ident' key #------------------------------------------- result=`${tools_dir}/bufr_get -p isSatellite,ident syno_1.bufr` -[ "$result" = "0 91334 " ] +[ "$result" = "0 91334" ] result=`${tools_dir}/bufr_get -p isSatellite,ident temp_102.bufr` -[ "$result" = "0 ASDE3 " ] +[ "$result" = "0 ASDE3" ] result=`${tools_dir}/bufr_get -p isSatellite,ident b004_145.bufr` [ "$result" = "0 FAVRTLZA" ]