Debian Codegraph @

internal/magic/meteo.go

raw symbols SCIP
1 package magic
2
3 import "bytes"
4
5 // GRIB matches a GRIdded Binary meteorological file.
6 // https://www.nco.ncep.noaa.gov/pmb/docs/on388/
7 // https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/
8 func GRIB(raw []byte, _ uint32) bool {
9 return len(raw) > 7 &&
10 bytes.HasPrefix(raw, []byte("GRIB")) &&
11 (raw[7] == 1 || raw[7] == 2)
12 }
13
14 // BUFR matches meteorological data format for storing point or time series data.
15 // https://confluence.ecmwf.int/download/attachments/31064617/ecCodes_BUFR_in_a_nutshell.pdf?version=1&modificationDate=1457000352419&api=v2
16 func BUFR(raw []byte, _ uint32) bool {
17 return len(raw) > 7 &&
18 bytes.HasPrefix(raw, []byte("BUFR")) &&
19 (raw[7] == 0x03 || raw[7] == 0x04)
20 }