Basic usage

Notebook setup

[21]:
%matplotlib inline
%load_ext autoreload
%autoreload 2
[22]:
import sys

sys.path.append("../..")
[23]:
from s1etad import Sentinel1Etad

Sentinel1Etad product

[24]:
filename = (
    "data/"
    "S1A_IW_ETA__AXDV_20230806T211729_20230806T211757_049760_05FBCB_9DD6.SAFE"
)
[25]:
eta = Sentinel1Etad(filename)
[26]:
eta
[26]:
Sentinel1Etad("data/S1A_IW_ETA__AXDV_20230806T211729_20230806T211757_049760_05FBCB_9DD6.SAFE")  # 0x739cd86265d0
Number of Sentinel-1 slices: 1
Sentinel-1 products list:
  S1A_IW_SLC__1SDV_20230806T211729_20230806T211757_049760_05FBCB_BC56.SAFE
Number of swaths: 3
Swath list: IW1, IW2, IW3
Azimuth time:
  min: 2023-08-06 21:17:29.208211
  max: 2023-08-06 21:17:57.184751
Range time:
  min: 0.0053335639608434815
  max: 0.006389868212274445
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
  troposphericDelayCorrectionGradient: True
  ionosphericDelayCorrection: True
  solidEarthTideCorrection: True
  oceanTidalLoadingCorrection: True
  bistaticAzimuthCorrection: True
  dopplerShiftRangeCorrection: True
  FMMismatchAzimuthCorrection: True

Check which corrections have been enabled

[27]:
eta.processing_setting()
[27]:
{'troposphericDelayCorrection': True,
 'troposphericDelayCorrectionGradient': True,
 'ionosphericDelayCorrection': True,
 'solidEarthTideCorrection': True,
 'oceanTidalLoadingCorrection': 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.

[28]:
eta.burst_catalogue.head()
[28]:
bIndex pIndex sIndex productID swathID azimuthTimeMin azimuthTimeMax
0 1 1 1 S1A_IW_SLC__1SDV_20230806T211729_20230806T2117... IW1 2023-08-06 21:17:29.208211000 2023-08-06 21:17:32.346040912
1 4 1 1 S1A_IW_SLC__1SDV_20230806T211729_20230806T2117... IW1 2023-08-06 21:17:31.964809240 2023-08-06 21:17:35.131964665
2 7 1 1 S1A_IW_SLC__1SDV_20230806T211729_20230806T2117... IW1 2023-08-06 21:17:34.721407480 2023-08-06 21:17:37.888562906
3 10 1 1 S1A_IW_SLC__1SDV_20230806T211729_20230806T2117... IW1 2023-08-06 21:17:37.478005721 2023-08-06 21:17:40.645161146
4 13 1 1 S1A_IW_SLC__1SDV_20230806T211729_20230806T2117... IW1 2023-08-06 21:17:40.234603961 2023-08-06 21:17:43.401759387

Tip: the total number of bursts in a product can be retrieved as follows:

[29]:
print("Total number of bursts:", len(eta.burst_catalogue))
Total number of bursts: 28

Swath objects

How many swaths are stored in a product?

[30]:
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

[31]:
swath = eta["IW2"]
[32]:
swath
[32]:
Sentinel1EtadSwath("/IW2")  0x739cd8452c40
Swaths ID: IW2
Number of bursts: 9
Burst list: [2, 5, 8, 11, 14, 17, 20, 23, 26]
Sampling start:
  x: 0.0003098167203966105
  y: 0.9384164222873892
  units: s
Sampling:
  x: 8.131672451354599e-07
  y: 0.02932551319648094
  units: s

Burst objects

[33]:
burst = swath[2]
[34]:
burst
[34]:
Sentinel1EtadBurst("/IW2/Burst0002")  0x739cd8524130
Swaths ID: IW2
Burst index: 2
Shape: (109, 478)
Sampling start:
  x: 0.0003098167203966105
  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

[35]:
swath.burst_list
[35]:
[2, 5, 8, 11, 14, 17, 20, 23, 26]
[36]:
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:

[37]:
print("Product:", str(eta))
print("Swath:", str(swath))
print("Burst:", str(burst))
Product: Sentinel1Etad("S1A_IW_ETA__AXDV_20230806T211729_20230806T211757_049760_05FBCB_9DD6.SAFE")
Swath: Sentinel1EtadSwath("/IW2")  0x739cd8452c40
Burst: Sentinel1EtadBurst("/IW2/Burst0002")  0x739cd8524130

Anyway in Jupyter environments a richer representation is also available:

[38]:
eta
[38]:
Sentinel1Etad("data/S1A_IW_ETA__AXDV_20230806T211729_20230806T211757_049760_05FBCB_9DD6.SAFE")  # 0x739cd86265d0
Number of Sentinel-1 slices: 1
Sentinel-1 products list:
  S1A_IW_SLC__1SDV_20230806T211729_20230806T211757_049760_05FBCB_BC56.SAFE
Number of swaths: 3
Swath list: IW1, IW2, IW3
Azimuth time:
  min: 2023-08-06 21:17:29.208211
  max: 2023-08-06 21:17:57.184751
Range time:
  min: 0.0053335639608434815
  max: 0.006389868212274445
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
  troposphericDelayCorrectionGradient: True
  ionosphericDelayCorrection: True
  solidEarthTideCorrection: True
  oceanTidalLoadingCorrection: 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.

[39]:
for swath in eta:
    print(swath)
    for burst in swath:
        print(burst.burst_index, burst.swath_id, burst)
    print()
Sentinel1EtadSwath("/IW1")  0x739cd8452d70
1 IW1 Sentinel1EtadBurst("/IW1/Burst0001")  0x739d5038e510
4 IW1 Sentinel1EtadBurst("/IW1/Burst0004")  0x739cd85240c0
7 IW1 Sentinel1EtadBurst("/IW1/Burst0007")  0x739cd85246e0
10 IW1 Sentinel1EtadBurst("/IW1/Burst0010")  0x739cd8524830
13 IW1 Sentinel1EtadBurst("/IW1/Burst0013")  0x739cd85248a0
16 IW1 Sentinel1EtadBurst("/IW1/Burst0016")  0x739cd8524910
19 IW1 Sentinel1EtadBurst("/IW1/Burst0019")  0x739cd8524980
22 IW1 Sentinel1EtadBurst("/IW1/Burst0022")  0x739cd85249f0
25 IW1 Sentinel1EtadBurst("/IW1/Burst0025")  0x739cd8524a60
28 IW1 Sentinel1EtadBurst("/IW1/Burst0028")  0x739cd8524ad0

Sentinel1EtadSwath("/IW2")  0x739cd8452c40
2 IW2 Sentinel1EtadBurst("/IW2/Burst0002")  0x739cd8524130
5 IW2 Sentinel1EtadBurst("/IW2/Burst0005")  0x739cd8524bb0
8 IW2 Sentinel1EtadBurst("/IW2/Burst0008")  0x739cd8524b40
11 IW2 Sentinel1EtadBurst("/IW2/Burst0011")  0x739cd8524c20
14 IW2 Sentinel1EtadBurst("/IW2/Burst0014")  0x739cd8524c90
17 IW2 Sentinel1EtadBurst("/IW2/Burst0017")  0x739cd8524d00
20 IW2 Sentinel1EtadBurst("/IW2/Burst0020")  0x739cd8524d70
23 IW2 Sentinel1EtadBurst("/IW2/Burst0023")  0x739cd8524de0
26 IW2 Sentinel1EtadBurst("/IW2/Burst0026")  0x739cd8524e50

Sentinel1EtadSwath("/IW3")  0x739cd8479fd0
3 IW3 Sentinel1EtadBurst("/IW3/Burst0003")  0x739cd8524f30
6 IW3 Sentinel1EtadBurst("/IW3/Burst0006")  0x739cd8524ec0
9 IW3 Sentinel1EtadBurst("/IW3/Burst0009")  0x739cd8524fa0
12 IW3 Sentinel1EtadBurst("/IW3/Burst0012")  0x739cd8525010
15 IW3 Sentinel1EtadBurst("/IW3/Burst0015")  0x739cd8525080
18 IW3 Sentinel1EtadBurst("/IW3/Burst0018")  0x739cd85250f0
21 IW3 Sentinel1EtadBurst("/IW3/Burst0021")  0x739cd8525160
24 IW3 Sentinel1EtadBurst("/IW3/Burst0024")  0x739cd85251d0
27 IW3 Sentinel1EtadBurst("/IW3/Burst0027")  0x739cd8525240

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):

[40]:
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")  0x739d5038e510
 7 IW1 Sentinel1EtadBurst("/IW1/Burst0007")  0x739cd85246e0
13 IW1 Sentinel1EtadBurst("/IW1/Burst0013")  0x739cd85248a0
19 IW1 Sentinel1EtadBurst("/IW1/Burst0019")  0x739cd8524980
25 IW1 Sentinel1EtadBurst("/IW1/Burst0025")  0x739cd8524a60
 5 IW2 Sentinel1EtadBurst("/IW2/Burst0005")  0x739cd8524bb0
11 IW2 Sentinel1EtadBurst("/IW2/Burst0011")  0x739cd8524c20
17 IW2 Sentinel1EtadBurst("/IW2/Burst0017")  0x739cd8524d00
23 IW2 Sentinel1EtadBurst("/IW2/Burst0023")  0x739cd8524de0

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:

[41]:
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")  0x739cd8524f30
Sentinel1EtadBurst("/IW3/Burst0006")  0x739cd8524ec0
Sentinel1EtadBurst("/IW3/Burst0009")  0x739cd8524fa0
Sentinel1EtadBurst("/IW3/Burst0012")  0x739cd8525010
Sentinel1EtadBurst("/IW3/Burst0015")  0x739cd8525080
Sentinel1EtadBurst("/IW3/Burst0018")  0x739cd85250f0
Sentinel1EtadBurst("/IW3/Burst0021")  0x739cd8525160
Sentinel1EtadBurst("/IW3/Burst0024")  0x739cd85251d0
Sentinel1EtadBurst("/IW3/Burst0027")  0x739cd8525240