pytroll / pytroll/pyresample

`AreaDefinition.get_xy_from_proj_coords` code error in function call of `get_array_indices_from_projection_coordinates`

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

Nobody has claimed this yet.

Dominant language
Python
Stars
385
Forks
102
Avg merge
4d 2h
Merged PRs (30d)
9

Description

Problem description

Despite being already deprecated in favour of get_array_indices_from_projection_coordinates, get_xy_from_proj_coords does not work anymore because at https://github.com/pytroll/pyresample/blob/3e8d2442790455493e6c376408e90607bd485aad/pyresample/geometry.py#L2076 there is a wrong self argument in the function call of get_array_indices_from_projection_coordinates.

Code example
from pyresample.geometry import AreaDefinition
area_def = AreaDefinition.from_epsg(code=4326, resolution=0.5) 
area_def.get_xy_from_proj_coords([5], [2])             
area_def.get_xy_from_proj_coords(xm=5, ym=2)  
area_def.get_xy_from_proj_coords([5,2], [0,2])       
area_def.get_array_indices_from_projection_coordinates(xm=[5,2], ym=[5,2]) # OK 
area_def.get_array_indices_from_projection_coordinates(xm=5, ym=2) # OK 
area_def.get_array_indices_from_projection_coordinates(xm=5, ym=2) # OK 

Contributor guide

No contributing guide indexed for this repository

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

Open pyresample/geometry.py at the AreaDefinition.get_xy_from_proj_coords call referenced in the issue, then compare it with get_array_indices_from_projection_coordinates and the provided examples. Done means the deprecated method works for the scalar and array coordinate calls shown without changing the replacement method's behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.