Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAM Wind Issues #386

Open
jp2nyy opened this issue Nov 15, 2024 · 4 comments
Open

NAM Wind Issues #386

jp2nyy opened this issue Nov 15, 2024 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@jp2nyy
Copy link

jp2nyy commented Nov 15, 2024

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.

@jp2nyy
Copy link
Author

jp2nyy commented Nov 15, 2024

Update. I also tried VVEL and it gave me the same error but for a different date too.

@blaylockbk
Copy link
Owner

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
image
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
Copy link
Owner

@blaylockbk Note to self...add a note on this feature in the NAM tutorial notebook in the docs.

@blaylockbk blaylockbk self-assigned this Nov 20, 2024
@blaylockbk blaylockbk added the documentation Improvements or additions to documentation label Nov 20, 2024
@jp2nyy
Copy link
Author

jp2nyy commented Nov 23, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants