Scenarios

Orthorectify pairs of Sentinel-1 images on Sentinel-2 grid

In this scenario pairs of Sentinel-1 images are:

  • calibrated according to β0, γ0 or σ0 calibration

  • then orthorectified onto MGRS Sentinel-2 grid,

  • to be finally concatenated.

The unique elements in this scenario are:

All options go in a request configuration file (e.g. MyS1ToS2.cfg in workingdir). Important options will be:

Then running S1Tiling is as simple as:

cd workingdir
S1Processor MyS1ToS2.cfg

Eventually,

  • The S1 products will be downloaded in s1_images.

  • The orthorectified tiles will be generated in output.

  • Temporary files will be produced in tmp.

Note

S1 Tiling never cleans the tmp directory as its files are cached in between runs. This means you will have to watch this directory and eventually clean it.

Orthorectify pairs of Sentinel-1 images on Sentinel-2 grid with σ0RTC NORMLIM calibration

This scenario is a variation of the previous one. The difference lies in the calibration applied: it is the \(σ^0_{RTC}\) NORMLIM calibration described in [Small2011].

[Small2011]

D. Small, “Flattening Gamma: Radiometric Terrain Correction for SAR Imagery,” in IEEE Transactions on Geoscience and Remote Sensing, vol. 49, no. 8, pp. 3081-3093, Aug. 2011, doi: 10.1109/TGRS.2011.2120616.

In S1Tiling, we have chosen to precompute Local Incidence Angle (LIA) maps on MGRS Sentinel-2 grid. Given a precise orbit file, a relative orbit and a MGRS tile, we directly compute the correction map on the selected Sentinel-2 tile.

That map will then be used for all series of pairs of Sentinel-1 images, of compatible orbit, β° calibrated and projected to the associated S2 tile.

Regarding options, the only difference with previous scenario are:

S1Tiling will then automatically take care of:

  • obtaining the precise orbit files (EOF), if none match the request parameters,

  • producing, or using existing, maps of sin(LIA) for each Sentinel-2 tiles – given an orbit and its direction,

  • producing intermediary products calibrated with β0 LUT.

sine(LIA)

Map of sine(LIA) on 33NWB descending orbit 007

Warning

If you wish to parallelize this scenario and dedicate a different cluster node to each date – as recommended in “Process huge quantities of data” scenario, you will NEED to produce all the LIA maps beforehand. Otherwise, a same file may be concurrently written to from different nodes, and it will likely end up corrupted.

Note

This scenario requires NORMLIM σ0 binaries. At the moment, NORMLIM σ0 binaries need to be compiled manually. Unless you use either S1Tiling docker images, or S1Tiling on CNES TREX cluster.

Note

This scenario requires to configure either cop_dataspace data provider in eodag configuration file, or to enter valid EarthData credentials in your ~/.netrc file (can be overridden with $NETRC).

Pre-produce maps of Local Incidence Angles for σ0RTC NORMLIM calibration

While S1Processor is able to produce the necessary LIA maps on the fly, it is not able to do so when parallelization is done manually over time ranges – as described in “Process huge quantities of data” scenario.

A dedicated program is provided to compute the LIA maps beforehand: S1LIAMap. It takes the exact same parameter files as S1Processor. A few options will be ignored though: calibration type, masking… But the following (non-obvious) options are mandatory:

cd workingdir
# Yes, the same file works!
S1LIAMap MyS1ToS2.cfg

Note

LIA maps are perfect products to be stored and reused.

Note

This scenario requires NORMLIM σ0 binaries. At the moment, NORMLIM σ0 binaries need to be compiled manually. Unless you use either S1Tiling docker images, or S1Tiling on CNES TREX cluster.

Note

To run S1LIAMap from the official S1Tiling docker, use --lia as the first parameter to the docker execution (just before the request configuration file and other S1LIAMap related parameters). See Using S1LIAMap or S1IAMap with a docker.

Produce maps of Ellipsoid Incidence Angles

S1Tiling permits producing maps of cosine, sine and/or tangent of the incidence angle over the WGS84 ellipsoid, thanks to S1IAMap program. See Incidence Angle data flow for more detailed information on the internal operation sequencing.

The typical use case is the following:

  1. Sine and cosine maps have been generated (with S1IAMap), and cached, for all MGRS Sentinel-2 tiles of interest.

  2. Series of calibrated and ortho-rectified Sentinel-1 data have been generated for a given calibration (typically σ°), and possibly made available on data providers like CNES’s Geodes.

  3. You can obtain the same product in other calibrations very quickly by applying the corrective sine/cosine map on the Sentinel-2 tiles product.

When input product has been σ° calibrated, products in other calibrations can be obtained thanks to apply-calibration-map.sh.

To convert a σ° calibrated product into:

  • a β° calibrated product, the image is divided by the sine map

    # By hand, with OTB, wrong CALIBRATION metadata
    otbcli_BandMath \
        -il  s1a_tile_polar_dir_087_time_sigma.tif sin_IA_s1a_tile_087.tif \
        -exp 'im1b1/im2b1' \
        -out s1a_tile_polar_dir_087_time_beta.tif
    # Fix the incorrect metadata
    gdal_edit.py -mo CALIBRATION=beta s1a_tile_polar_dir_087_time_beta.tif
    
    # By hand, with gdal, all metadata are lost
    gdal_calc.py \
        -A    s1a_tile_polar_dir_087_time_sigma.tif \
        -B    sin_IA_s1a_tile_087.tif \
        --calc "A/B"
        --out s1a_tile_polar_dir_087_time_beta.tif
    
    # Wrapped for batch application, with OTB, correct metadata
    apply-calibration-map.sh -c beta --dirmap path/to_sinIA_files path/to/S1Tiling/products
    
  • a γ° calibrated product, the image is divided by the cosine map

    # By hand, with OTB, wrong CALIBRATION metadata
    otbcli_BandMath \
        -il  s1a_tile_polar_dir_087_time_sigma.tif cos_IA_s1a_tile_087.tif \
        -exp 'im1b1/im2b1' \
        -out s1a_tile_polar_dir_087_time_gamma.tif
    # Fix the incorrect metadata
    gdal_edit.py -mo CALIBRATION=gamma s1a_tile_polar_dir_087_time_beta.tif
    
    # By hand, with gdal, all metadata are lost
    gdal_calc.py \
        -A    s1a_tile_polar_dir_087_time_sigma.tif \
        -B    cos_IA_s1a_tile_087.tif \
        --calc "A/B"
        --out s1a_tile_polar_dir_087_time_gamma.tif
    
    # Wrapped for batch application, with OTB, correct metadata
    apply-calibration-map.sh -c gamma --dirmap path/to_cosIA_files path/to/S1Tiling/products
    

Note

Given the calibration is applied on the Sentinel-2 tile geometry, and not in the original Sentinel-1 image geometry, small precision differences may be observed between this approach and the one where the desired calibration is applied at the beginning of the processing.

Relevant parameters

It takes a very similar parameter files as S1Processor. Actually the same file can be used: only relevant parameters will be taken in account:

cd workingdir
# Yes, the same file works!
S1IAMap MyS1ToS2.cfg

Note

This scenario requires NORMLIM σ0 binaries. At the moment, NORMLIM σ0 binaries need to be compiled manually. Unless you use either S1Tiling docker images, or S1Tiling on CNES TREX cluster.

Note

To run S1IAMap from the official S1Tiling docker, use --ia as the first parameter to the docker execution (just before the request configuration file and other S1IAMap related parameters). See Using S1LIAMap or S1IAMap with a docker.

Generate masks on final products

Pixel masks of valid data can be produced in all S1Processor scenarios when the option generate_border_mask is True.

Process huge quantities of data

This use case concerns people that:

  • have a lot of images to process over many tiles and over a consequent time-range,

  • and have access to computing resources like HPC clusters

In that case, S1Tiling will be much more efficient if the parallelization is done time-wise. We recommend cutting the full time range in smaller subranges, and to distribute each subrange (with all S2 tiles) to a different node – with jobarrays for instances.

Warning

This scenario is not compatible with normlim calibration where the LIA maps would be computed on-the-fly. For normlim calibration, it’s imperative to precompute (and store LIA maps) before going massively parallel.

Use any other set of DEM inputs

By default, S1Tiling comes with a GPKG database that associates SRTM30 geometries to the SRTM tile filename.

In order to use other DEM inputs, we need:

  1. DEM files stored in [PATHS].dem_dir directory.
    The format of these DEM files needs to be supported by OTB/GDAL.

  2. A DEM (GPKG) database that holds a key (or set of keys) that enable(s) to locate/name DEM files associated to a DEM geometry.
    Set the [PATHS].dem_database key accordingly.
    For instance, eotile provides a couple of DEM databases for various types of DEM files.

  3. A naming scheme that will associate an identifier key from the DEM database to a DEM filename (located in [PATHS].dem_dir directory).
    Set the [PATHS].dem_format key accordingly.
    The default {id}.hgt associates the id key to STRM 30 m DEM files.
    Using eotile DEM_Union.gpkg as DEM database, we could instead use:

    • {Product10}.tif for Copernicus 30 m DEM files, using Product10 key from the GPKG file.

    • {Product30}.tif for Copernicus 90 m DEM files, using Product30 key from the GPKG file.

  4. Make sure to use a Geoid file compatible with the chosen DEM. For instance S1Tiling is shipped with EGM96 Geoid with is compatible with SRTM. On the other hand, Copernicus DEM is related to EGM2008 (a.k.a. EGM08)