ECCC-MSC / libecbufr

libecbufr is a general purpose, template-oriented BUFR encoding/decoding library
Other
10 stars 7 forks source link

unexpected replication factor metadata #64

Open vsouvan opened 4 years ago

vsouvan commented 4 years ago

Hi Vanh and libECBUFR maintainers,

I was just decoding some TOVS/AMSU-A data using bufr_decoder and got some unexpected {R=0} repetition number values where I would have expected to see {R=1}, {R=2}, etc. because the associated data belongs to the 1st, 2nd, 3rd, repetition respectively.

Here is a sample of the output: 012064 TEMPERATURE DE L'INSTRUMENT K MSNG 002151 IDENTIFICATEUR DE RADIOMETRE CODE TABLE 6 012064 TEMPERATURE DE L'INSTRUMENT K MSNG

101015 {R=0}

310012 {R=1}

002150 {R=0} NO DE CANAL INSTRUM. TOVS/ATOVS/AVHRR CODE TABLE 28 025076 {R=0} LOG10 RADIANCE TEMP NBR ONDE CENTRAL ATOVS LOG/M 3.899756 025077 {R=0} COEFF CORRECT 1 BANDE PASSANTE POUR ATOVS NUMERIQUE MSNG 025078 {R=0} COEFF CORRECT 2 BANDE PASSANTE POUR ATOVS NUMERIQUE MSNG 033032 {R=0} MARQUEURS DE QUALITE POUR CANAL ATOVS * MARQUEURS MSNG 201132 {R=0} 202129 {R=0} 012063 {R=0} TEMPERATURE DE BRILLANCE K MSNG 202000 {R=0} 201000 {R=0}

310012 {R=2}

002150 {R=0} NO DE CANAL INSTRUM. TOVS/ATOVS/AVHRR CODE TABLE 29 025076 {R=0} LOG10 RADIANCE TEMP NBR ONDE CENTRAL ATOVS LOG/M 4.020109 025077 {R=0} COEFF CORRECT 1 BANDE PASSANTE POUR ATOVS NUMERIQUE MSNG 025078 {R=0} COEFF CORRECT 2 BANDE PASSANTE POUR ATOVS NUMERIQUE MSNG 033032 {R=0} MARQUEURS DE QUALITE POUR CANAL ATOVS * MARQUEURS MSNG 201132 {R=0} 202129 {R=0} 012063 {R=0} TEMPERATURE DE BRILLANCE K MSNG 202000 {R=0} 201000 {R=0}

310012 {R=3}

002150 {R=0} NO DE CANAL INSTRUM. TOVS/ATOVS/AVHRR CODE TABLE 30 025076 {R=0} LOG10 RADIANCE TEMP NBR ONDE CENTRAL ATOVS LOG/M 4.224747

I would have expected that everything under {R=1} would also be {R=1} up until {R=2} because it belongs to the 1st repetition and so on.

I require this so I can query the bcv->meta metadata field in the code to determine which repetition (and nesting level) I'm current at for any given element in order to maintain this structural information in my intermediate data structures.


Imported from Launchpad using lp2gh.

vsouvan commented 4 years ago

(by jcmalek) I was able to work around this but the subsequent bug I found is critical: 1662216

vsouvan commented 4 years ago

(by vanh-souvanlasy) Fix committed in revision 329