NAM Wind Issues
Hi there I am running into this error:
FileNotFoundError: [Errno 2] No such file or directory: '/root/data/nam/20221216/subset_fbef5bc9__nam.t12z.awphys00.tm00.grib2'
when I run this code:
H = Herbie("2022-12-16 12:00", model="nam",product="awphys", fxx=0) #,product="awphys"
tsfc=H.xarray("TMP:surface") #.to_dataarray
sfc=H.xarray('PRES:surface') #.to_dataarray
omega=H.xarray("VVEL:1000 mb")
rh=H.xarray("RH:2 m above ground")/100.0
hght=H.xarray("HGT:1000 mb")*3.28
pbl=H.xarray("HPBL:surface")*3.28
uwindsfc=H.xarray("UGRD:10 m")
vwindsfc=H.xarray("VGRD:10 m")
u10m=uwindsfc.u10
v10m=vwindsfc.v10
I also run into the same error when I tried it with the AWIPS version of the 12 km NAM.
Update. I also tried VVEL and it gave me the same error but for a different date too.
I see what the problem is. NAM uses submessages to pack the U and V wind together.
from herbie import Herbie
H = Herbie("2022-12-16 12:00", model="nam", product="awphys", fxx=0)
H.inventory("GRD:10 m")
Shows
The U and V wind are in the same grib message 325. This means the byte range for both these variables are the same.
I think I mention this in the RAP tutorial, but I didn't realize it was the case for the NAM too.
If you replace your code
uwindsfc=H.xarray("UGRD:10 m")
vwindsfc=H.xarray("VGRD:10 m")
u10m=uwindsfc.u10
v10m=vwindsfc.v10
with this
windsfc = H.xarray("GRD:10 m")
u10m = windsfc.u10
v10m = windsfc.v10
this should resolve your error.
@blaylockbk Note to self...add a note on this feature in the NAM tutorial notebook in the docs.
I am also getting:
FileNotFoundError: [Errno 2] No such file or directory: '/root/data/nam/20231112/subset_b9b2b1fe__nam.t00z.conusnest.hiresf06.tm00.grib2'
when I try to do:
Hnam = Herbie("2023-11-12 00:00",model="nam",products="awphys",fxx=6)
Hnam.inventory()
print (Hnam.inventory("VVEL:"))
vv1000=Hnam.xarray("VVEL: 1000 mb")
vv1000.vv
The NAM tutorial may need to be updated some more because of these issues.