Skip to content

Commit c30aaf1

Browse files
authored
s1_burst_slc: add __str__ and bbox properties (#72)
* s1_burst_slc: add __str__ and bbox properties * provide more detail for bbox return values
1 parent 226fced commit c30aaf1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/s1reader/s1_burst_slc.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ class Sentinel1BurstSlc:
172172
burst_noise: s1_annotation.BurstNoise #Thermal noise correction
173173
burst_eap: s1_annotation.BurstEAP #EAP correction
174174

175+
def __str__(self):
176+
return f"Sentinel1BurstSlc: {self.burst_id} at {self.sensing_start}"
177+
178+
def __repr__(self):
179+
return f"{self.__class__.__name__}(burst_id={self.burst_id})"
175180

176181
def as_isce3_radargrid(self):
177182
'''Init and return isce3.product.RadarGridParameters.
@@ -622,3 +627,9 @@ def swath_name(self):
622627
'''Swath name in iw1, iw2, iw3.'''
623628
return self.burst_id.split('_')[1]
624629

630+
@property
631+
def bbox(self):
632+
'''Returns the (west, south, east, north) bounding box of the burst.'''
633+
# Uses https://shapely.readthedocs.io/en/stable/manual.html#object.bounds
634+
# Returns a tuple of 4 floats representing (west, south, east, north) in degrees.
635+
return self.border[0].bounds

0 commit comments

Comments
 (0)