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

Custom vertical dimension in vinterp #55

Closed honnorat closed 6 years ago

honnorat commented 6 years ago

Allow wrf.vinterp() use a custom name for the vertical dimension it creates, instead of the default interp_level.

Fixes #54

bladwig1 commented 6 years ago

Thank you for wanting to contribute to WRF-Python. In the future, could you please supply separate pull requests if you are making changes unrelated to the original issue.

We've accepted the .gitignore change, but note that this should be unnecessary if you're building using the build scripts or setup.py (those files will be in the 'build' directory, which is already ignored). However, it's no big deal if you want to build using f2py directly, so we'll add the ignore statements.

Regarding the original pull request to modify the metadata, I've been on the fence with this one, but am ultimately not ready to do this for fear of having to handle everyone's metadata needs. Fortunately, renaming coordinates is easy to do with xarray, and you should use this approach instead:

my_field = vinterp(...)

renamed_field = my_field.rename({"interp_level" : "your_new_name"})