Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`__contains__`, `overlaps`, `overlap_rate`, `intersection`, `get_area` methods provide errors/wrong results for geos AreaDef / SwathDef

Aperta
#412 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
data

Direzione di ricerca

Inizia con i metodi di BaseDefinition elencati nell’issue ed esamina spherical.py, quindi segui gli entry point proposti AreaBoundary e polygon() per AreaDefinition e SwathDefinition. Il lavoro è concluso quando i metodi geometrici elencati non falliscono più con input AreaDef geostazionari né producono risultati errati per i casi di SwathDefinition descritti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem description

The methods __contains__, overlaps, overlap_rate, intersection, contains, get_area implemented in BaseDefinition class employs a polygon defined by the centroid of the pixel corners of the SwathDef / AreaDef to perform the geometrical computations.
While this works correctly for many classical AreaDefinition, for:

  • Geostationary AreaDef all methods crash (because of Inf values at the corners) (see also #393, #268) 3https://github.com/pytroll/pyresample/issues/393
  • SwathDefinition, the corners of lats/lons arrays does not provide meaningful values in the case of ascending and descending orbits within SwathDefinition ...
Code example for GEO AreaDef
import satpy
geometry_def = satpy.resample.get_area_def("goes_east_abi_f_1km")
geometry_def.corners   # --> Illegal (lon, lat) coordinates: (inf, inf)
geometry_def.outer_boundary_corners # --> Illegal (lon, lat) coordinates: (inf, inf)
geometry_def.get_area() # --> Illegal (lon, lat) coordinates: (inf, inf)
geometry_def.overlaps(geometry_def) # --> Illegal (lon, lat) coordinates: (inf, inf)
geometry_def.overlap_rate(geometry_def) # --> Illegal (lon, lat) coordinates: (inf, inf)
geometry_def.intersection(geometry_def) # --> Illegal (lon, lat) coordinates: (inf, inf)
(10,20) in geometry_def # __contains__ method  # --> Illegal (lon, lat) coordinates: (inf, inf)

Proposed solution:
  • Definition of boundary method for SwathDefinition and AreaDefinition to retrieve AreaBoundary class
  • Definition of SphPolygon from AreaBoundary using self.polygon()
  • Enhancement of spherical.py geometrical operations
  • Upgrade of BaseDefinition methods to use self.boundary().polygon().<method>(...)

Draft PR coming in the next days ...

Lingua principale
Python
Stelle
388
Fork
102
Merge medio
5g 17h
PR unite (30g)
5

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pytroll/pyresample

Tutte le issue di pytroll/pyresample

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.