WRF output in MetPY #1801
-
I want to plot different variables of a .nc WRF model running output file. But when I write: import cartopy.crs as ccrs from metpy.cbook import get_test_data data = Dataset('/home/arnaitz/Build_WRF/WRF-4.1.5/run/wrfout_d02_2021-04-10_06:00:00') AN ERROR OCCUR: KeyError Traceback (most recent call last) KeyError: 'lat' I think is because in the output file is not defined lat like in MetPy. Do you know how to fix this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I suppose you have not changed the name of the default output variables, so the latitude should be 'XLAT' and longitude 'XLONG' and are 2D variables. Also, you don't have a 'time' variable but 'Times' and temperature, pressure, hgt all have different names from your script. You can check the names of the WRF output variables with ncdump, e.g.: ncdump -h wrfout_d02_2021-04-10_06:00:00 |
Beta Was this translation helpful? Give feedback.
I suppose you have not changed the name of the default output variables, so the latitude should be 'XLAT' and longitude 'XLONG' and are 2D variables. Also, you don't have a 'time' variable but 'Times' and temperature, pressure, hgt all have different names from your script.
You can check the names of the WRF output variables with ncdump, e.g.:
ncdump -h wrfout_d02_2021-04-10_06:00:00