Class GribDataRepresentation
The data representation section (Section 5) of a GRIB2 field: how its values are packed.
public sealed class GribDataRepresentation
- Inheritance
-
GribDataRepresentation
- Inherited Members
Remarks
Every supported template stores integers X that decode to
Y = (R + X × 2^E) / 10^D, with ReferenceValue R,
BinaryScaleFactor E and
DecimalScaleFactor D. The templates differ in how the
X are stored:
| Template | Packing |
|---|---|
| 5.0 | Simple: each value in BitsPerValue bits. |
| 5.2 | Complex: values in groups, each with its own reference and bit width. |
| 5.3 | Complex, packing the first or second differences of the values. |
| 5.40 | A JPEG 2000 codestream whose samples are the values, lossless or lossy (CompressionType). |
| 5.41 | A PNG image whose pixels are the values, BitsPerValue bits deep. |
Other templates are listed with their number, and the field's UnsupportedReason names them: for example 5.42 (CCSDS) and 5.4 (IEEE floating point).
Properties
BinaryScaleFactor
The binary scale factor E.
public int BinaryScaleFactor { get; }
Property Value
BitsPerValue
The bits per packed value (for complex packing, per group reference;
for PNG, the image depth). 0 means every value is R.
public int BitsPerValue { get; }
Property Value
CompressionType
For template 5.40, the type of compression (code table 5.40): 0
lossless, 1 lossy; otherwise null. The decoder
doesn't need it: the codestream says which wavelet transform it uses.
public int? CompressionType { get; }
Property Value
- int?
DecimalScaleFactor
The decimal scale factor D.
public int DecimalScaleFactor { get; }
Property Value
MissingValueManagement
For templates 5.2 and 5.3, how missing values are embedded in the packed data; otherwise None.
public GribMissingValueManagement MissingValueManagement { get; }
Property Value
NumberOfGroups
For templates 5.2 and 5.3, the number of groups; otherwise 0.
public long NumberOfGroups { get; }
Property Value
NumberOfPackedValues
The number of values packed in Section 7: the grid points less those the bitmap marks missing.
public long NumberOfPackedValues { get; }
Property Value
OriginalFieldType
The type of the original field values (code table 5.1): 0 floating point, 1 integer.
public byte OriginalFieldType { get; }
Property Value
ReferenceValue
The reference value R.
public float ReferenceValue { get; }
Property Value
SpatialDifferencingOrder
For template 5.3, the order of spatial differencing (1 or 2); otherwise 0.
public int SpatialDifferencingOrder { get; }
Property Value
TargetCompressionRatio
For template 5.40 with lossy compression, the target compression
ratio M in M:1 the encoder aimed for; otherwise, or when
the template gives it as missing, null.
public int? TargetCompressionRatio { get; }
Property Value
- int?
TemplateNumber
The data representation template number (code table 5.0).
public int TemplateNumber { get; }