Skip to content

Commit 7761736

Browse files
yunjunzLiangJYu
andauthored
add burst metadata: burst_duration & swath_name (#33)
+ s1_slc_burst: add two more metadata via @Property: - burst_duration - swath_name + README: update usage to load_bursts() Co-authored-by: Liang Yu <[email protected]>
1 parent 9398368 commit 7761736

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ orbit_dir = '/home/user/data/sentinel1_orbits'
5252
orbit_path = s1reader.get_orbit_file_from_dir(zip_path, orbit_dir)
5353

5454
# returns the list of the bursts
55-
bursts = s1reader.burst_from_zip(zip_path, orbit_path, swath_num, pol)
55+
bursts = s1reader.load_bursts(zip_path, orbit_path, swath_num, pol)
56+
burst_ids = [x.burst_id for x in bursts]
5657
```
5758

5859
### License

src/s1reader/s1_burst_slc.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,27 @@ def sensing_stop(self):
447447
d_seconds = (self.length - 1) * self.azimuth_time_interval
448448
return self.sensing_start + datetime.timedelta(seconds=d_seconds)
449449

450+
@property
451+
def burst_duration(self):
452+
'''Returns burst sensing duration as float in seconds.
453+
454+
Returns:
455+
--------
456+
_ : float
457+
Burst sensing duration as float in seconds.
458+
'''
459+
return self.azimuth_time_interval * self.length
460+
450461
@property
451462
def length(self):
452463
return self.shape[0]
453464

454465
@property
455466
def width(self):
456467
return self.shape[1]
468+
469+
@property
470+
def swath_name(self):
471+
'''Swath name in iw1, iw2, iw3.'''
472+
return self.burst_id.split('_')[1]
473+

0 commit comments

Comments
 (0)