Basic usage
Notebook setup
[1]:
%matplotlib inline
%load_ext autoreload
%autoreload 2
[2]:
import sys
sys.path.append("../..")
[3]:
from s1etad import Sentinel1Etad
Sentinel1Etad product
[4]:
filename = (
"data/"
"S1B_IW_ETA__AXDV_20200124T221416_20200124T221444_019964_025C43_0A63.SAFE"
)
[5]:
eta = Sentinel1Etad(filename)
[6]:
eta
[6]:
Sentinel1Etad("data/S1B_IW_ETA__AXDV_20200124T221416_20200124T221444_019964_025C43_0A63.SAFE") # 0x7abdc4281520
Number of Sentinel-1 slices: 1
Sentinel-1 products list:
S1B_IW_SLC__1ADV_20200124T221416_20200124T221444_019964_025C43_95FB.SAFE
Number of swaths: 3
Swath list: IW1, IW2, IW3
Azimuth time:
min: 2020-01-24 22:14:16.480938
max: 2020-01-24 22:14:44.428152
Range time:
min: 0.005328684957372668
max: 0.006383362874313361
Grid sampling:
x: 8.131672451354599e-07
y: 0.02932551319648094
unit: s
Grid spacing:
x: 200.0
y: 200.0
unit: m
Processing settings:
troposphericDelayCorrection: True
ionosphericDelayCorrection: True
solidEarthTideCorrection: True
bistaticAzimuthCorrection: True
dopplerShiftRangeCorrection: True
FMMismatchAzimuthCorrection: True
Check which corrections have been enabled
[7]:
eta.processing_setting()
[7]:
{'troposphericDelayCorrection': True,
'ionosphericDelayCorrection': True,
'solidEarthTideCorrection': True,
'bistaticAzimuthCorrection': True,
'dopplerShiftRangeCorrection': True,
'FMMismatchAzimuthCorrection': True}
The burst catalogue
It is a pandas dataframe to allow easy filtering.
See also use cases in the “Use case 1: Selecting the bursts” section for a more complete explanation on the burst catalogue and the query mechanism.
[8]:
eta.burst_catalogue.head()
[8]:
| bIndex | pIndex | sIndex | productID | swathID | azimuthTimeMin | azimuthTimeMax | |
|---|---|---|---|---|---|---|---|
| 0 | 1 | 1 | 1 | S1B_IW_SLC__1ADV_20200124T221416_20200124T2214... | IW1 | 2020-01-24 22:14:16.480938000 | 2020-01-24 22:14:19.618767912 |
| 1 | 4 | 1 | 1 | S1B_IW_SLC__1ADV_20200124T221416_20200124T2214... | IW1 | 2020-01-24 22:14:19.237536240 | 2020-01-24 22:14:22.375366152 |
| 2 | 7 | 1 | 1 | S1B_IW_SLC__1ADV_20200124T221416_20200124T2214... | IW1 | 2020-01-24 22:14:21.994134480 | 2020-01-24 22:14:25.131964392 |
| 3 | 10 | 1 | 1 | S1B_IW_SLC__1ADV_20200124T221416_20200124T2214... | IW1 | 2020-01-24 22:14:24.750732721 | 2020-01-24 22:14:27.888562633 |
| 4 | 13 | 1 | 1 | S1B_IW_SLC__1ADV_20200124T221416_20200124T2214... | IW1 | 2020-01-24 22:14:27.507330961 | 2020-01-24 22:14:30.645160873 |
Tip: the total number of bursts in a product can be retrieved as follows:
[9]:
print("Total number of bursts:", len(eta.burst_catalogue))
Total number of bursts: 28
Swath objects
How many swaths are stored in a product?
[10]:
print("Number of swaths:", eta.number_of_swath)
print("Swath list:", eta.swath_list)
Number of swaths: 3
Swath list: ['IW1', 'IW2', 'IW3']
How to retrieve a Sentinel1EtadSwath object
[11]:
swath = eta["IW2"]
[12]:
swath
[12]:
Sentinel1EtadSwath("/IW2") 0x7abdac0b96a0
Swaths ID: IW2
Number of bursts: 9
Burst list: [2, 5, 8, 11, 14, 17, 20, 23, 26]
Sampling start:
x: 0.00031062988764174633
y: 0.9384164222873892
units: s
Sampling:
x: 8.131672451354599e-07
y: 0.02932551319648094
units: s
Burst objects
[13]:
burst = swath[2]
[14]:
burst
[14]:
Sentinel1EtadBurst("/IW2/Burst0002") 0x7abd6f5a29f0
Swaths ID: IW2
Burst index: 2
Shape: (109, 476)
Sampling start:
x: 0.00031062988764174633
y: 0.9384164222873892
units: s
Sampling:
x: 8.131672451354599e-07
y: 0.02932551319648094
units: s
NOTE: one can only get bursts whose index is present in the “burst list” of the swath
[15]:
swath.burst_list
[15]:
[2, 5, 8, 11, 14, 17, 20, 23, 26]
[16]:
try:
swath[1]
except IndexError as exc:
print("ERROR: Ops someting went wrong:", repr(exc))
ERROR: Ops someting went wrong: IndexError('Burst0001 not found in /IW2')
String representation
Please note that the string representation of Sentinel1Etad object is a “one-line” string providing only basic information:
[17]:
print("Product:", str(eta))
print("Swath:", str(swath))
print("Burst:", str(burst))
Product: Sentinel1Etad("S1B_IW_ETA__AXDV_20200124T221416_20200124T221444_019964_025C43_0A63.SAFE")
Swath: Sentinel1EtadSwath("/IW2") 0x7abdac0b96a0
Burst: Sentinel1EtadBurst("/IW2/Burst0002") 0x7abd6f5a29f0
Anyway in Jupyter environments a richer representation is also available:
[18]:
eta
[18]:
Sentinel1Etad("data/S1B_IW_ETA__AXDV_20200124T221416_20200124T221444_019964_025C43_0A63.SAFE") # 0x7abdc4281520
Number of Sentinel-1 slices: 1
Sentinel-1 products list:
S1B_IW_SLC__1ADV_20200124T221416_20200124T221444_019964_025C43_95FB.SAFE
Number of swaths: 3
Swath list: IW1, IW2, IW3
Azimuth time:
min: 2020-01-24 22:14:16.480938
max: 2020-01-24 22:14:44.428152
Range time:
min: 0.005328684957372668
max: 0.006383362874313361
Grid sampling:
x: 8.131672451354599e-07
y: 0.02932551319648094
unit: s
Grid spacing:
x: 200.0
y: 200.0
unit: m
Processing settings:
troposphericDelayCorrection: True
ionosphericDelayCorrection: True
solidEarthTideCorrection: True
bistaticAzimuthCorrection: True
dopplerShiftRangeCorrection: True
FMMismatchAzimuthCorrection: True
Iteration
It is possible to iterate over products and swats in the same way one does it with any other python container.
[19]:
for swath in eta:
print(swath)
for burst in swath:
print(burst.burst_index, burst.swath_id, burst)
print()
Sentinel1EtadSwath("/IW1") 0x7abd6f5a3410
1 IW1 Sentinel1EtadBurst("/IW1/Burst0001") 0x7abd6f5a34a0
4 IW1 Sentinel1EtadBurst("/IW1/Burst0004") 0x7abd6f5a0ce0
7 IW1 Sentinel1EtadBurst("/IW1/Burst0007") 0x7abd6f5a2f00
10 IW1 Sentinel1EtadBurst("/IW1/Burst0010") 0x7abd6f5a3bf0
13 IW1 Sentinel1EtadBurst("/IW1/Burst0013") 0x7abd6f5a2e10
16 IW1 Sentinel1EtadBurst("/IW1/Burst0016") 0x7abd6f5a38f0
19 IW1 Sentinel1EtadBurst("/IW1/Burst0019") 0x7abd6f5a3a10
22 IW1 Sentinel1EtadBurst("/IW1/Burst0022") 0x7abd6f5a3710
25 IW1 Sentinel1EtadBurst("/IW1/Burst0025") 0x7abd6f5a27e0
28 IW1 Sentinel1EtadBurst("/IW1/Burst0028") 0x7abd6f5a3560
Sentinel1EtadSwath("/IW2") 0x7abdac0b96a0
2 IW2 Sentinel1EtadBurst("/IW2/Burst0002") 0x7abd6f5a29f0
5 IW2 Sentinel1EtadBurst("/IW2/Burst0005") 0x7abd6f5a37d0
8 IW2 Sentinel1EtadBurst("/IW2/Burst0008") 0x7abd6f5a2c60
11 IW2 Sentinel1EtadBurst("/IW2/Burst0011") 0x7abd6f5a2ba0
14 IW2 Sentinel1EtadBurst("/IW2/Burst0014") 0x7abd6f5a3c50
17 IW2 Sentinel1EtadBurst("/IW2/Burst0017") 0x7abd6f5a28d0
20 IW2 Sentinel1EtadBurst("/IW2/Burst0020") 0x7abd6f5a1640
23 IW2 Sentinel1EtadBurst("/IW2/Burst0023") 0x7abd6f5a30e0
26 IW2 Sentinel1EtadBurst("/IW2/Burst0026") 0x7abd6f5a3740
Sentinel1EtadSwath("/IW3") 0x7abd6f5a03b0
3 IW3 Sentinel1EtadBurst("/IW3/Burst0003") 0x7abd6f5a3470
6 IW3 Sentinel1EtadBurst("/IW3/Burst0006") 0x7abd6f5a3cb0
9 IW3 Sentinel1EtadBurst("/IW3/Burst0009") 0x7abd6f5a3950
12 IW3 Sentinel1EtadBurst("/IW3/Burst0012") 0x7abd6f5a3b90
15 IW3 Sentinel1EtadBurst("/IW3/Burst0015") 0x7abd6f5a18e0
18 IW3 Sentinel1EtadBurst("/IW3/Burst0018") 0x7abd6f5a3d40
21 IW3 Sentinel1EtadBurst("/IW3/Burst0021") 0x7abd6f5a3260
24 IW3 Sentinel1EtadBurst("/IW3/Burst0024") 0x7abd6f5a3da0
27 IW3 Sentinel1EtadBurst("/IW3/Burst0027") 0x7abd6f5a3e30
How to iterate only on selected items
It is also possible to iterate on a sub-set of the products swaths (or a sub-set of the swath bursts):
[20]:
for swath in eta.iter_swaths(["IW1", "IW2"]): # no 'IW3'
# list of bursts
odd_bursts = [idx for idx in swath.burst_list if idx % 2 != 0]
for burst in swath.iter_bursts(odd_bursts):
print(f"{burst.burst_index:2} {burst.swath_id} {burst}")
1 IW1 Sentinel1EtadBurst("/IW1/Burst0001") 0x7abd6f5a34a0
7 IW1 Sentinel1EtadBurst("/IW1/Burst0007") 0x7abd6f5a2f00
13 IW1 Sentinel1EtadBurst("/IW1/Burst0013") 0x7abd6f5a2e10
19 IW1 Sentinel1EtadBurst("/IW1/Burst0019") 0x7abd6f5a3a10
25 IW1 Sentinel1EtadBurst("/IW1/Burst0025") 0x7abd6f5a27e0
5 IW2 Sentinel1EtadBurst("/IW2/Burst0005") 0x7abd6f5a37d0
11 IW2 Sentinel1EtadBurst("/IW2/Burst0011") 0x7abd6f5a2ba0
17 IW2 Sentinel1EtadBurst("/IW2/Burst0017") 0x7abd6f5a28d0
23 IW2 Sentinel1EtadBurst("/IW2/Burst0023") 0x7abd6f5a30e0
How to iterate on query results
The query mechanism is explained extensively in the following.
Queries can be performed using the Sentinel1Etad.query_burst method.
A simple example is a query for a specific swath:
[21]:
query_result = eta.query_burst(swath="IW3")
for swath in eta.iter_swaths(query_result):
for burst in swath.iter_bursts(query_result):
print(burst)
Sentinel1EtadBurst("/IW3/Burst0003") 0x7abd6f5a3470
Sentinel1EtadBurst("/IW3/Burst0006") 0x7abd6f5a3cb0
Sentinel1EtadBurst("/IW3/Burst0009") 0x7abd6f5a3950
Sentinel1EtadBurst("/IW3/Burst0012") 0x7abd6f5a3b90
Sentinel1EtadBurst("/IW3/Burst0015") 0x7abd6f5a18e0
Sentinel1EtadBurst("/IW3/Burst0018") 0x7abd6f5a3d40
Sentinel1EtadBurst("/IW3/Burst0021") 0x7abd6f5a3260
Sentinel1EtadBurst("/IW3/Burst0024") 0x7abd6f5a3da0
Sentinel1EtadBurst("/IW3/Burst0027") 0x7abd6f5a3e30