NCAR / NCAR/wrf-python

Lat/Lon to X/Y routines should be made to work with a DataArray argument

Open
#40 0 comments 0 reactions 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

While working on #38, realized that there is no easy way to do lat/lon to x/y (and vice versa) with sliced DataArray variables. Currently, the WRF data file is used to extract the relevant information, and slices are not possible.

The DataArray variable needs to contain the lat/lon and projection information in order for this to work, so an error should be thrown if not (or fall back on the WRF data file). In interputils.py, to_xy_coords() needs modification, along with the _ll_to_xy() in interp.py.

The metadata handling for cross sections (and line interpolation) should also be updated to take advantage of this.

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 with to_xy_coords() in interputils.py and _ll_to_xy() in interp.py, then trace how sliced DataArray metadata is currently handled. The work is complete when DataArray arguments can provide latitude/longitude and projection information, missing metadata is handled as specified, and cross-section and line-interpolation metadata use it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.