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
410 stars 155 forks source link

New lat-lon variables recognized #196

Closed anthony-ds closed 1 year ago

anthony-ds commented 1 year ago

I am using WRF-Python to create vertical cross-sections (using vertcross) on non-wrfout files. However, these files use "lat" or "lon" as coordinate names, not "XLAT" or "XLONG". I've added these in, in the file util.py.

Also, I commented "dy = 0.0" in latlonutils.py, as this produces an error when trying to create a projection from metadata instead of a file.

erogluorhan commented 1 year ago

Hi @anthony-ds , thank you very much for your contribution!

This proposed change looks very similar to the case proposed in Issue #171 ; please take a look. Even though we understand the convenience of adding the non-WRF variable naming options into the tool, we believe the tool should be kept specific to the WRF model variable naming conventions.

As you will see from Issue #171 though, you'd be able to make your dataset variables compatible with WRF-Python very easily with something like the following:

your_xarray_dataset = your_xarray_dataset.rename({'lat0':'XLAT', 'lon0':'XLONG'})

then execute WRF-Python functions.

Would this help?