NCAR / NCAR/wrf-python

getvar compatibility with xarray

Open
#202 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
498
Forks
178
PR merge metrics
No merged PRs in 30d

Description

Greetings,

I've been attempting to use WRF-Python recently to compute diagnostic variables from WRF output in netCDF4 format. However, as things currently stand, it is not clear how the getvar method can be used with large volumes of WRF output accessed through opening multiple files simultaneously. This results from a two-pronged problem:

  • getvar is not currently compatible with xarray; attempting to use them together results in a TypeError. The proposed fix under the FAQs section of the website for using an xarray dataset as input to WRF-Python functions is now deprecated; the attribute in question has been removed from the xarray.Dataset API.
  • Using the netCDF4 package to load in a dataset is an alternative option, but it does not currently support concurrent reads of multiple netCDF4 files (only netCDF3/netCDF4 classic)

As such, I wanted to know if there are any planned updates for integrating xarray with WRF-Python. Any insight would be greatly appreciated!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the getvar entry point and the FAQ guidance for passing xarray datasets, then compare the current xarray.Dataset API with the reported TypeError. Done means defining and implementing a supported approach for xarray-backed multi-file WRF output, with updated usage guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.