Documentation ¶
Index ¶
- Constants
- func DisciplineDescription(value uint8) string
- func EarthShapeDescription(value int) string
- func Export(messages []*Message, options Options)
- func ExportMessageAsPng(message *Message, filename string) error
- func ExportMessagesAsPngs(messages []*Message)
- func FilterValuesFromGeoFilter(message *Message, filter GeoFilter) (*[]float64, error)
- func GridDefinitionSourceDescription(value int) string
- func GridDefinitionTemplateDescription(value int) string
- func GridPointPositionDescription(value int) string
- func LocalTableVersionNumber(value int) string
- func MasterTableDescription(value int) string
- func MaxMin(float64s []float64) (float64, float64)
- func ParseData0(dataReader io.Reader, dataLength int, template *Data0) ([]float64, error)
- func ParseData2(dataReader io.Reader, dataLength int, template *Data2) ([]float64, error)
- func ParseData3(dataReader io.Reader, dataLength int, template *Data3) ([]float64, error)
- func ReadAerosolPresence(value int) string
- func ReadAerosolType(value int) string
- func ReadBitMapIndicator(value int) string
- func ReadCategoricalOutlook(value int) string
- func ReadCategoricalResult(value int) string
- func ReadCloudMaskType(value int) string
- func ReadCloudTopHeightQuality(value int) string
- func ReadCloudType(value int) string
- func ReadClusteringMethod(value int) string
- func ReadClutterFillerIndicator(value int) string
- func ReadCompressionType(value int) string
- func ReadContrailEngineType(value int) string
- func ReadContrailIntensity(value int) string
- func ReadDataRepresentationTemplateNumber(value int) string
- func ReadDataType(value uint8) string
- func ReadDerivedForecast(value int) string
- func ReadEnsembleForecastType(value int) string
- func ReadFireDetection(value int) string
- func ReadFloatingPointNumbersPrecision(value int) string
- func ReadGeneratingProcessType(value int) string
- func ReadGroupSplittingMethod(value int) string
- func ReadHorizontalDimensionProcessed(value int) string
- func ReadHorizontalLineType(value int) string
- func ReadIcing(value int) string
- func ReadIntervalType(value int) string
- func ReadLandUse(value int) string
- func ReadListInterpretation(value int) string
- func ReadMatrixCoordinateParameter(value int) string
- func ReadMatrixCoordinateValueFunctionDefinition(value int) string
- func ReadMissingDataTreatment(value int) string
- func ReadMissingValueManagement(value int) string
- func ReadOperatingMode(value int) string
- func ReadOriginalFieldValuesType(value int) string
- func ReadPixelSceneType(value int) string
- func ReadPlanetaryBoundaryLayerRegime(value int) string
- func ReadPrecipitableWaterCategory(value int) string
- func ReadPrecipitationType(value int) string
- func ReadProbabilityType(value int) string
- func ReadProductDefinitionTemplateNumber(value uint16) string
- func ReadProductDisciplineCategoryParameters(discipline uint16, category uint8, number uint8) string
- func ReadProductDisciplineParameters(discipline uint8, category uint8) string
- func ReadProductionStatus(value int) string
- func ReadQualityControlIndicator(value int) string
- func ReadReferenceTimeSignificance(value int) string
- func ReadRemotelySensedSnowCoverage(value int) string
- func ReadSnowCoveredTerrainElevation(value int) string
- func ReadSoilType(value int) string
- func ReadSpatialDifferencingOrder(value int) string
- func ReadSpatialProcessingType(value int) string
- func ReadSpectralDataRepresentationMode(value int) string
- func ReadStatisticalProcessingType(value int) string
- func ReadSurfaceTypesUnits(value int) string
- func ReadThunderstormCoverage(value int) string
- func ReadTimeIntervalsType(value int) string
- func ReadTimeRangeUnitIndicator(value int) string
- func ReadTurbulence(value int) string
- func ReadVerticalCoordinatePhysicalMeaning(value int) string
- func ReadVerticalDimensionCoordinateValuesDefinition(value int) string
- func ReadVolcanicAsh(value int) string
- func ReadWindGeneratedWaveSpectralDescription(value int) string
- func RedValue(value float64, maxValue float64, minValue float64) uint8
- func Reduce(readSeeker io.Reader, options Options, content chan []byte, end chan bool)
- func SpectralDataRepresentationTypeDescription(value int) string
- func StartStopIndexes(filter GeoFilter, grid Grid0) (uint32, uint32, uint32, uint32)
- type BasicAngle
- type BitReader
- type Data0
- type Data2
- type Data3
- type GeoFilter
- type Grid
- type Grid0
- type Grid10
- type Grid20
- type Grid30
- type Grid40
- type Grid90
- type GridHeader
- type Message
- type Options
- type Product0
- type Product1
- type Product2
- type Product5
- type Product6
- type Product7
- type Product8
- type ScaledValue
- type Section0
- type Section1
- type Section2
- type Section3
- type Section4
- type Section5
- type Section6
- type Section7
- type SectionHead
- type Surface
- type Time
- type TimeRangeSpecification
Constants ¶
const ( //ExportNone - do not export anything ExportNone = 0 // PrintMessageDisciplines - only print disciplines for the sections PrintMessageDisciplines = 1 // PrintMessageCategories - only print categories PrintMessageCategories = 2 // ExportJSONToConsole - export json to console ExportJSONToConsole = 3 // ExportToPNG - export data as a png ExportToPNG = 4 )
const ( // LatitudeNorth is the north-most latitude value LatitudeNorth = 90000000 // LatitudeSouth is the south-most latitude value LatitudeSouth = -90000000 // LongitudeStart is the minimum value for longitude LongitudeStart = 0 // LongitudeEnd is the maximum value for longitude LongitudeEnd = 360000000 )
const ( //Grib is a magic-number specifying the grib2-format Grib = 0x47524942 //EndSectionLength is the binary length of the end-section. Fixed number. EndSectionLength = 926365495 //SupportedGribEdition is 2 SupportedGribEdition = 2 )
const INT_MAX = 9223372036854775807
Variables ¶
This section is empty.
Functions ¶
func DisciplineDescription ¶
DisciplineDescription DisciplineDescription(Code table 0.0)
func EarthShapeDescription ¶
EarthShapeDescription EarthShapeDescription Shape of the earth (Code table 3.2)
func ExportMessageAsPng ¶ added in v1.2.5
func ExportMessagesAsPngs ¶
func ExportMessagesAsPngs(messages []*Message)
func FilterValuesFromGeoFilter ¶
FilterValuesFromGeoFilter ...
func GridDefinitionSourceDescription ¶
GridDefinitionSourceDescription GridDefinitionSourceDescription Source of Grid Definition (Code table 3.0)
func GridDefinitionTemplateDescription ¶
GridDefinitionTemplateDescription GridDefinitionTemplateDescription Grid Definition Template Number (Code table 3.1)
func GridPointPositionDescription ¶
GridPointPositionDescription Grid point position (code table 3.8)
func LocalTableVersionNumber ¶
LocalTableVersionNumber LocalTableVersionNumber (Code table 1.1)
func MasterTableDescription ¶
MasterTableDescription MasterTableDescription version number (Code table 1.0)
func ParseData0 ¶
ParseData0 parses data0 struct from the reader into the an array of floating-point values
func ParseData2 ¶
ParseData2 parses data2 struct from the reader into the an array of floating-point values
func ParseData3 ¶
ParseData3 parses data3 struct from the reader into the an array of floating-point values
func ReadAerosolPresence ¶
ReadAerosolPresence Aerosol presence (code table 4.205)
func ReadAerosolType ¶
ReadAerosolType Aerosol Type (code table 4.233)
func ReadBitMapIndicator ¶
ReadBitMapIndicator ReadBitMapIndicator is a Bit Map Indicator (code table 6.0)
func ReadCategoricalOutlook ¶
ReadCategoricalOutlook Categorical Outlook (code table 4.224)
func ReadCategoricalResult ¶
ReadCategoricalResult Categorical Result (code table 4.222)
func ReadCloudMaskType ¶
ReadCloudMaskType Cloud mask type (code table 4.217)
func ReadCloudTopHeightQuality ¶
ReadCloudTopHeightQuality Cloud top height quality indicator (code table 4.219)
func ReadCloudType ¶
ReadCloudType Cloud type (code table 4.203)
func ReadClusteringMethod ¶
ReadClusteringMethod Clustering Method (code table 4.8)
func ReadClutterFillerIndicator ¶
ReadClutterFillerIndicator Clutter Filter Indicator (code table 4.14)
func ReadCompressionType ¶
ReadCompressionType ReadCompressionType maps Type of compression (code table 5.40)
func ReadContrailEngineType ¶
ReadContrailEngineType Contrail engine type (code table 4.211)
func ReadContrailIntensity ¶
ReadContrailIntensity Contrail intensity (code table 4.210)
func ReadDataRepresentationTemplateNumber ¶
ReadDataRepresentationTemplateNumber Data Representation Template Number (code table 5.0)
func ReadDataType ¶
ReadDataType Type of data (Code table 1.4)
func ReadDerivedForecast ¶
ReadDerivedForecast Derived forecast (code table 4.7)
func ReadEnsembleForecastType ¶
ReadEnsembleForecastType Type of ensemble forecast (code table 4.6)
func ReadFireDetection ¶
ReadFireDetection Fire Detection Indicator (code table 4.223)
func ReadFloatingPointNumbersPrecision ¶
ReadFloatingPointNumbersPrecision ReadFloatingPointNumbersPrecision maps Precision of floating-point numbers to a string (code table 5.7)
func ReadGeneratingProcessType ¶
ReadGeneratingProcessType Type of generating process (code table 4.3)
func ReadGroupSplittingMethod ¶
ReadGroupSplittingMethod ReadGroupSplittingMethod - Group Splitting Method (code table 5.4)
func ReadHorizontalDimensionProcessed ¶
ReadHorizontalDimensionProcessed Horizontal dimension processed (code table 4.220)
func ReadHorizontalLineType ¶
ReadHorizontalLineType Type of horizontal line (Code table 3.20)
func ReadListInterpretation ¶
ReadListInterpretation Interpretation of list of numbers defining number of points (Code table 3.11)
func ReadMatrixCoordinateParameter ¶
ReadMatrixCoordinateParameter Matrix coordinate parameter (code table 5.3)
func ReadMatrixCoordinateValueFunctionDefinition ¶
ReadMatrixCoordinateValueFunctionDefinition Matrix coordinate value function definition (code table 5.2)
func ReadMissingDataTreatment ¶
ReadMissingDataTreatment Treatment of missing data (code table 4.221)
func ReadMissingValueManagement ¶
ReadMissingValueManagement ReadMissingValueManagement - Missing Value Management for Complex Packing (code table 5.5)
func ReadOperatingMode ¶
ReadOperatingMode Operating Mode (code table 4.12)
func ReadOriginalFieldValuesType ¶
ReadOriginalFieldValuesType Type of original field values (code table 5.1)
func ReadPixelSceneType ¶
ReadPixelSceneType Pixel scene type (code table 4.218)
func ReadPlanetaryBoundaryLayerRegime ¶
ReadPlanetaryBoundaryLayerRegime Planetary boundary layer regime (code table 4.209)
func ReadPrecipitableWaterCategory ¶
ReadPrecipitableWaterCategory Precipitable water category (code table 4.202)
func ReadPrecipitationType ¶
ReadPrecipitationType Precipitation Type (code table 4.201)
func ReadProbabilityType ¶
ReadProbabilityType Probability Type (code table 4.9)
func ReadProductDefinitionTemplateNumber ¶
ReadProductDefinitionTemplateNumber Category Definition Template Number (Code table 4.0)
func ReadProductDisciplineCategoryParameters ¶
func ReadProductDisciplineCategoryParameters(discipline uint16, category uint8, number uint8) string
ReadProductDisciplineCategoryParameters Parameter number by product discipline and parameter category (code table 4.2)
func ReadProductDisciplineParameters ¶
ReadProductDisciplineParameters Discipline of parameters by product discipline (Code table 4.1)
func ReadProductionStatus ¶
ReadProductionStatus Production status of data(Code table 1.3)
func ReadQualityControlIndicator ¶
ReadQualityControlIndicator Quality Control Indicator (code table 4.13)
func ReadReferenceTimeSignificance ¶
ReadReferenceTimeSignificance Significance of reference time (Code table 1.2)
func ReadRemotelySensedSnowCoverage ¶
ReadRemotelySensedSnowCoverage Remotely Sensed Snow Coverage (code table 4.215)
func ReadSnowCoveredTerrainElevation ¶
ReadSnowCoveredTerrainElevation Elevation of Snow Covered Terrain (code table 4.216)
func ReadSpatialDifferencingOrder ¶
ReadSpatialDifferencingOrder ReadSpatialDifferencingOrder Order of Spatial Differencing (code table 5.6)
func ReadSpatialProcessingType ¶
ReadSpatialProcessingType TYPE OF SPATIAL PROCESSING USED TO ARRIVE AT A GIVEN DATA VALUE FROM THE SOURCE DATA (code table 4.15)
func ReadSpectralDataRepresentationMode ¶
ReadSpectralDataRepresentationMode SpectralDataRepresentationModeDescription Spectral data representation mode (Code table 3.7)
func ReadStatisticalProcessingType ¶
ReadStatisticalProcessingType Type of statistical processing (code table 4.10)
func ReadSurfaceTypesUnits ¶
ReadSurfaceTypesUnits Fixed surface types and units (code table 4.5)
func ReadThunderstormCoverage ¶
ReadThunderstormCoverage Thunderstorm coverage (code table 4.204)
func ReadTimeIntervalsType ¶
ReadTimeIntervalsType Type of time intervals (code table 4.11)
func ReadTimeRangeUnitIndicator ¶
ReadTimeRangeUnitIndicator Indicator of unit of time range (code table 4.4)
func ReadTurbulence ¶
ReadTurbulence Turbulence (code table 4.208)
func ReadVerticalCoordinatePhysicalMeaning ¶
ReadVerticalCoordinatePhysicalMeaning Physical meaning of vertical coordinate (Code table 3.15)
func ReadVerticalDimensionCoordinateValuesDefinition ¶
ReadVerticalDimensionCoordinateValuesDefinition Vertical dimension coordinate values definition (Code table 3.21)
func ReadVolcanicAsh ¶
ReadVolcanicAsh Volcanic ash (code table 4.206)
func ReadWindGeneratedWaveSpectralDescription ¶
ReadWindGeneratedWaveSpectralDescription Wind-Generated Wave Sectral Description (code table 4.235)
func Reduce ¶
Reduce the file in readseeker with the given options, omitting all other products and areas
func SpectralDataRepresentationTypeDescription ¶
SpectralDataRepresentationTypeDescription SpectralDataRepresentationTypeDescription Spectral data representation type (Code table 3.6)
Types ¶
type BasicAngle ¶
type BasicAngle struct { BasicAngle uint32 `json:"basicAngle"` BasicAngleSub uint32 `json:"basicAngleSub"` }
BasicAngle specifies the angle of a grid
type BitReader ¶
type BitReader struct {
// contains filtered or unexported fields
}
BitReader is undocomented
type Data0 ¶
type Data0 struct { Reference float32 `json:"reference"` BinaryScale int16 `json:"binaryScale"` DecimalScale int16 `json:"decimalScale"` Bits uint8 `json:"bits"` Type uint8 `json:"type"` }
Data0 is a Grid point data - simple packing http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-0.shtml
| Octet Number | Content ----------------------------------------------------------------------------------------- | 12-15 | Reference value (R) (IEEE 32-bit floating-point value) | 16-17 | Binary scale factor (E) | 18-19 | Decimal scale factor (D) | 20 | Number of bits used for each packed value for simple packing, or for each | | group reference value for complex packing or spatial differencing | 21 | Type of original field values | | - 0 : Floating point | | - 1 : Integer | | - 2-191 : reserved | | - 192-254 : reserved for Local Use | | - 255 : missing
type Data2 ¶
type Data2 struct { Data0 GroupMethod uint8 `json:"groupMethod"` // 22 MissingValue uint8 `json:"missingValue"` // 23 MissingSubstitute1 uint32 `json:"missingSubstitute1"` // 24-27 MissingSubstitute2 uint32 `json:"missingSubstitute2"` // 28-31 NG uint32 `json:"ng"` // 32-35 GroupWidths uint8 `json:"groupWidths"` // 36 GroupWidthsBits uint8 `json:"groupWidthsBits"` // 37 GroupLengthsReference uint32 `json:"groupLengthsReference"` // 38-41 GroupLengthIncrement uint8 `json:"groupLengthIncrement"` // 42 GroupLastLength uint32 `json:"groupLastLength"` // 43-46 GroupScaledLengthsBits uint8 `json:"groupScaledLengthsBits"` // 47 }
Data2 is a Grid point data - complex packing http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-2.shtml
| Octet Number | Content ----------------------------------------------------------------------------------------- | 12-15 | Reference value (R) (IEEE 32-bit floating-point value) | 16-17 | Binary scale factor (E) | 18-19 | Decimal scale factor (D) | 20 | Number of bits used for each packed value for simple packing, or for each | | group reference value for complex packing or spatial differencing | 21 | Type of original field values | | - 0 : Floating point | | - 1 : Integer | | - 2-191 : reserved | | - 192-254 : reserved for Local Use | | - 255 : missing | 22 | Group splitting method used (see Code Table 5.4) | | - 0 : Row by Row Splitting | | - 1 : General Group Splitting | | - 2-191 : Reserved | | - 192-254 : Reserved for Local Use | | - 255 : Missing | 23 | Missing value management used (see Code Table 5.5) | | - 0 : No explicit missing values included within the data values | | - 1 : Primary missing values included within the data values | | - 2 : Primary and secondary missing values included within the data values | | - 3-191 : Reserved | | - 192-254 : Reserved for Local Use | | - 255 : Missing | 24-27 | Primary missing value substitute | 28-31 | Secondary missing value substitute | 32-35 | NG ― number of groups of data values into which field is split | 36 | Reference for group widths (see Note 12) | 37 | Number of bits used for the group widths (after the reference value in octet 36 | | has been removed) | 38-41 | Reference for group lengths (see Note 13) | 42 | Length increment for the group lengths (see Note 14) | 43-46 | True length of last group | 47 | Number of bits used for the scaled group lengths (after subtraction of the | | reference value given in octets 38-41 and division by the length increment | | given in octet 42)
type Data3 ¶
type Data3 struct { Data2 SpatialOrderDifference uint8 `json:"spatialOrderDifference"` OctetsNumber uint8 `json:"octetsNumber"` }
Data3 is a Grid point data - complex packing and spatial differencing http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_temp5-3.shtml
type GeoFilter ¶
type GeoFilter struct { MinLat int32 `json:"minLat"` MaxLat int32 `json:"maxLat"` MinLong int32 `json:"minLong"` MaxLong int32 `json:"maxLong"` }
GeoFilter is used to filter values. Only values inside the filter is returned when using this filter
type Grid0 ¶
type Grid0 struct { //Name := "Latitude/longitude (or equidistant cylindrical, or Plate Carree) " GridHeader Ni uint32 `json:"ni"` Nj uint32 `json:"nj"` BasicAngle BasicAngle `json:"basicAngle"` La1 int32 `json:"la1"` Lo1 int32 `json:"lo1"` ResolutionAndComponentFlags uint8 `json:"resolutionAndComponentFlags"` La2 int32 `json:"la2"` Lo2 int32 `json:"lo2"` Di int32 `json:"di"` Dj int32 `json:"dj"` ScanningMode uint8 `json:"scanningMode"` }
Grid0 Definition Template 3.0: Latitude/longitude (or equidistant cylindrical, or Plate Carree)
type Grid10 ¶
type Grid10 struct { //name := "Mercator" GridHeader Ni uint32 `json:"ni"` Nj int32 `json:"nj"` La1 int32 `json:"la1"` Lo1 int32 `json:"lo1"` ResolutionAndComponentFlags uint8 `json:"resolutionAndComponentFlags"` Lad int32 `json:"lad"` La2 int32 `json:"la2"` Lo2 int32 `json:"lo2"` ScanningMode uint8 `json:"scanningMode"` GridOrientation uint32 `json:"gridOrientation"` Di int32 `json:"di"` Dj int32 `json:"dj"` }
Grid10 Definition Template 3.10: Mercator
type Grid20 ¶
type Grid20 struct { //name = "Polar stereographic projection "; GridHeader Nx uint32 `json:"nx"` Ny uint32 `json:"ny"` La1 int32 `json:"na1"` Lo1 int32 `json:"lo1"` ResolutionAndComponentFlags uint8 `json:"resolutionAndComponentFlags"` Lad int32 `json:"lad"` Lov int32 `json:"lov"` Dx int32 `json:"dx"` Dy int32 `json:"dy"` ProjectionCenter uint8 `json:"projectionCenter"` ScanningMode uint8 `json:"scanningMode"` }
Grid20 Definition Template 3.20: Polar stereographic projection
type Grid30 ¶
type Grid30 struct { //name = "Polar stereographic projection "; GridHeader Nx uint32 `json:"nx"` Ny uint32 `json:"ny"` La1 int32 `json:"la1"` Lo1 int32 `json:"lo1"` ResolutionAndComponentFlags uint8 `json:"resolutionAndComponentFlags"` Lad int32 `json:"lad"` Lov int32 `json:"lov"` Dx int32 `json:"dx"` Dy int32 `json:"dy"` ProjectionCenter uint8 `json:"projectionCenter"` ScanningMode uint8 `json:"scanningMode"` Latin1 uint32 `json:"latin1"` Latin2 uint32 `json:"latin2"` LaSouthPole uint32 `json:"laSouthPole"` LoSouthPole uint32 `json:"loSouthPole"` }
Grid30 Definition Template 3.30: Lambert conformal
type Grid40 ¶
type Grid40 struct { //name = "Gaussian latitude/longitude "; GridHeader Ni uint32 `json:"ni"` Nj uint32 `json:"nj"` BasicAngle uint32 `json:"basicAngle"` La1 int32 `json:"la1"` Lo1 int32 `json:"lo1"` ResolutionAndComponentFlags uint8 `json:"resolutionAndComponentFlags"` La2 int32 `json:"la2"` Lo2 int32 `json:"lo2"` Di int32 `json:"di"` N uint32 `json:"n"` ScanningMode uint8 `json:"scanningMode"` }
Grid40 Definition Template 3.40: Gaussian latitude/longitude
type Grid90 ¶
type Grid90 struct { //name = "Space view perspective or orthographic "; GridHeader Nx uint32 `json:"nx"` Ny uint32 `json:"ny"` //BasicAngle BasicAngle Lap int32 `json:"lap"` Lop int32 `json:"lop"` ResolutionAndComponentFlags uint8 `json:"resolutionAndComponentFlags"` Dx uint32 `json:"dx"` Dy uint32 `json:"dy"` Xp uint32 `json:"xp"` Yp uint32 `json:"yp"` ScanningMode uint8 `json:"scanningMode"` Orientation uint32 `json:"orientation"` Nr uint32 `json:"nr"` Xo uint32 `json:"xo"` Yo uint32 `json:"yo"` }
Grid90 Definition Template 3.90: Space view perspective or orthographic FIXME: implement properly Grid90
type GridHeader ¶
type GridHeader struct { EarthShape uint8 `json:"earthShape"` SphericalRadius ScaledValue `json:"sphericalRadius"` MajorAxis ScaledValue `json:"majorAxis"` MinorAxis ScaledValue `json:"minorAxis"` }
GridHeader is a common header in all grids
func (*GridHeader) Export ¶
func (h *GridHeader) Export() (d map[string]string)
Export gridheader to a map[string]string
type Message ¶
type Message struct { Section0 Section0 Section1 Section1 Section2 Section2 Section3 Section3 Section4 Section4 Section5 Section5 Section6 Section6 Section7 Section7 }
Message is the entire message for a data-layer
func ReadMessage ¶
ReadMessage reads the actual messages from a gribfile-reader (io.Reader from either file, http or any other io.Reader)
func ReadMessages ¶
ReadMessages reads all message from gribFile
type Options ¶
type Options struct { Operation string `json:"operation"` Discipline int `json:"discipline"` // -1 means all disciplines DataExport bool `json:"dataExport"` Category int `json:"category"` // -1 means all categories Filepath string `json:"filePath"` ReduceFilePath string `json:"reduceFilePath"` ExportType int `json:"exportType"` MaximumNumberOfMessages int `json:"maximumNumberOfMessages"` GeoFilter GeoFilter `json:"geoFilter"` Surface Surface `json:"surfaceFilter"` }
Options is used to filter messages.
type Product0 ¶
type Product0 struct { // category 0 is temperature, see http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table4-1.shtml ParameterCategory uint8 `json:"parameterCategory"` ParameterNumber uint8 `json:"parameterNumber"` ProcessType uint8 `json:"processType"` BackgroundProcess uint8 `json:"backgroundProcess"` AnalysisProcess uint8 `json:"analysisProcess"` Hours uint16 `json:"hours"` Minutes uint8 `json:"minutes"` TimeUnitIndicator uint8 `json:"timeUnitIndicator"` ForecastTime uint32 `json:"forecastTime"` FirstSurface Surface `json:"firstSurface"` SecondSurface Surface `json:"secondSurface"` }
Product0 http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table4-0.shtml Analysis or forecast at a horizontal level or in a horizontal layer at a point in time
type Product1 ¶
type Product1 struct { Product0 EnsembleForecastType uint8 `json:"ensembleForecastType"` PertubationNumber uint8 `json:"pertubationNumber"` ForecastInEnsembleCount uint8 `json:"forecastInEnsembleCount"` }
Product1 http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_temp4-1.shtml
type Product2 ¶
type Product2 struct { Product0 DerivedForecast uint8 `json:"derivedForecast"` ForecastInEnsembleCount uint8 `json:"forecastInEnsembleCount"` }
Product2 http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_temp4-2.shtml
type Product5 ¶
type Product5 struct { Product0 ForecastProbabilityNumber uint8 `json:"forecastProbabilityNumber"` TotalForecastProbabilities uint8 `json:"totalForecastProbabilities"` ProbabilityType uint8 `json:"probabilityType"` ScaleFactorLowerLimit uint8 `json:"scaleFactorLowerLimit"` ScaleValueLowerLimit uint32 `json:"scaleValueLowerLimit"` ScaleFactorUpperLimit uint8 `json:"scaleFactorUpperLimit"` ScaleValueUpperLimit uint32 `json:"scaleValueUpperLimit"` }
Product5 http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_temp4-5.shtml
type Product7 ¶
type Product7 struct {
Product0
}
Product7 http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_temp4-7.shtml
type Product8 ¶
type Product8 struct { Product0 Time Time `json:"time"` NumberOfIntervalTimeRanges uint8 `json:"numberOfIntervalTimeRanges"` // length of last datatype TotalMissingDataValuesCount uint32 `json:"totalMissingDataValuesCount"` TimeRangeSpecification1 TimeRangeSpecification `json:"timeRangeSpecification1"` TimeRangeSpecification2 TimeRangeSpecification `json:"timeRangeSpecification2"` // 59-70 AdditionalTimeRangeSpecifications []TimeRangeSpecification `json:"additionalTimeRangeSpecifications"` // 71-n }
Product8 http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_temp4-8.shtml
type ScaledValue ¶
ScaledValue specifies the scale of a value
type Section0 ¶
type Section0 struct { Indicator uint32 `json:"indicator"` Reserved uint16 `json:"reserved"` Discipline uint8 `json:"discipline"` Edition uint8 `json:"edition"` MessageLength uint64 `json:"messageLength"` }
Section0 is the indicator section http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_sect0.shtml This section serves to identify the start of the record in a human readable form, indicate the total length of the message, and indicate the Edition number of GRIB used to construct or encode the message. For GRIB2, this section is always 16 octets long.
| Octet Number | Content ----------------------------------------------------------------------------------------- | 1-4 | 'GRIB' (Coded according to the International Alphabet Number 5) | 5-6 | reserved | 7 | Discipline (From Table 0.0) | 8 | Edition number - 2 for GRIB2 | 9-16 | Total length of GRIB message in octets (All sections);
type Section1 ¶
type Section1 struct { OriginatingCenter uint16 `json:"ooriginatingCenter"` OriginatingSubCenter uint16 `json:"originatingSubCenter"` MasterTablesVersion uint8 `json:"masterTablesVersion"` LocalTablesVersion uint8 `json:"localTablesVersion"` ReferenceTimeSignificance uint8 `json:"referenceTimeSignificance"` // Table 1.2, value 1 is start of forecast ReferenceTime Time `json:"referenceTime"` ProductionStatus uint8 `json:"productionStatus"` Type uint8 `json:"type"` // data type, Table 1.4, value 1 is forecast products }
type Section2 ¶
type Section2 struct {
LocalUse []uint8 `json:"localUse"`
}
Section2 is the Local Use section http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect2.shtml
| Octet Number | Content ----------------------------------------------------------------------------------------- | 1-4 | Length of the section in octets (N) | 5 | Number of the section (2) | 6-N | Local Use
Center=7 (NCEP), subcenter=14(NWS Meteorological Development Laboratory (MDL)) used octet 6 to indicate which local use table to use. For MDL, octet 6=1 indicates use: "MDL Template 2.1"
type Section3 ¶
type Section3 struct { Source uint8 `json:"source"` DataPointCount uint32 `json:"datapointCount"` PointCountOctets uint8 `json:"pointCountOctets"` PointCountInterpretation uint8 `json:"pointCountInterpretation"` TemplateNumber uint16 `json:"templateNumber"` Definition interface{} `json:"definition"` }
Section3 is the Grid Definition section http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect3.shtml It contains information of the grid(earth shape, long, lat, etc)
| Octet Number | Content ----------------------------------------------------------------------------------------- | 1-4 | Length of the section in octets (nn) | 5 | Number of the section (3) | 6 | Source of grid definition (See Table 3.0) (See note 1 below) | 7-10 | Number of data points | 11 | Number of octets for optional list of numbers defining number of points (See note 2 below) | 12 | Interpetation of list of numbers defining number of points (See Table 3.11) | 13-14 | Grid definition template number (= N) (See Table 3.1) | 15-xx | Grid definition template (See Template 3.N, where N is the grid definition template | | number given in octets 13-14) | [xx+1]-nn | Optional list of numbers defining number of points (See notes 2, 3, and 4 below)
If octet 6 is not zero, octets 15-xx (15-nn if octet 11 is zero) may not be supplied. This should be documented with all bits set to 1 in the grid definition template number.
An optional list of numbers defining number of points is used to document a quasi-regular grid, where the number of points may vary from one row to another. In such a case, octet 11 is non zero and gives the number octets on which each number of points is encoded. For all other cases, such as regular grids, octets 11 and 12 are zero and no list is appended to the grid definition template.
If a list of numbers defining the number of points is preset, it is appended at the end of the grid definition template ( or directly after the grid definition number if the template is missing). When the grid definition template is present, the length is given according to bit 3 of the scanning mode flag octet (length is Nj or Ny for flag value 0). List ordering is implied by data scanning.
Depending on the code value given in octet 12, the list of numbers either:
- Corresponds to the coordinate lines as given in the grid definition, or
- Corresponds to a full circle, or
- Does not apply.
func ReadSection3 ¶
ReadSection3 reads section3 from reader(f). the Lenght parameter is ignored
type Section4 ¶
type Section4 struct { CoordinatesCount uint16 `json:"coordinatesCount"` ProductDefinitionTemplateNumber uint16 `json:"productDefinitionTemplateNumber"` ProductDefinitionTemplate Product0 `json:"productDefinitionTemplate"` // FIXME, support more products Coordinates []byte `json:"coordinates"` }
Section4 is the Product Definition Section http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect4.shtml
| Octet Number | Content ----------------------------------------------------------------------------------------- | 1-4 | Length of the section in octets (nn) | 5 | Number of the section (4) | 6-7 | Number of coordinate values after template (See note 1 below) | 8-9 | Product definition template number (See Table 4.0) | 10-xx | Product definition template (See product template 4.X, where X is | | the number given in octets 8-9) | [xx+1]-nn | Optional list of coordinate values (See notes 2 and 3 below)
Coordinate values are intended to document the vertical discretization associated with model data on hybrid coordinate vertical levels. A value of zero in octets 6-7 indicates that no such values are present. Otherwise the number corresponds to the whole set of values.
Hybrid systems employ a means of representing vertical coordinates in terms of a mathematical combination of pressure and sigma coordinates. When used in conjunction with a surface pressure field and an appropriate mathematical expression, the vertical coordinate parameters may be used to interpret the hybrid vertical coordinate.
Hybrid coordinate values, if present, should be encoded in IEEE 32-bit floating point format. They are intended to be encoded as pairs.
type Section5 ¶
type Section5 struct { PointsNumber uint32 `json:"pointsNumber"` DataTemplateNumber uint16 `json:"dataTemplateNumber"` //DataTemplate Data3 `json:"dataTemplate"` // FIXME, support more data-types Data []byte `json:"dataTemplate"` }
Section5 is Data Representation section http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect5.shtml
| Octet Number | Content ----------------------------------------------------------------------------------------- | 1-4 | Length of the section in octets (nn) | 5 | Number of the section (5) | 6-9 | Number of data points where one or more values are specified in Section 7 when a bit map is present, | | total number of data points when a bit map is absent. | 10-11 | Data representation template number (See Table 5.0 http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table5-0.shtml) | 12-nn | Data representation template (See Template 5.X, where X is the number given in octets 10-11)
func ReadSection5 ¶
ReadSection5 is poorly documented other than code
func (Section5) GetDataTemplate ¶
GetDataTemplate extract DataTemplate from the section
type Section6 ¶
type Section6 struct { BitmapIndicator uint8 `json:"bitmapIndicator"` Bitmap []byte `json:"bitmap"` }
Section6 is the Bit-Map section http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect6.shtml
| Octet Number | Content ----------------------------------------------------------------------------------------- | 1-4 | Length of the section in octets (nn) | 5 | Number of the section (6) | 6 | Bit-map indicator (See Table 6.0) (See note 1 below) | 7-nn | Bit-map
If octet 6 is not zero, the length of this section is 6 and octets 7-nn are not present.
type Section7 ¶
type Section7 struct {
Data []float64 `json:"data"`
}
Section7 is the Data section http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect7.shtml
| Octet Number | Content ----------------------------------------------------------------------------------------- | 1-4 | Length of the section in octets (nn) | 5 | Number of the section (7) | 6-nn | Data in a format described by data Template 7.X, where X is the data representation template number | | given in octets 10-11 of Section 5.
type SectionHead ¶
SectionHead is the common header for each section1-8
| Octet Number | Content ----------------------------------------------------------- | 1-4 | Length of the section in octets (21 or N) | 5 | Number of the section (1)
func ReadSectionHead ¶
func ReadSectionHead(section io.Reader) (head SectionHead, err error)
ReadSectionHead is poorly documented other than code
func (SectionHead) ContentLength ¶
func (s SectionHead) ContentLength() int
ContentLength returns the binary length of the sectionhead
func (SectionHead) SectionNumber ¶
func (s SectionHead) SectionNumber() uint8
SectionNumber returns the number of the sectionhead
func (SectionHead) String ¶
func (s SectionHead) String() string
type Surface ¶
type Surface struct { Type uint8 `json:"type"` // type 220: Planetary Boundary Layer Scale uint8 `json:"scale"` Value uint32 `json:"value"` // e.g. meters above sea-level }
Surface describes a surface for a product, see http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table4-5.shtml
type Time ¶
type Time struct { Year uint16 `json:"year"` // year Month uint8 `json:"month"` // month + 1 Day uint8 `json:"day"` // day Hour uint8 `json:"hour"` // hour Minute uint8 `json:"minute"` // minute Second uint8 `json:"second"` // second }
Time is the time of section 1
| Octet Number | Content --------------------------------- | 13-14 | Year (4 digits) | 15 | Month | 16 | Day | 17 | Hour | 18 | Minute | 19 | Second
type TimeRangeSpecification ¶
type TimeRangeSpecification struct { StatisticalFieldCalculationProcess uint8 `json:"statisticalFieldCalculationProcess"` // 47 IncrementBetweenSuccessiveFieldsType uint8 `json:"incrementBetweenSuccessiveFieldsType"` // 48 IncrementBetweenSuccessiveFieldsRangeTimeUnitIndicator uint8 `json:"incrementBetweenSuccessiveFieldsRangeTimeUnitIndicator"` // 49 StatististicalProcessTimeLength uint32 `json:"statististicalProcessTimeLength"` // 50-53 IncrementBetweenSuccessiveFieldsTimeUnitIndicator uint8 `json:"incrementBetweenSuccessiveFieldsTimeUnitIndicator"` // 54 TimeIncrementBetweenSuccessiveField uint32 `json:"timeIncrementBetweenSuccessiveField"` // 55-58 }
TimeRangeSpecification describes timerange for products