-
Notifications
You must be signed in to change notification settings - Fork 95
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
||
# 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(): |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
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 CartopyGeostationary
class.