From 128ee3e43da3b120e041d4cf0aa17e22097c6a94 Mon Sep 17 00:00:00 2001 From: Enrico Fucile Date: Tue, 26 Apr 2016 09:48:48 +0100 Subject: [PATCH] ECC-243 --- data/bufr/bufr_ref_files.txt | 1 + src/grib_accessor_class_bufr_data_array.c | 7 +++--- tests/bufr_filter.sh | 27 +++++++++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/data/bufr/bufr_ref_files.txt b/data/bufr/bufr_ref_files.txt index b7a72ae89..d82e23026 100644 --- a/data/bufr/bufr_ref_files.txt +++ b/data/bufr/bufr_ref_files.txt @@ -386,3 +386,4 @@ syno.bufr.out.ref airep.bufr.out.ref new_replication.bufr.ref metar_with_2_bias.bufr +temp-land-with-substituted-values.bufr diff --git a/src/grib_accessor_class_bufr_data_array.c b/src/grib_accessor_class_bufr_data_array.c index 39ad3af3e..524d1fabc 100644 --- a/src/grib_accessor_class_bufr_data_array.c +++ b/src/grib_accessor_class_bufr_data_array.c @@ -1040,7 +1040,7 @@ static int build_bitmap(grib_accessor_bufr_data_array *self,unsigned char* data, ECC-243 */ while (iel>0) { - while ( descriptors[edi[iel]]->code!=236000 && descriptors[edi[iel]]->code!=222000 && iel!=0) iel--; + while ( descriptors[edi[iel]]->code!=236000 && descriptors[edi[iel]]->code!=222000 && descriptors[edi[iel]]->code!=223000 && iel!=0) iel--; if (iel!=0) { while (descriptors[edi[iel]]->code>=100000 && iel!=0) iel--; bitmapEndElementsDescriptorsIndex=iel; @@ -1589,6 +1589,7 @@ static int bitmap_ref_skip(grib_accessors_list* al,int* err) switch (code[0]) { case 222000: + case 223000: case 224000: case 225000: case 232000: @@ -1786,7 +1787,7 @@ static int create_keys(grib_accessor* a,long onlySubset,long startSubset,long en dump=1; bitmapSize[bitmapIndex]++; bitmap.cursor=0; - } else if (descriptor->code == 222000 || descriptor->code == 224000 || descriptor->code == 225000 ) { + } else if (descriptor->code == 222000 || descriptor->code == 223000 || descriptor->code == 224000 || descriptor->code == 225000 ) { bitmap.referredElement=NULL; qualityPresent=1; incrementBitmapIndex=1; @@ -1834,7 +1835,7 @@ static int create_keys(grib_accessor* a,long onlySubset,long startSubset,long en elementAccessor=create_accessor_from_descriptor(a,associatedFieldAccessor,section,ide,iss,dump,count); associatedFieldAccessor=NULL; if (elementFromBitmap && self->unpackMode==CODES_BUFR_UNPACK_STRUCTURE) { - if (descriptor->code != 33007) { + if (descriptor->code != 33007 && descriptor->code != 223255 ) { grib_accessor* newAccessor=grib_accessor_clone(elementAccessor,section,&err); newAccessor->parent=groupSection; newAccessor->name=grib_context_strdup(c,elementFromBitmap->name); diff --git a/tests/bufr_filter.sh b/tests/bufr_filter.sh index aeebe5ca4..e4bb8f913 100755 --- a/tests/bufr_filter.sh +++ b/tests/bufr_filter.sh @@ -1338,3 +1338,30 @@ diff ${f}.log.ref ${f}.log rm -f ${f}.log ${f}.log.ref +#----------------------------------------------------------- +# Test: Data with substituted value +#----------------------------------------------------------- +cat > $fRules <percentConfidence]"; +print "[#1#geopotential->substitutedValue]"; +EOF + +f="temp-land-with-substituted-values.bufr" + +echo "Test: Data with substituted value" >> $fLog +echo "file: $f" >> $fLog + +${tools_dir}bufr_filter $fRules $f > ${f}.log + +cat > ${f}.log.ref <