pytroll / pyresample

Geospatial image resampling in Python
http://pyresample.readthedocs.org
GNU Lesser General Public License v3.0
344 stars 95 forks source link

Migrate usages of pyproj Proj to pyproj Transformer #532

Closed djhoese closed 1 year ago

djhoese commented 1 year ago

This PR switches from using pyproj's old Proj interface to the newer Transformer class. Transformers should have better overall handling of more complex projection transformation.

One note is that I did have to add special handling of CRSes with prime meridian shifts (+pm=180) to make get_lonlats return what it used to. That is, lon/lats on a prime meridian 0 CRS.

CC @larsbuntemeyer

codecov[bot] commented 1 year ago

Codecov Report

Merging #532 (09fcc76) into main (2a6d769) will decrease coverage by 0.09%. The diff coverage is 97.22%.

@@            Coverage Diff             @@
##             main     #532      +/-   ##
==========================================
- Coverage   94.34%   94.26%   -0.09%     
==========================================
  Files          82       82              
  Lines       13026    13052      +26     
==========================================
+ Hits        12290    12303      +13     
- Misses        736      749      +13     
Flag Coverage Δ
unittests 94.26% <97.22%> (-0.09%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pyresample/utils/proj4.py 98.86% <93.75%> (-1.14%) :arrow_down:
pyresample/_spatial_mp.py 83.70% <100.00%> (+0.75%) :arrow_up:
pyresample/geometry.py 87.64% <100.00%> (+0.05%) :arrow_up:
pyresample/test/test_geometry/test_area.py 99.21% <100.00%> (+<0.01%) :arrow_up:

... and 1 file with indirect coverage changes

larsbuntemeyer commented 1 year ago

Thanks for fixing this @djhoese !

coveralls commented 1 year ago

Coverage Status

coverage: 93.836% (-0.03%) from 93.864% when pulling 09fcc7658c618276b19dbc1118a243bf1c047f48 on djhoese:bugfix-pyproj-transformer into 82b9373a03ae979985e18ef1eaa25ea04a0db530 on pytroll:main.