Download this notebook from github.


SAR Sentinel-1 cross spectrum computation from large image Interferometric Wide-swath SLC

[1]:
import os
import xsarslc.get_test_files
import logging
import xsar
from importlib import reload
reload(logging)
logging.basicConfig(level=logging.INFO)
logging.info('start notebook')
import xsarslc.processing.xspectra as proc
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
warnings.filterwarnings("ignore")
INFO:root:start notebook

get datatree with digital numbers and annotations from IW SLC product

[2]:

import xsarslc import xsar import os #one_tiff = '/home/datawork-cersat-public/cache/project/mpc-sentinel1/data/esa/sentinel-1a/L1/IW/S1A_IW_SLC__1S/2022/127/S1A_IW_SLC__1SDV_20220507T162411_20220507T162439_043107_0525DE_734D.SAFE/measurement/s1a-iw1-slc-vv-20220507t162411-20220507t162439-043107-0525de-004.tiff' #tmp = xsar.get_test_file('S1A_IW_SLC__1SDV_20170907T103019_20170907T103047_018268_01EB76_5F55.SAFE') fullpathsafeSLC = xsar.get_test_file('S1A_IW_SLC__1SDV_20181008T134439_20181008T134506_024045_02A0A6_65C8.SAFE') # only one subswath IW1 zipped #fullpathsafeSLC = os.path.dirname(os.path.dirname(one_tiff)) #imagette_number = os.path.basename(one_tiff).split('-')[1].replace('iw','') imagette_number = 1 str_gdal = 'SENTINEL1_DS:%s:IW%s'%(fullpathsafeSLC,imagette_number) print('str_gdal',str_gdal) xsarobj = xsar.Sentinel1Dataset(str_gdal) #,resolution='30m' dt = xsarobj.datatree dt.load() dt
str_gdal SENTINEL1_DS:/home1/scratch/agrouaze/xsardatasync/xsardata/S1A_IW_SLC__1SDV_20181008T134439_20181008T134506_024045_02A0A6_65C8.SAFE:IW1
[2]:
<xarray.DatasetView>
Dimensions:  ()
Data variables:
    *empty*
Attributes: (12/15)
    name:              SENTINEL1_DS:/home1/scratch/agrouaze/xsardatasync/xsar...
    short_name:        SENTINEL1_DS:S1A_IW_SLC__1SDV_20181008T134439_20181008...
    product:           SLC
    safe:              S1A_IW_SLC__1SDV_20181008T134439_20181008T134506_02404...
    swath:             IW
    multidataset:      False
    ...                ...
    start_date:        2018-10-08 13:44:40.984312
    stop_date:         2018-10-08 13:45:06.117599
    footprint:         POLYGON ((-114.6305305568416 32.60521729566573, -115.5...
    coverage:          171km * 88km (line * sample )
    orbit_pass:        Descending
    platform_heading:  -167.2011573025802

cross spectrum in inter bursts parts of the IW product

[3]:
inter_xs = proc.compute_IW_subswath_interburst_xspectra(dt,
                                        tile_width={'sample': 20.e3, 'line': 20.e3},
                                        tile_overlap={'sample': 0, 'line': 0},
                                        periodo_width = {'sample': 2000, 'line': 1200},
                                        periodo_overlap = {'sample': 1000, 'line': 600},
                                        dev=True,polarization='VV')
inter_xs
INFO:root:reduce number of burst -> 1
0it [00:00, ?it/s]
[3]:
<xarray.Dataset>
Dimensions:  ()
Data variables:
    *empty*

cross spectrum in intra bursts parts of the IW product

[4]:
intra_xs = proc.compute_IW_subswath_intraburst_xspectra(dt,
                                         tile_width={'sample': 20.e3, 'line': 20.e3},
                                        tile_overlap={'sample': 0, 'line': 0},
                                        periodo_width = {'sample': 4000, 'line': 4000},
                                        periodo_overlap = {'sample': 2000, 'line': 2000},
                                        polarization='VV',dev=True)
intra_xs

INFO:root:reduce number of burst -> 1
intrabursts: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [04:02<00:00, 242.18s/it]
[4]:
<xarray.Dataset>
Dimensions:                   (tile_sample: 4, tile_line: 1, bt_thresh: 5,
                               0tau: 3, freq_line: 57, freq_sample: 451,
                               1tau: 2, 2tau: 1, c_sample: 2, c_line: 2,
                               k_gp: 4, phi_hf: 5, lambda_range_max_macs: 10)
Coordinates:
    pol                       <U2 'VV'
  * bt_thresh                 (bt_thresh) int64 5 50 100 150 200
    k_rg                      (tile_sample, freq_sample) float64 0.0 ... 0.7068
    k_az                      (freq_line) float64 -0.04417 -0.04259 ... 0.04417
    line                      (tile_line) int64 747
    sample                    (tile_line, tile_sample) int64 3204 7796 ... 17483
    longitude                 (tile_line, tile_sample) float64 -114.8 ... -115.4
    latitude                  (tile_line, tile_sample) float64 32.54 ... 32.64
  * k_gp                      (k_gp) int64 1 2 3 4
  * phi_hf                    (phi_hf) int64 1 2 3 4 5
  * lambda_range_max_macs     (lambda_range_max_macs) float64 50.0 ... 275.0
Dimensions without coordinates: tile_sample, tile_line, 0tau, freq_line,
                                freq_sample, 1tau, 2tau, c_sample, c_line
Data variables: (12/27)
    incidence                 (tile_line, tile_sample) float64 31.65 ... 35.66
    ground_heading            (tile_line, tile_sample) float64 -169.1 ... -169.4
    burst                     (tile_line) int64 0
    sensing_time              (tile_line, tile_sample) datetime64[ns] 2018-10...
    sigma0                    (tile_line, tile_sample) float64 0.1124 ... 0.1928
    nesz                      (tile_line, tile_sample) float64 0.004084 ... 0...
    ...                        ...
    corner_line               (tile_line, c_line) int64 32 1462
    corner_sample             (tile_line, tile_sample, c_sample) int64 951 .....
    burst_corner_longitude    (tile_line, c_sample, c_line) float64 -114.6 .....
    burst_corner_latitude     (tile_line, c_sample, c_line) float64 32.61 ......
    cwave_params              (tile_line, tile_sample, k_gp, phi_hf, 2tau) float64 ...
    macs                      (tile_line, tile_sample, lambda_range_max_macs, 2tau) complex128 ...
Attributes: (12/24)
    name:                   SENTINEL1_DS:/home1/scratch/agrouaze/xsardatasync...
    short_name:             SENTINEL1_DS:S1A_IW_SLC__1SDV_20181008T134439_201...
    product:                SLC
    safe:                   S1A_IW_SLC__1SDV_20181008T134439_20181008T134506_...
    swath:                  IW
    multidataset:           False
    ...                     ...
    radar_frequency:        5405000454.33435
    azimuth_time_interval:  0.002055556299999998
    tile_width_sample:      20000.0
    tile_width_line:        20000.0
    tile_overlap_sample:    0
    tile_overlap_line:      0