Skip to content

Commit 6d9a9e8

Browse files
Split too long lines
1 parent 952f30d commit 6d9a9e8

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

sarxarray/utils.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,15 @@ def _compute_coherence(numerator, denominator):
156156

157157

158158
def crop(data: xr.Dataset | xr.DataArray, geom: sg.Polygon) -> xr.Dataset:
159-
"""Crop a radar image or stack of radar images to the bounding box of an area of interest.
159+
"""Crop a radar image or stack of radar images to the bounding box of a polygon.
160160
161161
Parameters
162162
----------
163163
data: xr.Dataset | xr.DataArray
164164
The dataset or data array to be cropped in azimuth and range
165165
geom: sg.Polygon
166-
shapely.geometry.Polygon in radar coordinates of the area that should be kept, in [azimuth, range] format
166+
shapely.geometry.Polygon in radar coordinates of the area that should be
167+
kept, in [azimuth, range] format
167168
168169
Returns
169170
-------
@@ -179,7 +180,10 @@ def crop(data: xr.Dataset | xr.DataArray, geom: sg.Polygon) -> xr.Dataset:
179180
raise ValueError("The data must have azimuth and range dimensions.")
180181

181182
bounding_box = geom.bounds # returns (min_az, min_r, max_az, max_r)
182-
data = data.sel(azimuth=range(bounding_box[0], bounding_box[2]+1), range=range(bounding_box[1], bounding_box[3]+1))
183+
data = data.sel(
184+
azimuth=range(bounding_box[0], bounding_box[2]+1),
185+
range=range(bounding_box[1], bounding_box[3]+1)
186+
)
183187

184188
return data
185189

0 commit comments

Comments
 (0)