pytroll / pytroll/pyresample

`SwathDef.get_area_extent_for_subset` make no sense for SwathDefinition

Open
#408 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

get_area_extent_for_subset method is currently defined in the BaseDefinition class which is inherited by SwathDefinition.
The method assumes an AreaDefinition since it call get_proj_coords and should therefore be moved (if not deprecated....) to AreaDefinition class.
When called by a SwathDefinition instance, it obviously throw an error.

Link to method definition in geometry.py

get_area_extent_for_subset

Code sample
from pyresample.geometry import SwathDefinition
lons = np.arange(-179.75, 179.75 + 0.5, 0.5)
lats = np.arange(-89.75,  0.5,  0.5)
lons, lats = np.meshgrid(lons, lats)
swath_def = SwathDefinition(lons=lons, lats=lats)
LL_x, LL_y, UR_x, UR_y = swath_def.get_area_extent_for_subset(0,0,1,1) # BUG

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

Start in pyresample/geometry.py at get_area_extent_for_subset and inspect how BaseDefinition and AreaDefinition expose it. Confirm the intended handling of the method, including whether deprecation is required, then verify that SwathDefinition no longer raises this AreaDefinition-specific error while AreaDefinition behavior remains available.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.