Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Here "intValue" is an integer of N bits from the Data Section (N=bit width of descriptor).

Example:
For pressureReducedToMeanSeaLevel "pressure" we have:
code=010051007004,  type=long (integer)
, scale=-1, reference=0, bitwidth=14

And the formula used is: value = (intValue + ref) * 10-scale
So when we encode a value of 213.61 we do the above formula in reverse i.e.
intValue = round(value/10) - 0 = round(213.61/10) = 21
So we store the integer 21 in the BUFR message using 14 bits.
When we come to decode it, we use the first formula i.e. value = (21 + 0) * 10^--1 = 21 * 10 = 210
You So when you put in 213.61 but , you will get out 210. Precision of this element is 10^-scale i.e. 10 so it will not store intermediate values. It will be 210 or 220 or 230 etc..

...

To encode this descriptor with higher precision we can add an operator around the 007004

...

as follows:

Code Block
titleencode.filter
set unexpandedDescriptors = { 207003, 7004, 207000 };
set pressure = 12.34;
set pack = 1;
write;


We have added a 207003 operator that changes the scale factor, the reference and the width of the following key. Then disable the behaviour with operator 207000. Quoting the WMO BUFR table C for reference:

Operator 207YYY means "Increase scale, reference value and data width"
Description: For Table B elements that are not CCITT IA5 (character data), code or flag tables:
1. Add YYY bits to the existing scale factor
2. Multiply the existing reference value by 10**YYY
3. Calculate ((10 * YYY) + 2) / 3, disregard any fractional remainder and add the result to the existing bit width."

That way we can encode pressure with 2 decimal digits:

"key" : "pressure",
"value" : 12.34,
"index" : 1,
"code" : "007004",
"units" : "Pa",
"scale" : 2,
"reference" : 0,
"width" : 24

Note the difference with the original 007004 descriptor:


"key" : "pressure",
"value" : 10,
"index" : 1,
"code" : "007004",
"units" : "Pa",
"scale" : -1,
"reference" : 0,
"width" : 14

so we increased the width by 10 bits and changed the scale to 2.

Content by Label
showLabelsfalse
max5
spacesUDOC
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("bufr","eccbufr-faqs") and type = "page" and space = "UDOC"
labelsbufr eccbufr-faqs

...

Page properties
hiddentrue


Related issues