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 spill over of ocean/and features in cartopy plots in case of geostationary full disc plot. #601

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

BENR0
Copy link
Contributor

@BENR0 BENR0 commented Jun 14, 2024

In case of geostationary full disc plots the boundary of the cartopy CRS needs to be the actual full disc otherwise ocean/land features spill over.

Since the to_cartopy_crs method in pyresample uses a custom Projection class this is a hot fix using code from the Cartopy Geostationary class.

  • Tests added
  • Tests passed
  • Fully documented

Copy link

codecov bot commented Jun 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.98%. Comparing base (56f4506) to head (e16203a).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #601      +/-   ##
==========================================
- Coverage   94.01%   93.98%   -0.04%     
==========================================
  Files          92       86       -6     
  Lines       13836    13766      -70     
==========================================
- Hits        13008    12938      -70     
  Misses        828      828              
Flag Coverage Δ
unittests 93.98% <100.00%> (-0.04%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@coveralls
Copy link

Coverage Status

coverage: 93.685% (+0.009%) from 93.676%
when pulling e16203a on BENR0:feat_html_repr
into db94a87 on pytroll:main.


# For geostationary full disc the boundary needs to be the actuall boundary of the earth disc otherwise
# when ocean or land features are added to the cartopy plot these spill over.
if "Geostationary Satellite" in crs.to_wkt():
Copy link
Member

Choose a reason for hiding this comment

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

It would be great if this if block for geos was put into a separate function/method. Or at least invert the condition and put the much smaller else: block in the main if block and return immediately.

@@ -69,3 +70,70 @@ def __init__(self,
if self.bounds is not None:
x0, x1, y0, y1 = self.bounds
self.threshold = min(abs(x1 - x0), abs(y1 - y0)) / 100.

# For geostationary full disc the boundary needs to be the actuall boundary of the earth disc otherwise
Copy link
Member

Choose a reason for hiding this comment

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

What if it's only part of the disc, but including some boundary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants