ANSI-C program: SLC_copy_S1_TOPS.c
NAME
SLC_copy_S1_TOPS - Copy multiple bursts from a Sentinel-1 TOPS
mode SLC
SYNOPSIS
SLC_copy_S1_TOPS <SLC1_tab>
<SLC2_tab> <s1> <bn1> <s2> <bn2>
[dtype]
<SLC1_tab> | (input) 3 column list of TOPS SLC-1 swaths to be copied
in row order IW1, IW2, IW3: SLC_tab line entries: SLC SLC_par TOPS_par |
<SLC2_tab> | (input) 3 column list of the output copied SLC-1 TOPS swaths in the order IW1, IW2, IW3 |
<TOPS_par_in> | index of the swath containing the first burst to copy (1 --> number of swaths in SLC1_tab) |
<sw1> | index of the swath containing the first burst to copy (1 --> number of swaths in SLC1_tab) |
<bn1> | burst number of the first burst to copy in SLC swath sw1 (1 --> number of bursts in the swath |
<sw2> | index of the swath containing the last burst to copy (1 --> number of swaths in SLC1_tab) |
<bn2> | burst number of the last burst to copy in SLC swath sw2
(1 --> number of bursts in the swath) |
[dtype] | output data type (default: same as input data): 0: FCOMPLEX 1: SCOMPLEX |
EXAMPLES
Extract bursts in the multi-swath Sentinel-1 TOPS mode SLC with components listed in SLC_201409809_tab1. The copy begins with burst 2 in swath 1 and ends with burst 4 in swath 2.
SLC_copy_S1_TOPS SLC_20140809_tab1 SLC_20140809_tab2 1 2 2 4
Output is written into the files listed in SLC_20140809_tab2.
DESCRIPTION
SLC_copy_S1_TOPS copies a set of SLC
bursts from one data set to an output data set. The starting time
is specified by start time of burst bn1 in swath sw1. The last burst to be copied is
specified on the command line by sw2 and bn2. No burst is copied
that begins after bn2 in sw2. Different TOPS acquisitions
by Sentinel-1 may not cover the same bursts. SLC_copy_S1_TOPS can
be used to ensure that the different image swaths cover the same
bursts so that they can be coregistered. The program
functions by scanning the start time of each burst. If the start
time lies between the start burst and end burst start
times, it is copied. to the output. The user must provide
an SLC_tab list that
contains the name of the output data files. Calculations
are performed using the Modified Julian Date (MJD) of the bursts
to allow direct comparison of burst start times.
The SLC_tab file is a text file with one line for each SLC in the data set. Typically there are 3 images for Sentinel-1 Interferometric Wide Mode. The three columns correspond to the SLC data file name, the SLC parameter file name and the TOPS_par file name. The TOPS_par contains information on each burst in the burst SLC. The SLC_tab can contain fewer than 3 records, and in the case of Extended Wide mode, it can contain information for the five sub-swaths. The output SLC_tab can be produced simply with a text editor or written with a script.
Below are examples of the input SLC_tab: SLC_20140809_tab1
slc_TOPS/20140809_iw1_vv.slc
slc_TOPS/20140809_iw1_vv.slc.par
slc_TOPS/20140809_iw1_vv.tops_par
slc_TOPS/20140809_iw2_vv.slc
slc_TOPS/20140809_iw2_vv.slc.par
slc_TOPS/20140809_iw2_vv.tops_par
slc_TOPS/20140809_iw3_vv.slc
slc_TOPS/20140809_iw3_vv.slc.par
slc_TOPS/20140809_iw3_vv.tops_par
and the output SLC_tab SLC_201409809_tab2:
slc_TOPS_section/20140809_iw1_vv.slc
slc_TOPS_section/20140809_iw1_vv.slc.par
slc_TOPS_section/20140809_iw1_vv.tops_par
slc_TOPS_section/20140809_iw2_vv.slc
slc_TOPS_section/20140809_iw2_vv.slc.par
slc_TOPS_section/20140809_iw2_vv.tops_par
slc_TOPS_section/20140809_iw3_vv.slc
slc_TOPS_section/20140809_iw3_vv.slc.par
slc_TOPS_section/20140809_iw3_vv.tops_par
It is very useful to determine which swath has the earliest start time so that the desired bursts can be extracted. The start time of the SLCs is recorded in the SLC parameter files of the individual swaths. To simply view the start times the grep utility is useful:
$ grep start_time slc/*.slc.par
slc/20141115t053442_iw2_vv.slc.par:start_time:
20082.147456 s
slc/20141115t053443_iw3_vv.slc.par:start_time:
20083.088901 s
slc/20141115t053444_iw1_vv.slc.par:start_time:
20084.013901 s
SLC_copy_S1_TOPS can change the data type of the SLC data to be either fcomplex or scomplex by setting the dtype flag for the output data. By default the output data type is the same as the input file.
An example of running the program is shown here:
$ SLC_copy_S1_TOPS SLC_20140809_tab1 SLC_20140809_tab2 1
2 2 4
*** Copy multiple bursts from a Sentinel-1 TOPS mode SLC ***
*** Copyright 2014, Gamma Remote Sensing v1.1 26-Nov-2014 ***
TOPS SLC1_tab: SLC_20140809_tab1
number of SLC swaths in SLC1_tab: 3
SLC-1 swath SLC: slc_TOPS/20140809_iw1_vv.slc
SLC-1 swath SLC parameter file:
slc_TOPS/20140809_iw1_vv.slc.par
SLC-1 swath TOPS_PAR burst parameter file:
slc_TOPS/20140809_iw1_vv.tops_par
r0 (m): 800420.570 r2 (m): 849928.422 nr: 21253
rpix (m): 2.329562 t0 (s): 60946.535388 t2 (s):
60971.946175 nlines: 14661 time_per_line (s):
2.055556e-03
SLC-1 swath SLC: slc_TOPS/20140809_iw2_vv.slc
SLC-1 swath SLC parameter file:
slc_TOPS/20140809_iw2_vv.slc.par
SLC-1 swath TOPS_PAR burst parameter file:
slc_TOPS/20140809_iw2_vv.tops_par
r0 (m): 846820.788 r2 (m): 905423.250 nr: 25157
rpix (m): 2.329562 t0 (s): 60947.429555 t2 (s):
60972.949286 nlines: 15174 time_per_line (s):
2.055556e-03
SLC-1 swath SLC: slc_TOPS/20140809_iw3_vv.slc
SLC-1 swath SLC parameter file:
slc_TOPS/20140809_iw3_vv.slc.par
SLC-1 swath TOPS_PAR burst parameter file:
slc_TOPS/20140809_iw3_vv.tops_par
r0 (m): 902355.220 r2 (m): 958989.201 nr: 24312
rpix (m): 2.329562 t0 (s): 60948.368944 t2 (s):
60973.938009 nlines: 15345 time_per_line (s):
2.055556e-03
SLC2_tab file for S1 TOPS burst SLC section (output):
SLC_20140809_tab2
SLC swath number for the first burst: 1 burst number: 2
burst 1 start date: 2014-08-09T16:55:49.308333
seconds of day: 60949.30833
burst 1 MJD: 23596.705431809 seconds of day:
60949.30833
SLC swath number for the last burst: 2 burst number:
4
burst 2 start date: 2014-08-09T16:55:55.705225
seconds of day: 60955.70522
burst 2 MJD: 23596.705505848 seconds of day:
60955.70522
maximum number of bursts in an SLC swath: 9
******* SLC swath: 1 *******
TOPS SLC-2 swath section (output):
slc_TOPS_section/20140809_iw1_vv.slc
TOPS SLC-2 section SLC_par (output):
slc_TOPS_section/20140809_iw1_vv.slc.par
TOPS SLC-2 section TOPS_par (output):
slc_TOPS_section/20140809_iw1_vv.tops_par
TOPS SLC-1 swath number of records: 14661
TOPS SLC-1 swath number of records per burst: 1629
TOPS SLC-1 swath number of bursts: 9
number of range samples in the SLC-1 swath: 21253
total number of records in the SLC-1 swath: 14661
number of bytes/burst: 276969096
modified Julian date (MJD) first copied burst:
23596.70543181
modified Julian date (MJD) last copied burst:
23596.70550585
burst 1 2014-08-09T16:55:46.535387 MJD:
23596.705399715
burst 2 2014-08-09T16:55:49.308333 MJD:
23596.705431809
copying burst to output, byte offset: 0
burst 3 2014-08-09T16:55:52.060721 MJD:
23596.705463666
copying burst to output, byte offset: 276969096
burst 4 2014-08-09T16:55:54.819277 MJD:
23596.705495593
copying burst to output, byte offset: 553938192
burst 5 2014-08-09T16:55:57.577837 MJD:
23596.705527521
burst 6 2014-08-09T16:56:00.336394 MJD:
23596.705559449
burst 7 2014-08-09T16:56:03.094950 MJD:
23596.705591377
burst 8 2014-08-09T16:56:05.853506 MJD:
23596.705623304
burst 9 2014-08-09T16:56:08.599730 MJD:
23596.705655089
number of bursts written to output SLC-2: 3
number of lines written to the output SLC-2: 4887
******* SLC swath: 2 *******
TOPS SLC-2 swath section (output):
slc_TOPS_section/20140809_iw2_vv.slc
TOPS SLC-2 section SLC_par (output):
slc_TOPS_section/20140809_iw2_vv.slc.par
TOPS SLC-2 section TOPS_par (output):
slc_TOPS_section/20140809_iw2_vv.tops_par
TOPS SLC-1 swath number of records: 15174
TOPS SLC-1 swath number of records per burst: 1686
TOPS SLC-1 swath number of bursts: 9
number of range samples in the SLC-1 swath: 25157
total number of records in the SLC-1 swath: 15174
number of bytes/burst: 339317616
modified Julian date (MJD) first copied burst:
23596.70543181
modified Julian date (MJD) last copied burst:
23596.70550585
burst 1 2014-08-09T16:55:47.429554 MJD:
23596.705410064
burst 2 2014-08-09T16:55:50.192221 MJD:
23596.705442040
copying burst to output, byte offset: 0
burst 3 2014-08-09T16:55:52.948721 MJD:
23596.705473944
copying burst to output, byte offset: 339317616
burst 4 2014-08-09T16:55:55.705225 MJD:
23596.705505848
copying burst to output, byte offset: 678635232
burst 5 2014-08-09T16:55:58.463782 MJD:
23596.705537775
burst 6 2014-08-09T16:56:01.226447 MJD:
23596.705569751
burst 7 2014-08-09T16:56:03.997340 MJD:
23596.705601821
burst 8 2014-08-09T16:56:06.751784 MJD:
23596.705633701
burst 9 2014-08-09T16:56:09.485674 MJD:
23596.705665343
number of bursts written to output SLC-2: 3
number of lines written to the output SLC-2: 5058
******* SLC swath: 3 *******
TOPS SLC-2 swath section (output):
slc_TOPS_section/20140809_iw3_vv.slc
TOPS SLC-2 section SLC_par (output):
slc_TOPS_section/20140809_iw3_vv.slc.par
TOPS SLC-2 section TOPS_par (output):
slc_TOPS_section/20140809_iw3_vv.tops_par
TOPS SLC-1 swath number of records: 15345
TOPS SLC-1 swath number of records per burst: 1705
TOPS SLC-1 swath number of bursts: 9
number of range samples in the SLC-1 swath: 24312
total number of records in the SLC-1 swath: 15345
number of bytes/burst: 331615680
modified Julian date (MJD) first copied burst:
23596.70543181
modified Julian date (MJD) last copied burst:
23596.70550585
burst 1 2014-08-09T16:55:48.368942 MJD:
23596.705420937
burst 2 2014-08-09T16:55:51.127499 MJD:
23596.705452865
copying burst to output, byte offset: 0
burst 3 2014-08-09T16:55:53.884001 MJD:
23596.705484769
copying burst to output, byte offset: 331615680
burst 4 2014-08-09T16:55:56.642557 MJD:
23596.705516696
burst 5 2014-08-09T16:55:59.403170 MJD:
23596.705548648
burst 6 2014-08-09T16:56:02.163782 MJD:
23596.705580599
burst 7 2014-08-09T16:56:04.928503 MJD:
23596.705612598
burst 8 2014-08-09T16:56:07.682951 MJD:
23596.705644479
burst 9 2014-08-09T16:56:10.435339 MJD:
23596.705676335
number of bursts written to output SLC-2: 2
number of lines written to the output SLC-2: 3410
user time (s):
0.000
system time (s): 1.930
elapsed time (s): 20.110
SEE ALSO
SLC_par, typedef_ISP.h, TOPS_par