umr-lops / xsar

Synthetic Aperture Radar (SAR) Level-1 GRD python mapper for efficient xarray/dask based processing
https://cyclobs.ifremer.fr/static/sarwing_datarmor/xsar/
MIT License
25 stars 8 forks source link

use bursts if available to compute 'time' coordinate #19

Closed agrouaze closed 2 years ago

agrouaze commented 2 years ago

context: wave inversion in IW / EW SLC Sentinel-1 products.

What we expect: TOPS mode introduces overlapping of images slices in the azimuth dimension. We should find DN matrices in 2-D (same as GRD products) but a time variable that is not monotically increasing.

What we have in xsar (version 0.1.dev42+g09ea35d ): 2-D DN matrices are ok, but time variable` is monotically increasing.

Example of decoding performed in cerbere (Gilles Guitton 's repo): https://git.oceandatalab.com/gilles.guitton/sar_tops_osw/blob/master/sar_tops_osw/external/cerbere/mapper/safegeotifffile.py#L992

oarcher commented 2 years ago

Currently, time variable is interpolated over atrack given the time range (ie startTime and stopTime from manifest.safe ).

The exact time information can be found in <burst> record in annotation xml file:

 <swathTiming>
    <linesPerBurst>1507</linesPerBurst>
    <samplesPerBurst>23768</samplesPerBurst>
    <burstList count="10">
      <burst>
        <azimuthTime>2017-09-07T10:29:53.785095</azimuthTime>
        <azimuthAnxTime>2.599271272000000e+03</azimuthAnxTime>
        <sensingTime>2017-09-07T10:29:54.937240</sensingTime>
        <byteOffset>120875</byteOffset>
        <firstValidSample count="1507">-1 -1 -1 -1 -1 ....-1 -1 -1</firstValidSample>
        <lastValidSample count="1507">-1 -1 -1 -1 .... 23767 23767 23767 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1</lastValidSample>
      </burst>
     ....
</swathTiming>

This information should be decoded in xsar. While this is not done, advanced users can decode the xml file by them self:

filename='SENTINEL1_DS:/data/SAFE/S1A_IW_SLC__1SDV_20170907T102951_20170907T103021_018268_01EB76_AE7B.SAFE:IW1'
s1meta = xsar.Sentinel1Meta(filename)
s1meta.xml_parser.xpath(s1meta.files[s1meta.files['polarization'] == 'VV']['annotation'].item(),'/product/swathTiming/burstList/burst/azimuthTime')

['2017-09-07T10:29:51.883706',
 '2017-09-07T10:29:54.642263',
 '2017-09-07T10:29:57.396708',
 '2017-09-07T10:30:00.153209',
 '2017-09-07T10:30:02.913821',
 '2017-09-07T10:30:05.672378',
 '2017-09-07T10:30:08.432990',
 '2017-09-07T10:30:11.189491',
 '2017-09-07T10:30:13.945992',
 '2017-09-07T10:30:16.700437']