Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Scene.crop using PROJ definition to create target area definition #1125

Merged
merged 2 commits into from Mar 30, 2020

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Mar 30, 2020

This issue is described in #1124. While cropping for ll_bbox is not implemented for anything other than the geos projection, it should be fine to pass xy_bbox. @meresmata was still getting a NotImplementedError even after passing xy_bbox. After some testing by @mraspaud, we discovered that the destination area was using src_area.proj_dict to create the new AreaDefinition. For the case in #1124 which uses an AreaDefinition based on an EPSG code, this results in pyproj expanding the EPSG code definition to a PROJ.4 dictionary. This new dictionary is not the exact same (string-wise) as the original EPSG based definition (EPSG:32630).

This PR fixes this by using the pyproj CRS object if it exists.

@ghost
Copy link

ghost commented Mar 30, 2020

DeepCode's analysis on #c2e507 found:

1 minor issue. ✔️ 0 issues were fixed.

👉 View analysis in DeepCode’s Dashboard

☺️ If you want to provide feedback on our bot, here is how to contact us.

@coveralls
Copy link

coveralls commented Mar 30, 2020

Coverage Status

Coverage decreased (-2.0e-06%) to 89.476% when pulling c2e5075 on djhoese:bugfix-crop-epsg into 8853aac on pytroll:master.

@codecov
Copy link

codecov bot commented Mar 30, 2020

Codecov Report

Merging #1125 into master will not change coverage by %.
The diff coverage is 89.47%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1125   +/-   ##
=======================================
  Coverage   89.47%   89.47%           
=======================================
  Files         198      198           
  Lines       29210    29229   +19     
=======================================
+ Hits        26136    26153   +17     
- Misses       3074     3076    +2     
Impacted Files Coverage Δ
satpy/tests/test_scene.py 99.71% <88.88%> (-0.14%) ⬇️
satpy/scene.py 90.19% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8853aac...c2e5075. Read the comment docs.

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mraspaud mraspaud added this to the v0.21.0 milestone Mar 30, 2020
@mraspaud mraspaud merged commit 6457707 into pytroll:master Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crop scene of visual spectrum of the sentinel 2 satellite
4 participants