NCAR / NCAR/wrf-python

wrf.slp won't accept input arrays of the same dimensions?

Open
#112 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi there,

Posting my issue here as well, because I didn't get any help from the Google Group. I've got a bit of an oddball WRF dataset that isn't organized like a normal wrfout file. Instead of all of the variables being in one single netCDF file for some time x, all of the variables are split into their own netCDF files. This means that anything that calls for a singular input wrf file doesn't work, so I have to use the raw computational algorithms in wrf python; getvar won't work.

That said, I've used wrf.rh just fine with this dataset in the past. However, when I load in files from the exact same dataset, I can't get wrf.slp to work. It needs geopotential height, tk, total pressure, and qv as inputs. I have given it all 4 of these, and I double checked the dimensions of all of them (they're all (232, 282) numpy arrays). The units check out as well.

The code (not much to see):
" slpctrl = wrf.slp(zctrl,tkctrl,pctrl,qvaporctrl) "

The error I get is:
" ValueError: invalid shape for argument 0 (got 232, 282), expected (282,)) "

Not sure what it's trying to tell me, other than it doesn't like the geopotential height input, but I can't figure out why it won't accept it. It's the same as the others. Is this a bug perhaps? In the meantime I suppose I could try NCL or just calculate it manually, but it would be nice to save the time.

Regardless, any help would be appreciated.
I'm using python 3.6 miniconda on CentOS 6.8. I can attach code or elaborate as needed if it'll help.

Thank you!

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 at the wrf.slp entry point and trace how its four inputs are shape-checked, using the reported (232, 282) arrays and the expected (282,) error as the reproduction case. Check whether the documented API or existing tests cover two-dimensional inputs; done means the supported input shape is established and the behavior is covered or clearly reported.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.