.. _files:

.. index:: files

======================================================================
Files produced
======================================================================

.. contents:: Contents:
   :local:
   :depth: 3

.. _final-products:

Final products
--------------

.. _full-S2-tiles:

.. index:: S2 tiles

Orthorectified S2 tiles
+++++++++++++++++++++++++++++

:Content: Complete final product: concatenated orthorectified S1 images on S2
          grid

:Directory:  :ref:`%(output) <paths.output>`:samp:`/{{tilename}}/`

:File name:

    - :samp:`s1{{a|b}}_{{tilename}}_{{polarity}}_{{orbitdirection}}_{{orbitnumber}}_{{YYYYMMDD}}txxxxxx.tif` when the tile has been assembled from the concatenation of several S1 images
    - :samp:`s1{{a|b}}_{{tilename}}_{{polarity}}_{{orbitdirection}}_{{orbitnumber}}_{{YYYYMMDD}}t{{hhmmss}}.tif` when the tile has been produced from a single S1 image


:Format: Float32 GeoTIFF, deflate compressed

:Metadata: The following metadata is added to the origin S1 images

    :``ACQUISITION_DATETIME``:       time of the first S1 image
    :``CALIBRATION``:                :ref:`chosen calibration option <Processing.calibration>`
    :``FLYING_UNIT_CODE``:           :samp:`s1{{a|b}}`
    :``IMAGE_TYPE``:                 :samp:`GRD`
    :``ORBIT``:                      :samp:`{{orbitnumber}}`
    :``ORBIT_DIRECTION``:            :samp:`{{orbitdirection}}`
    :``ORTHORECTIFIED``:             :samp:`true`
    :``POLARIZATION``:               :samp:`{{polarisation}}`
    :``PROCESSED_DATETIME``:         time when the tile has been generated by S1 Tiling.
    :``S2_TILE_CORRESPONDING_CODE``: :samp:`{{tilename}}`
    :``SPATIAL_RESOLUTION``:         :ref:`chosen output spatial resolution option <Processing.output_spatial_resolution>`
    :``TIFFTAG_DATETIME``:           is updated with the time when the tile has been generated by S1 Tiling.
    :``TIFFTAG_IMAGEDESCRIPTION``:   :samp:`Orthorectified Sentinel-1{{A|B}} IW GRD on S2 tile`
    :``TIFFTAG_SOFTWARE``:           :samp:`S1 Tiling v{{version}}` -- |version| currently

.. _mask-files:

.. index:: Mask files

Mask files
++++++++++

:Content:

    .. todo:: Thierry?

:Directory:  :ref:`%(output) <paths.output>`:samp:`/{{tilename}}/`

:File name: the same as the one from :ref:`the S2 tiles <full-S2-tiles>`, with
            `_BorderMask` appended

:Format: Byte GeoTIFF, deflate compressed

:Metadata: This file contains the same metadata as the one from :ref:`the S2
           tiles <full-S2-tiles>`  it has been generated from



.. _temporary-files:

.. index:: Temporary files

Temporary files
---------------

Before generating the final products, S1 Tiling produces temporary files. Some
are removed automatically, others are :ref:`cached <data-caches>` in between
several runs to shorten processing times when resuming after an interruption.

.. note:: It's up to you, end-user, to clean that directory regularly.

.. _orthoready-files:

Cut and calibrated S1 images ready for orthorectification
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
:Content: S1 images :ref:`calibrated <calibration>` and :ref:`cut <cutting>`.

:Directory:  :ref:`%(tmp) <paths.tmp>`:samp:`/S1/`

:File name: The same as the origin S1 file with ``_OrthoReady`` appended.

      .. note::
            An accompanying OTB ``.geom`` file is also generated.

      Example:

      .. code-block:: none

           s1a-iw-grd-vv-20200108t044150-20200108t044215-030704-038506-001_OrthoReady.tiff
           s1a-iw-grd-vv-20200108t044150-20200108t044215-030704-038506-001_OrthoReady.geom

:Format: Float32 GeoTIFF, uncompressed.

:Metadata: No metadata is added at this step.

.. note::
   These files can be kept as a same calibrated and cut S1 image can be
   orthorectified for producing several intersecting S2 tiles.

.. note::
   These temporary files will be produced only if :program:`S1Processor` is
   executed with ``--cache-before-ortho`` option.  In that case, the processing
   will no longer be done in memory and orthoready files will be produced.
   You would also have to explicitly clean these temporary files.

.. _orthorectified-files:

Orthorectified S1 images
++++++++++++++++++++++++

:Content: Single concatenated orthorectified S1 image on S2 grid

:Directory:  :ref:`%(tmp) <paths.tmp>`:samp:`/S2/{{tilename}}/`

:File name: :samp:`s1{{a|b}}_{{tilename}}_{{polarity}}_{{orbitdirection}}_{{orbitnumber}}_{{YYYYMMDD}}t{{hhmmss}}.tif`

:Format: Float32 GeoTIFF, deflate compressed

:Metadata: The metadata listed for :ref:`the S2 tile product <full-S2-tiles>`
           are actually produced at this step.

.. note::
   These files are automatically cleaned up.
