4
$\begingroup$

I'm downloading .grib files from NCEP: ftp://nomads.ncdc.noaa.gov/GFS/analysis_only/

Each file has 315 bands. What are their names?

Reproducibility with R:

library(stars)
library(cptcity)
met <- read_stars("ftp://nomads.ncdc.noaa.gov/GFS/analysis_only/201501/20150103/gfsanl_3_20150103_0000_000.grb")
met2 <- filter(met, band == 2)
plot(met2, col = cpt())

enter image description here

$\endgroup$
0

1 Answer 1

5
$\begingroup$

This file is in GRIB-1 format. Each band corresponds to a GRIB message. The band names can be found in an INV file on the same server.

For your example check out the corresponding inv file ftp://nomads.ncdc.noaa.gov/GFS/analysis_only/201501/20150103/gfsanl_3_20150103_0000_000.inv.

Another option is to use wgrib -v with -v option.

The band names and offsets for all 315 bands can be obtained this way, e.g. for band 2

2:81534:D=2015010300:VGRD:planetary boundary layer (from Richardson no.)
 :kpds=34,220,0:anl:winds are N/S:"v wind [m/s]

That is bands 1 and 2 store u and v components of the wind speed at the boundary layer.

kpds parameters make up the product definition section identifiers. The first kpds number can be mapped to mnemonic GRIB identifiers, i.e. number 34 maps to VGRD.

The unit is m/s and the data representation is 64-bit floating point. The latter piece of metadata can be extracted from the GRIB file itself e.g. using gdalinfo.

Band 2 Block=360x1 Type=Float64, ColorInterp=Undefined
  Description = 0[-] var220 (reserved)
  Metadata:
    GRIB_COMMENT=v-component of wind [m/s]
    GRIB_ELEMENT=VGRD
    GRIB_FORECAST_SECONDS=0 sec
    GRIB_REF_TIME=  1420243200 sec UTC
    GRIB_SHORT_NAME=0-var220
    GRIB_UNIT=[m/s]
    GRIB_VALID_TIME=  1420243200 sec UTC

With the -V option wgrid utility produces a more detailed output:

rec 2:81534:date 2015010300 VGRD kpds5=34 kpds6=220 kpds7=0 
    levels=(0,0) grid=3 planetary boundary layer (from Richardson no.) anl:
  VGRD=v wind [m/s]
  timerange 10 P1 0 P2 0 TimeU 1  nx 360 ny 181 GDS grid 0 num_in_ave 0 missing 0
  center 7 subcenter 0 process 81 Table 2 scan: WE:NS winds(N/S) 
  latlon: lat  90.000000 to -90.000000 by 1.000000  nxny 65160
          long 0.000000 to -1.000000 by 1.000000, 
          (360 x 181) scan 0 mode 128 bdsgrid 1
  min/max data -38.8 45.4  num bits 10  BDS_Ref -388  DecScale 1 BinScale 0
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.