Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IntFromBytes ¶ added in v0.4.0
IntFromBytes converts an arbitrary length byte slice into an int using sign-and-magnitude encoding.
func UintFromBytes ¶ added in v0.4.0
UintFromBytes converts an arbitrary length byte slice into an unsigned integer.
Types ¶
type BitStream ¶ added in v0.4.0
type BitStream struct {
// contains filtered or unexported fields
}
BitStream is used for reading bits from a byte slice and decoding them into values.
func NewBitStream ¶ added in v0.4.0
NewBitStream instantiates a new BitStream for the given byte slice.
func (*BitStream) ReadBits ¶ added in v0.4.0
ReadBits reads n bits from the stream and returns them as a uint64.
func (*BitStream) ReadSignedBits ¶ added in v0.4.0
ReadSignedBits reads n bits from the stream and returns them as an int64.
type BitmapReader ¶ added in v0.2.3
type BitmapReader struct {
// contains filtered or unexported fields
}
BitmapReader is used to read the bitmap section of a GRIB record. The bitmap section is used to determine which values are missing.
func NewBitmapReader ¶ added in v0.2.3
func NewBitmapReader(rec record.Record) *BitmapReader
NewBitmapReader instantiates a new BitmapReader from the given record.
func (*BitmapReader) IsMissing ¶ added in v0.4.0
func (r *BitmapReader) IsMissing(index int) bool
IsMissing returns true if the value at the given index is missing.
type ComplexParams ¶ added in v0.4.0
type ComplexParams struct {
TotalPoints int
DataPoints int
Order int
SpatialOctets int
NG int
BitsPerGroup int
BitsPerGroupWidth int
BitsPerScaledGroupLength int
GroupWidthReference int
GroupLengthReference int
GroupLengthIncrement int
LastGroupLength int
Ref float64
BinaryScale int
DecimalScale int
MissingValueManagement int
PrimaryMissingValue float64
SecondaryMissingValue float64
Bitmap *BitmapReader
}
ComplexParams contains the parameters needed for unpacking complex data, including spatially processed complex data.
func (*ComplexParams) UnpackComplex ¶ added in v0.4.0
func (p *ComplexParams) UnpackComplex(packedData []byte) ([]float64, error)
UnpackComplex unpacks the provided byte slice into a slice of float64 values.
Note: the wgrib2 C codebase on GitHub was especially useful in compiling the logic, in addition to the GRIB2 reference documents hosted by NCEP and the regulations hosted by ECWMF.
func (*ComplexParams) UnpackComplexIterator ¶ added in v0.4.9
type Template0 ¶
type Template0 struct {
ReferenceValue float64
BinaryScaleFactor int
DecimalScaleFactor int
BitsPerValue int
OriginalFieldType int
}
Template0 contains the fields for Grid Point Data - Simple Packing
func (Template0) DecimalScale ¶ added in v0.4.1
DecimalScale returns the decimal scale factor of the record. The decimal scale factor is used to shift the decimal point of a decoded value to the correct position.
type Template2 ¶ added in v0.4.0
type Template2 struct {
ReferenceValue float64
BinaryScaleFactor int
DecimalScaleFactor int
BitsPerGroup int
OriginalFieldType int
GroupSplittingMethod int
MissingValueManagement int
PrimaryMissingValue int
SecondaryMissingValue int
TotalGroups int
GroupWidthReference int
BitsUsedForGroupWidths int
GroupLengthReference int
LengthIncrementForGroupLengths int
LastGroupLength int
BitsUsedForScaledGroupLengths int
}
Template2 contains the fields for Grid Point Data - Complex Packing
func (Template2) DecimalScale ¶ added in v0.4.1
DecimalScale returns the decimal scale factor of the record. The decimal scale factor is used to shift the decimal point of a decoded value to the correct position.
func (Template2) GetValues ¶ added in v0.4.0
GetValues unpacks the record's data into the original values
type Template3 ¶
type Template3 struct {
ReferenceValue float64
BinaryScaleFactor int
DecimalScaleFactor int
BitsPerGroup int
OriginalFieldType int
GroupSplittingMethod int
MissingValueManagement int
PrimaryMissingValue int
SecondaryMissingValue int
TotalGroups int
GroupWidthReference int
BitsUsedForGroupWidths int
GroupLengthReference int
LengthIncrementForGroupLengths int
LastGroupLength int
BitsUsedForScaledGroupLengths int
SpatialDifferenceOrder int
TotalSpatialDifferencingOctets int
}
Template3 contains the fields for Grid Point Data - Complex Packing and Spatial Differencing
func (Template3) DecimalScale ¶ added in v0.4.1
DecimalScale returns the decimal scale factor of the record. The decimal scale factor is used to shift the decimal point of a decoded value to the correct position.
type Template4 ¶ added in v0.4.5
type Template4 struct {
Precision int
}
Template4 contains the fields for Grid Point Data - IEEE Floating Point Data
func (Template4) DecimalScale ¶ added in v0.4.5
DecimalScale returns the decimal scale factor of the record. The decimal scale factor is used to shift the decimal point of a decoded value to the correct position.
func (Template4) GetValues ¶ added in v0.4.5
GetValues unpacks the record's data into the original values
type Template40 ¶ added in v0.2.3
type Template40 struct {
ReferenceValue float32
BinaryScaleFactor int
DecimalScaleFactor int
BitDepth int
OriginalFieldType int
CompressionType int
TargetCompressionRatio int
}
Template40 contains the fields for Grid point data - JPEG 2000 code stream format
func (Template40) DecimalScale ¶ added in v0.4.1
func (t Template40) DecimalScale() int
DecimalScale returns the decimal scale factor of the record. The decimal scale factor is used to shift the decimal point of a decoded value to the correct position.
func (Template40) GetValues ¶ added in v0.2.3
func (t Template40) GetValues(rec record.Record) ([]float64, error)
GetValues unpacks the record's data into the original values
func (Template40) Parse ¶ added in v0.2.3
func (t Template40) Parse(section record.Section5) (record.DataRepresentationDefinition, error)
Parse fills in the template from the provided section
func (Template40) ValuesIterator ¶ added in v0.4.9
type Template41 ¶ added in v0.2.6
type Template41 struct {
ReferenceValue float64
BinaryScaleFactor int
DecimalScaleFactor int
BitDepth int
OriginalFieldType int
}
Template41 contains the fields for Grid point data - Portable Network Graphics (PNG)
func (Template41) DecimalScale ¶ added in v0.4.1
func (t Template41) DecimalScale() int
DecimalScale returns the decimal scale factor of the record. The decimal scale factor is used to shift the decimal point of a decoded value to the correct position.
func (Template41) GetValues ¶ added in v0.2.6
func (t Template41) GetValues(rec record.Record) ([]float64, error)
GetValues unpacks the record's data into the original values
func (Template41) Parse ¶ added in v0.2.6
func (t Template41) Parse(section record.Section5) (record.DataRepresentationDefinition, error)
Parse fills in the template from the provided section