NCAR / wrf-python

A collection of diagnostic and interpolation routines for use with output from the Weather Research and Forecasting (WRF-ARW) Model.
https://wrf-python.readthedocs.io
Apache License 2.0
402 stars 152 forks source link

WRF-Python: Plotting variables with different pressure levels and Time #210

Open Abhishek12341234 opened 1 year ago

Abhishek12341234 commented 1 year ago

I want to plot relative humidity for a particular (lat, long) with time on x axis and pressure level on Y axis how can I plot it in WRF-python from wrf import (to_np, getvar, smooth2d, get_cartopy, cartopy_xlim, cartopy_ylim, latlon_coords,ALL_TIMES,interplevel)

For time I could store all timesteps using ALL_TIMES but how do I store all pressure level information in this which is required to plot "rh" at different pressure level at different time. I want my plot to look like attached image with this

Here is my code unnamed

Open the NetCDF file

ncfile = Dataset("E:/WRF_python/wrfout_d03_2021-05-11_18_00_00") variables = ncfile.variables.keys()

my_times = getvar(ncfile, "times", ALL_TIMES) rh = getvar(ncfile, "rh",ALL_TIMES)