Open xigrug opened 5 years ago
There's a separate message for each vertical level
There's a separate message for each vertical level
why ? 285:Temperature:K (instant):regular_ll:pressureFromGroundLayer:levels 3000-0 Pa:fcst time 0 hrs:from 201508110600 , levels is 3000-0Pa ,this is not a single level I think
It is a single level - that's how grib messages work. Each one is a 2D field. The 'level' key is the vertical level. '3000-0 Pa' probably indicates a vertical mean.
I'm trying to read the NCEP FNL grib files https://rda.ucar.edu/datasets/ds083.3/index.html
`file = 'gdas1.fnl0p25.2015081106.f00.grib2' #example filename
gr = pygrib.open(file)
msg = gr[285] #get record number 285
print(msg)
temp_vals = msg.values
print(temp_vals)
print(temp_vals.shape)
print(np.amax(temp_vals),np.amin(temp_vals))
lats,lons = msg.latlons()
print(lats) `
levels is 3000-0 Pa ;temp_vals.shape is (721, 1440) , not included the vertical levels!