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

Refactor for boundary lat/lon extraction #546

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e203899
Add refactor
ghiggi Oct 10, 2023
95decd3
Fix wrong import
ghiggi Oct 10, 2023
ae730f7
Lint
ghiggi Oct 10, 2023
edcfcb4
Fix typo
ghiggi Oct 11, 2023
eae1873
Fix issues
ghiggi Oct 11, 2023
1662d2d
Fix issues
ghiggi Oct 11, 2023
655fb72
Fix issues
ghiggi Oct 11, 2023
b7df9be
Improve doc
ghiggi Oct 11, 2023
a5322a6
Improve doc
ghiggi Oct 11, 2023
88065d7
Remove old use of frequency argument
ghiggi Oct 11, 2023
0e992a2
Merge branch 'main' into refactor-get_bbox-lonlat
djhoese Nov 22, 2023
8eff9b4
Address refactor boundary sides
ghiggi Nov 22, 2023
36795df
Fix tests related to gradient resampling
ghiggi Nov 22, 2023
1dca712
Deprecate get_edge_lonlat and remove duplicated coordinates
ghiggi Nov 22, 2023
3c60e74
Ensure shapely polygon is closed !
ghiggi Nov 22, 2023
bba3bde
Refactor get_polygon and get_border_lonlat in gradient
ghiggi Nov 22, 2023
34edc5c
Initial refactor of AreaBoundary
ghiggi Nov 22, 2023
8fbf02f
Deprecate get_bbox_lonlats
ghiggi Nov 23, 2023
d9f4165
Private get_polygon and get_border_lonlat in gradient.__init__
ghiggi Nov 23, 2023
83ec6df
Add test area fixtures
ghiggi Nov 23, 2023
9de0a44
Treat geo area inside earth disk as classical AreaDef
ghiggi Nov 23, 2023
efd0773
Deprecate get_edge_bbox_in_projection_coordinates
ghiggi Nov 23, 2023
0b669f8
Refactor boundary classes and ensure backward compatibilities
ghiggi Nov 23, 2023
cea363f
Add BoundarySides test units
ghiggi Nov 23, 2023
b9cda35
Add test units for visualizion utilities
ghiggi Nov 23, 2023
d41973a
Consistent naming across repo of lon/lat sides with sides_lons and si…
ghiggi Nov 23, 2023
c6a9378
Add geographic_boundary and projection_boundary methods
ghiggi Nov 23, 2023
6323814
Deprecate boundary() for geographic_boundary()
ghiggi Nov 24, 2023
6210bea
Pass AreaDef crs to ProjectionBoundary crs
ghiggi Nov 24, 2023
28b5527
Solve wasted polygon computations in gradient for GEO FD
ghiggi Nov 24, 2023
0eb7a6b
Deprecate get_boundary_lonlats and SimpleBoundary
ghiggi Nov 24, 2023
0f1b578
Remove use of __file__ and relative paths in test units
ghiggi Nov 24, 2023
059d496
Improve clarity of sides extraction for geographic and projection coo…
ghiggi Nov 24, 2023
d35f1b5
Refactor Geographic and Projection Boundary using composition and dep…
ghiggi Nov 24, 2023
b3273b8
Deal with AreaDefinition with unvalid sides: polar projections, globa…
ghiggi Nov 25, 2023
e3f4b24
Add code structure for boundary extraction for polar and global plana…
ghiggi Nov 25, 2023
915e34f
Fix boundary ordering logic for swath and projections !
ghiggi Nov 27, 2023
61240eb
Fix formatting warnings
ghiggi Nov 27, 2023
7069197
Renaming to SphericalBoundary and PlanarBoundary
ghiggi Nov 27, 2023
e638557
Some cleanout and notes
ghiggi Nov 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve doc
ghiggi committed Oct 11, 2023
commit a5322a659d7f19f9ec34ecefd05147270e164956
8 changes: 4 additions & 4 deletions pyresample/geometry.py
Original file line number Diff line number Diff line change
@@ -286,7 +286,7 @@ def is_geostationary(self):

def get_bbox_lonlats(self, vertices_per_side: Optional[int] = None, force_clockwise: bool = True,
frequency: Optional[int] = None) -> tuple:
"""Return the bounding box lons and lats.
"""Return the bounding box lons and lats sides.

Args:
vertices_per_side:
@@ -2836,8 +2836,8 @@ def get_geostationary_bounding_box_in_lonlats(geos_area, nb_points=50):
Args:
nb_points: Number of points on the polygon
"""
warnings.warn("'get_geostationary_bounding_box' is deprecated. Please call "
"'area.get_bbox_lonlats' instead.",
warnings.warn("'get_geostationary_bounding_box_in_lonlats' is deprecated. Please call "
"'area.boundary().contour()' instead.",
DeprecationWarning, stacklevel=2)
return _get_geostationary_bounding_box_in_lonlats(geos_area, nb_points)

@@ -2849,7 +2849,7 @@ def get_geostationary_bounding_box(geos_area, nb_points=50):
nb_points: Number of points on the polygon
"""
warnings.warn("'get_geostationary_bounding_box' is deprecated. Please call "
"'area.get_bbox_lonlats' instead.",
"'area.boundary().contour()' instead.",
DeprecationWarning, stacklevel=2)
return _get_geostationary_bounding_box_in_lonlats(geos_area, nb_points)

2 changes: 1 addition & 1 deletion pyresample/gradient/__init__.py
Original file line number Diff line number Diff line change
@@ -375,7 +375,7 @@ def _check_input_coordinates(dst_x, dst_y,

def get_border_lonlats(geo_def: AreaDefinition):
"""Get the border x- and y-coordinates."""
# TODO: we could use geo_def.boundary()
# TODO: we could use geo_def.boundary().contour() here
if geo_def.is_geostationary:
lon_b, lat_b = _get_geostationary_bounding_box_in_lonlats(geo_def, 3600)
else: