<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Output file structure • sen2r</title>
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/yeti/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css">
<script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><meta property="og:title" content="Output file structure">
<meta property="og:description" content="sen2r">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#toc">
    

    <div class="container template-article">
      <header><div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <span class="navbar-brand">
        <a class="navbar-link" href="../index.html">sen2r</a>
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">1.6.0</span>
      </span>
    </div>

    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav"></ul>
<ul class="nav navbar-nav navbar-right">
<li>
  <a href="../index.html">
    <span class="fa fa-home fa-lg"></span>
     
  </a>
</li>
<li>
  <a href="../reference/index.html">
    <span class="fa fa-file-code"></span>
     
     Reference
  </a>
</li>
<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
    <span class="fa fa-book"></span>
     
     Articles
     
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu" role="menu">
<li>
      <a href="../articles/installation.html">Installation</a>
    </li>
    <li>
      <a href="../articles/docker.html">Run in a Docker container</a>
    </li>
    <li>
      <a href="../articles/sen2r_gui.html">Using sen2r() from the GUI</a>
    </li>
    <li>
      <a href="../articles/sen2r_cmd.html">Using sen2r() from the command line</a>
    </li>
    <li>
      <a href="../articles/outstructure.html">Output file structure</a>
    </li>
  </ul>
</li>
<li>
  <a href="../news/index.html">
    <span class="fa fa-newspaper"></span>
     
     Changelog
  </a>
</li>
<li>
  <a href="http://luigi.ranghetti.info" class="external-link">
    <span class="fa fa-user"></span>
     
  </a>
</li>
<li>
  <a href="https://github.com/ranghetti/sen2r/" class="external-link">
    <span class="fa fa-github fa-lg"></span>
     
  </a>
</li>
      </ul>
</div>
<!--/.nav-collapse -->
  </div>
<!--/.container -->
</div>
<!--/.navbar -->

      

      </header><div class="row">
  <div class="col-md-9 contents">
    <div class="page-header toc-ignore">
      <h1 data-toc-skip>Output file structure</h1>
            
      
      <small class="dont-index">Source: <a href="https://github.com/ranghetti/sen2r/blob/HEAD/vignettes/outstructure.Rmd" class="external-link"><code>vignettes/outstructure.Rmd</code></a></small>
      <div class="hidden name"><code>outstructure.Rmd</code></div>

    </div>

    
    
<p><a href="#products">Products</a> generated using <span style="color:#5793dd;vertical-align:top;font-size:90%;font-weight:normal;">sen</span><span style="color:#6a7077;vertical-align:baseline;font-size:115%;font-weight:bolder;">2</span><span style="color:#2f66d5;vertical-align:baseline;font-size:90%;font-weight:bold;">r</span>
functions follows a precise <a href="#naming-convention">naming
convention</a>, and are organised within a customisable <a href="#folder-structure">folder structure</a>.</p>
<div class="section level2">
<h2 id="products">Products<a class="anchor" aria-label="anchor" href="#products"></a>
</h2>
<p>Currently, <span style="color:#5793dd;vertical-align:top;font-size:90%;font-weight:normal;">sen</span><span style="color:#6a7077;vertical-align:baseline;font-size:115%;font-weight:bolder;">2</span><span style="color:#2f66d5;vertical-align:baseline;font-size:90%;font-weight:bold;">r</span>
can be used to generate the following products:</p>
<ol style="list-style-type: decimal">
<li>
<a href="#surface-reflectances">surface reflectances</a> (<span style="font-family:monospace;color:#FF6611;">TOA</span> or <span style="font-family:monospace;color:#FF6611;">BOA</span>);</li>
<li>
<a href="#accessory-layers">Accessory layers</a> (<span style="font-family:monospace;color:#FF6611;">SCL</span>, <span style="font-family:monospace;color:#FF6611;">CLD</span>, <span style="font-family:monospace;color:#FF6611;">SNW</span>, <span style="font-family:monospace;color:#FF6611;">WVP</span>, <span style="font-family:monospace;color:#FF6611;">AOT</span>);</li>
<li>
<a href="#spectral-indices">Spectral indices</a>;</li>
<li>true or false colour <a href="#rgb-colour-images">RGB
images</a>.</li>
</ol>
<div class="section level3">
<h3 id="surface-reflectances">Surface reflectances<a class="anchor" aria-label="anchor" href="#surface-reflectances"></a>
</h3>
<p><span style="font-family:monospace;color:#FF6611;">TOA</span> (Top Of
Atmosphere) and <span style="font-family:monospace;color:#FF6611;">BOA</span> (Bottom Of
Atmosphere) surface reflectances are multiband rasters containing 12
(<span style="font-family:monospace;color:#FF6611;">TOA</span>) or 11
(<span style="font-family:monospace;color:#FF6611;">BOA</span>) bands,
here listed:</p>
<ol style="list-style-type: decimal">
<li>Band 1 – Aerosol (443 nm)</li>
<li>Band 2 – Blue (490 nm)</li>
<li>Band 3 – Green (560 nm)</li>
<li>Band 4 – Red (665 nm)</li>
<li>Band 5 – Red-edge 1 (705 nm)</li>
<li>Band 6 – Red-edge 2 (740 nm)</li>
<li>Band 7 – Red-edge 3 (783 nm)</li>
<li><ul>
<li>on rasters with an output resolution &lt; 20m: Band 8 – NIR (842
nm)</li>
<li>on rasters with an output resolution &gt;= 20m: Band 8A – narrow NIR
(865 nm)</li>
</ul></li>
<li>Band 9 – Water vapour (940 nm)</li>
</ol>
<ul>
<li>on <span style="font-family:monospace;color:#FF6611;">TOA</span>
images:<br>
 10. Band 10 – Cirrus (1375 nm)<br>
 11. Band 11 – SWIR1 (1610 nm)<br>
 12. Band 12 – SWIR2 (2190 nm)</li>
<li>on <span style="font-family:monospace;color:#FF6611;">BOA</span>
images:<br>
 10. Band 11 – SWIR1 (1610 nm)<br>
 11. Band 12 – SWIR2 (2190 nm)</li>
</ul>
<p>Bands are named if an output ENVI format is chosen.</p>
<p>For details about Sentinel-2 bands, refer to
<a href="https://sentinel.esa.int/web/sentinel/user-guides/sentinel-2-msi/resolutions/radiometric" target="_blank" class="external-link">this
page</a>.</p>
<p>All bands are reshaped with the same resolution. In case the user
chose a native resolution (10, 20 or 60 m), bands with a finest
resolution are downscaled using an averaged method, while pixels of
bands with a coarse resolution are replicated without any interpolation
method; conversely, in case the user chose a custom resolution, the
chosen resampling method is used.</p>
<p>Bands 8 and 8A are alternatively included, basing on the required
output resolution. That is due to the fact that they cover an
overlapping spectral window; so, band 8A (finer radiometric resolution,
coarse spatial one) is provided when the output spatial resolution is
adequate to include it (&gt;= 20m), otherwise band 8 is used. The
possibility to include both NIR bands could be included in a future
release.</p>
<p>Reflectances values are provided in integer output type
(multiplicated by 10000), as well as original values included in SAFE
archives.</p>
</div>
<div class="section level3">
<h3 id="accessory-layers">Accessory layers<a class="anchor" aria-label="anchor" href="#accessory-layers"></a>
</h3>
<div class="section level4">
<h4 id="scene-classification-map">Scene Classification Map<a class="anchor" aria-label="anchor" href="#scene-classification-map"></a>
</h4>
<p><span style="font-family:monospace;color:#FF6611;">SCL</span> (Scene
Classification Maps) are single band rasters provided within Level-2A
SAFE archives. Each 20-metres pixel is classified in one of the
following classes:</p>
<ol start="0" style="list-style-type: decimal">
<li>
<font style="family:monospace;background-color:#000000;color:white;"> 
No data  </font> </li>
<li>
<font style="family:monospace;background-color:#FF0000;color:white;"> 
Saturated or defective  </font> </li>
<li>
<font style="family:monospace;background-color:#424142;color:white;"> 
Dark area pixels  </font> </li>
<li>
<font style="family:monospace;background-color:#633400;color:white;"> 
Cloud shadows  </font> </li>
<li>
<font style="family:monospace;background-color:#29f329;color:black;"> 
Vegetation  </font> </li>
<li>
<font style="family:monospace;background-color:#ffff00;color:black;"> 
Bare soils  </font> </li>
<li>
<font style="family:monospace;background-color:#0000ff;color:white;"> 
Water  </font> </li>
<li>
<font style="family:monospace;background-color:#7b7d7b;color:white;"> 
Unclassified  </font> </li>
<li>
<font style="family:monospace;background-color:#bdbebd;color:black;"> 
Cloud (medium probability)  </font> </li>
<li>
<font style="family:monospace;background-color:#ffffff;color:black;"> 
Cloud (high probability)  </font> </li>
<li>
<font style="family:monospace;background-color:#63cbff;color:black;"> 
Thin cirrus  </font> </li>
<li>
<font style="family:monospace;background-color:#ff9aff;color:black;"> 
Snow  </font> </li>
</ol>
<p>For further details about this product, see
<a href="https://sentinels.copernicus.eu/web/sentinel/user-guides/sentinel-2-msi/processing-levels/level-2" target="_blank" class="external-link">this
page</a>.</p>
<p><span style="font-family:monospace;color:#FF6611;">SCL</span> are
used as intermediate layers for cloud masking, but they can be also
required as output formats. If cloud masking is required by the user,
<span style="font-family:monospace;color:#FF6611;">SCL</span> maps are
never masked.</p>
</div>
<div class="section level4">
<h4 id="cloud-and-snow-probability">Cloud and snow probability<a class="anchor" aria-label="anchor" href="#cloud-and-snow-probability"></a>
</h4>
<p><span style="font-family:monospace;color:#FF6611;">CLD</span> (cloud
probability) and <span style="font-family:monospace;color:#FF6611;">SNW</span> (snow
probability) are single band rasters provided within Level-2A SAFE
archives, representing the percentage probability (0-100 Byte values) of
each 20 metres pixel to be cloud- or snow-covered. If cloud masking is
required by the user, <span style="font-family:monospace;color:#FF6611;">CLD</span> and <span style="font-family:monospace;color:#FF6611;">SNW</span> maps are never
masked. Currently these layers cannot be used for cloud masking (only
<span style="font-family:monospace;color:#FF6611;">SCL</span> can).</p>
</div>
<div class="section level4">
<h4 id="water-vapour-column">Water vapour column<a class="anchor" aria-label="anchor" href="#water-vapour-column"></a>
</h4>
<p><span style="font-family:monospace;color:#FF6611;">WVP</span> is a
single band raster provided within Level-2A SAFE archives, representing
the water vapour column depth. Data type is Int16 (values must be
multiplicated by 1000 to obtain floating values in centimetres). Typical
ranges of water vapour columns are (sea-level-to space): tropical
conditions: <span style="font-family:monospace;color:#FF6611;">WVP</span> = 3-5 cm;
mid-altitude summer: <span style="font-family:monospace;color:#FF6611;">WVP</span> = 2-3 cm; dry
summer, spring, fall: <span style="font-family:monospace;color:#FF6611;">WVP</span> = 1-1.5 cm; dry
desert or winter: <span style="font-family:monospace;color:#FF6611;">WVP</span> = 0.3-0.8
cm.</p>
<p>For further details about this product, see the
<a href="https://step.esa.int/thirdparties/sen2cor/2.5.5/docs/S2-PDGS-MPC-L2A-PDD-V2.5.5.pdf" target="_blank" class="external-link">
Sentinel-2 Level 2A Product Definition</a> document.</p>
</div>
</div>
<div class="section level3">
<h3 id="aerosol-optical-thickness">Aerosol Optical Thickness<a class="anchor" aria-label="anchor" href="#aerosol-optical-thickness"></a>
</h3>
<p><span style="font-family:monospace;color:#FF6611;">AOT</span> is a
single band raster provided within Level-2A SAFE archives, representing
the aerosol optical thickness. It is defined as the integrated
extinction coefficient over a vertical column of atmosphere of unit
cross section. Extinction coefficient is the fractional depletion of
radiance per unit path length (also called attenuation for radar
frequencies). Data type is Int16 (values must be multiplicated by 1000
to obtain original values). If cloud masking is required by the user,
<span style="font-family:monospace;color:#FF6611;">AOT</span> is never
masked.</p>
<p>For further details about this product, see the
<a href="https://step.esa.int/thirdparties/sen2cor/2.5.5/docs/S2-PDGS-MPC-L2A-PDD-V2.5.5.pdf" target="_blank" class="external-link">
Sentinel-2 Level 2A Product Definition</a> document.</p>
</div>
<div class="section level3">
<h3 id="spectral-indices">Spectral indices<a class="anchor" aria-label="anchor" href="#spectral-indices"></a>
</h3>
<p>Spectral indices are single band rasters computed from <span style="font-family:monospace;color:#FF6611;">BOA</span> (by default) or
<span style="font-family:monospace;color:#FF6611;">TOA</span> images
using function <code><a href="../reference/s2_calcindices.html">s2_calcindices()</a></code> (or the main function
<code><a href="../reference/sen2r.html">sen2r()</a></code>).</p>
<p>The list of the indices which can be computed can be seen in the GUI
(fourth sheet). In the GUI, the index formula is <em>usually</em>
graphically provided. In order to check the formula which is used for
index computation, the function `list_indices()’ can be used. For
example, the following command will return the formula of index
NDVI:</p>
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/list_indices.html">list_indices</a></span><span class="op">(</span><span class="st">"s2_formula"</span>, <span class="st">"^NDVI$"</span><span class="op">)</span></span></code></pre></div>
<pre><code><span><span class="co">## [1] "(band_8-band_4)/(band_8+band_4)"</span></span></code></pre>
<p>See the function documentation for other examples.</p>
<p>The output type can be both floating (in this case, the actual index
value is provided) or integer (default; in this case, values are
multiplicated by a scaling factor, 10000 by default). So, if the user
did not change the arguments <code>outType</code> and
<code>scaleFactor</code> of function <code><a href="../reference/s2_calcindices.html">s2_calcindices()</a></code>, or
<code>index_datatype</code> of function <code><a href="../reference/sen2r.html">sen2r()</a></code>, raster
values will be multiplicated by 10000 respect to the “expected” index
values.</p>
</div>
<div class="section level3">
<h3 id="rgb-colour-images">RGB colour images<a class="anchor" aria-label="anchor" href="#rgb-colour-images"></a>
</h3>
<p>RGB are three-bands raster in 24-bit format, computed from <span style="font-family:monospace;color:#FF6611;">BOA</span> or <span style="font-family:monospace;color:#FF6611;">TOA</span> images using
function <code><a href="../reference/s2_rgb.html">s2_rgb()</a></code> (or the main function
<code><a href="../reference/sen2r.html">sen2r()</a></code>).</p>
<p>Users can customise the bands used to produce images, as well as the
reflectance ranges of each band and the source (<span style="font-family:monospace;color:#FF6611;">BOA</span> or <span style="font-family:monospace;color:#FF6611;">TOA</span>): the easiest
way to do this is to use the GUI (fifth sheet), or to properly set the
arguments of function <code><a href="../reference/s2_rgb.html">s2_rgb()</a></code>.</p>
<p>If cloud masking is required by the user, RGB are never masked (this
because they are thought for visualisation).</p>
<p>The names of RGB products contains information about reflectance
source and reproduced bands (see the next section).</p>
</div>
</div>
<div class="section level2">
<h2 id="naming-convention">Naming convention<a class="anchor" aria-label="anchor" href="#naming-convention"></a>
</h2>
<p>ESA Sentinel-2 naming convention is particularly long-winded; so, a
different convention was adopted, follows this schema:</p>
<p><span style="font-family:monospace;font-weight:bold;"><span style="color:#FF3300;">S2mll</span>_<span style="color:#FF3300;">yyyymmdd</span>_<span style="color:#FF3300;">rrr</span>_<span style="color:#FF3300;">EXTNAME</span>_<span style="color:#FF3300;">PROD</span>_<span style="color:#FF3300;">rr</span>.<span style="color:#FF3300;">fff</span></span></p>
<p>(e.g. <span style="font-family:monospace;"><span style="color:#FF6611;">S2A2A</span>_<span style="color:#FF6611;">20190723</span>_<span style="color:#FF6611;">022</span>_<span style="color:#FF6611;">Barbellino</span>_<span style="color:#FF6611;">BOA</span>_<span style="color:#FF6611;">10</span>.<span style="color:#FF6611;">tif</span></span>)</p>
<ul>
<li>
<span style="color:#FF3300;font-family:monospace;font-weight:bold;">S2mll</span>
(length: 5) shows the mission ID (<span style="font-family:monospace;color:#FF6611;">S2A</span> or <span style="font-family:monospace;color:#FF6611;">S2B</span>) and the product
level (<span style="font-family:monospace;color:#FF6611;">1C</span> or
<span style="font-family:monospace;color:#FF6611;">2A</span>);</li>
<li>
<span style="color:#FF3300;font-family:monospace;font-weight:bold;">yyyymmdd</span>
(length: 8) is the sensing date (e.g.  <span style="font-family:monospace;color:#FF6611;">20190723</span> for
2019-07-23); the hour is skipped, since a single sensor can not pass two
times in a day on the same tile);</li>
<li>
<span style="color:#FF3300;font-family:monospace;font-weight:bold;">rrr</span>
(length: 3) is the relative orbit number (e.g.  <span style="font-family:monospace;color:#FF6611;">022</span>);</li>
<li>
<span style="color:#FF3300;font-family:monospace;font-weight:bold;">EXTNAME</span>
(length: variable, see <a href="#extent-name">details</a>) is the output
extent name (e.g.  <span style="font-family:monospace;color:#FF6611;">Barbellino</span>); it
could also be the the tile number (length: 5 – e.g.  <span style="font-family:monospace;color:#FF6611;">32TQQ</span>) for outputs
of function <code><a href="../reference/s2_translate.html">s2_translate()</a></code>, and is kept empty for outputs
of function <code><a href="../reference/s2_merge.html">s2_merge()</a></code>;</li>
<li>
<span style="color:#FF3300;font-family:monospace;font-weight:bold;">PROD</span>
(length: variable) is the output product name, being one of these:
<ul>
<li>an output product: <span style="font-family:monospace;color:#FF6611;">TOA</span> (13-bands
Top-Of-Atmosphere Reflectance), <span style="font-family:monospace;color:#FF6611;">BOA</span> (13-bands
Bottom-Of-Atmosphere Reflectance) or <span style="font-family:monospace;color:#FF6611;">SCL</span> (Scene
Classification Map);</li>
<li>a spectral index name (the list of supported index names can be
obtained with the function <code>list_indices("name")</code>);</li>
<li>the name of a RGB image (length: 7, see <a href="#rgb-names">details</a>).</li>
</ul>
</li>
<li>
<span style="color:#FF3300;font-family:monospace;font-weight:bold;">rr</span>
(length: 2) is the original minimum spatial resolution in metres (<span style="font-family:monospace;color:#FF6611;">10</span>, <span style="font-family:monospace;color:#FF6611;">20</span> or <span style="font-family:monospace;color:#FF6611;">60</span>);</li>
<li>
<span style="color:#FF3300;font-family:monospace;font-weight:bold;">fff</span>
(length: variable, generally 3) is the file extension (e.g. <span style="font-family:monospace;color:#FF6611;">tif</span>).</li>
</ul>
<div class="section level3">
<h3 id="extent-name">Extent name<a class="anchor" aria-label="anchor" href="#extent-name"></a>
</h3>
<p>The extent name is defined with the argument <code>extent_name</code>
of function <code><a href="../reference/sen2r.html">sen2r()</a></code>.</p>
<p>The user can choose any non-empty alphanumeric string as extent name,
as long as it does not contain spaces, points nor underscores, and as
long as it is not a five-length string with the same structure of a tile
ID (two numeric and three uppercase character values), because this
structure is reserved for intermediate layers.</p>
</div>
<div class="section level3">
<h3 id="rgb-names">RGB names<a class="anchor" aria-label="anchor" href="#rgb-names"></a>
</h3>
<p>The names of RGB images are 7-length strings following the structure
<span style="font-family:monospace;font-weight:bold;color:#FF3300;">RGBrgbX</span>
(e.g. <span style="font-family:monospace;color:#FF6611;">RGBb84B</span>), where:</p>
<ul>
<li>
<span style="color:#FF3300;font-family:monospace;font-weight:bold;">r</span>,
<span style="color:#FF3300;font-family:monospace;font-weight:bold;">g</span>
and <span style="color:#FF3300;font-family:monospace;font-weight:bold;">b</span>
are the number of the bands to be used respectively for red, green and
blue, in hexadecimal format (in the example above, <span style="font-family:monospace;color:#FF6611;">b</span>, <span style="font-family:monospace;color:#FF6611;">8</span> and <span style="font-family:monospace;color:#FF6611;">4</span> correspond to
bands 11, 8 and 4);</li>
<li>
<span style="color:#FF3300;font-family:monospace;font-weight:bold;">X</span>
is <span style="font-family:monospace;color:#FF6611;">B</span> if index
source is <span style="font-family:monospace;color:#FF6611;">BOA</span>,
or <span style="font-family:monospace;color:#FF6611;">T</span> if source
is <span style="font-family:monospace;color:#FF6611;">TOA</span>.</li>
</ul>
</div>
</div>
<div class="section level2">
<h2 id="folder-structure">Folder structure<a class="anchor" aria-label="anchor" href="#folder-structure"></a>
</h2>
<p>Processing functions allows setting an output directory using the
arguments <code>path_out</code>, <code>path_rgb</code> and
<code>path_indices</code> (<code><a href="../reference/sen2r.html">sen2r()</a></code>) or <code>outdir</code>
(<code><a href="../reference/s2_translate.html">s2_translate()</a></code>, <code><a href="../reference/s2_merge.html">s2_merge()</a></code>,
<code><a href="../reference/s2_mask.html">s2_mask()</a></code>, <code><a href="../reference/s2_rgb.html">s2_rgb()</a></code> and
<code><a href="../reference/s2_calcindices.html">s2_calcindices()</a></code>). These folders are automatically created
if their parent directories exist.</p>
<p>By default, functions create a subfolder for each product / index /
RGB type, in which files are stored. Each product subfolder includes a
sub-subfolder named <code>thumbnails</code>, which contains small JPEG
or PNG images which can be used to rapidly monitor what was done (see
<code><a href="../reference/s2_thumbnails.html">s2_thumbnails()</a></code> for further details).</p>
<p>For example, the following command would produce the outputs listed
below.</p>
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">json_path</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/build_example_param_file.html">build_example_param_file</a></span><span class="op">(</span><span class="op">)</span></span>
<span><span class="va">out_dir_1</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/tempfile.html" class="external-link">tempfile</a></span><span class="op">(</span>pattern <span class="op">=</span> <span class="st">"sen2r_out_1_"</span><span class="op">)</span></span>
<span></span>
<span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://sen2r.ranghetti.info" class="external-link">sen2r</a></span><span class="op">)</span></span>
<span><span class="fu"><a href="../reference/sen2r.html">sen2r</a></span><span class="op">(</span></span>
<span>  <span class="va">json_path</span>, </span>
<span>  timewindow <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"2019-07-13"</span>,<span class="st">"2019-07-23"</span><span class="op">)</span>,</span>
<span>  path_out <span class="op">=</span> <span class="va">out_dir_1</span></span>
<span><span class="op">)</span></span></code></pre></div>
<pre><code>[2020-02-06 09:42:40] #### Starting sen2r execution. ####
[2020-02-06 09:42:40] Searching for available SAFE products on SciHub...
[2020-02-06 09:42:46] Computing output names...
[2020-02-06 09:42:48] Processing group 1 of 5...</code></pre>
<p><em>Most of output message were skipped;</em> <em>see <a href="sen2r_cmd.html">this vignette</a> for further details.</em></p>
<pre><code>╔══════════════════════════════════════════════════════════════════════════════
║ sen2r Processing Report
╟──────────────────────────────────────────────────────────────────────────────
║ Dates to be processed based on processing parameters: 5
║ Processing completed for: all expected dates.
╚══════════════════════════════════════════════════════════════════════════════
[2020-02-06 09:44:45] #### sen2r session terminated. ####
The processing chain can be re-launched with the command:
  sen2r("/home/lranghetti/.sen2r/proc_par/s2proc_20200206_094240.json")</code></pre>
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/base/system.html" class="external-link">system</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/paste.html" class="external-link">paste</a></span><span class="op">(</span><span class="st">"tree"</span>, <span class="va">out_dir_1</span><span class="op">)</span><span class="op">)</span> <span class="co"># working on Linux with binary "tree" installed</span></span></code></pre></div>
<pre><code>/tmp/RtmpUlAdHw/sen2r_out_1_a55119f4ed09
├── BOA
│   ├── S2A2A_20190713_022_sen2r_BOA_10.tif
│   ├── S2A2A_20190716_065_sen2r_BOA_10.tif
│   ├── S2A2A_20190723_022_sen2r_BOA_10.tif
│   ├── S2B2A_20190718_022_sen2r_BOA_10.tif
│   ├── S2B2A_20190721_065_sen2r_BOA_10.tif
│   └── thumbnails
│       ├── S2A2A_20190713_022_sen2r_BOA_10.jpg
│       ├── S2A2A_20190713_022_sen2r_BOA_10.jpg.aux.xml
│       ├── S2A2A_20190716_065_sen2r_BOA_10.jpg
│       ├── S2A2A_20190716_065_sen2r_BOA_10.jpg.aux.xml
│       ├── S2A2A_20190723_022_sen2r_BOA_10.jpg
│       ├── S2A2A_20190723_022_sen2r_BOA_10.jpg.aux.xml
│       ├── S2B2A_20190718_022_sen2r_BOA_10.jpg
│       ├── S2B2A_20190718_022_sen2r_BOA_10.jpg.aux.xml
│       ├── S2B2A_20190721_065_sen2r_BOA_10.jpg
│       └── S2B2A_20190721_065_sen2r_BOA_10.jpg.aux.xml
├── MSAVI2
│   ├── S2A2A_20190713_022_sen2r_MSAVI2_10.tif
│   ├── S2A2A_20190716_065_sen2r_MSAVI2_10.tif
│   ├── S2A2A_20190723_022_sen2r_MSAVI2_10.tif
│   ├── S2B2A_20190718_022_sen2r_MSAVI2_10.tif
│   ├── S2B2A_20190721_065_sen2r_MSAVI2_10.tif
│   └── thumbnails
│       ├── S2A2A_20190713_022_sen2r_MSAVI2_10.jpg
│       ├── S2A2A_20190713_022_sen2r_MSAVI2_10.jpg.aux.xml
│       ├── S2A2A_20190716_065_sen2r_MSAVI2_10.jpg
│       ├── S2A2A_20190716_065_sen2r_MSAVI2_10.jpg.aux.xml
│       ├── S2A2A_20190723_022_sen2r_MSAVI2_10.jpg
│       ├── S2A2A_20190723_022_sen2r_MSAVI2_10.jpg.aux.xml
│       ├── S2B2A_20190718_022_sen2r_MSAVI2_10.jpg
│       ├── S2B2A_20190718_022_sen2r_MSAVI2_10.jpg.aux.xml
│       ├── S2B2A_20190721_065_sen2r_MSAVI2_10.jpg
│       └── S2B2A_20190721_065_sen2r_MSAVI2_10.jpg.aux.xml
├── NDVI
│   ├── S2A2A_20190713_022_sen2r_NDVI_10.tif
│   ├── S2A2A_20190716_065_sen2r_NDVI_10.tif
│   ├── S2A2A_20190723_022_sen2r_NDVI_10.tif
│   ├── S2B2A_20190718_022_sen2r_NDVI_10.tif
│   ├── S2B2A_20190721_065_sen2r_NDVI_10.tif
│   └── thumbnails
│       ├── S2A2A_20190713_022_sen2r_NDVI_10.jpg
│       ├── S2A2A_20190713_022_sen2r_NDVI_10.jpg.aux.xml
│       ├── S2A2A_20190716_065_sen2r_NDVI_10.jpg
│       ├── S2A2A_20190716_065_sen2r_NDVI_10.jpg.aux.xml
│       ├── S2A2A_20190723_022_sen2r_NDVI_10.jpg
│       ├── S2A2A_20190723_022_sen2r_NDVI_10.jpg.aux.xml
│       ├── S2B2A_20190718_022_sen2r_NDVI_10.jpg
│       ├── S2B2A_20190718_022_sen2r_NDVI_10.jpg.aux.xml
│       ├── S2B2A_20190721_065_sen2r_NDVI_10.jpg
│       └── S2B2A_20190721_065_sen2r_NDVI_10.jpg.aux.xml
├── RGB432B
│   ├── S2A2A_20190713_022_sen2r_RGB432B_10.tif
│   ├── S2A2A_20190716_065_sen2r_RGB432B_10.tif
│   ├── S2A2A_20190723_022_sen2r_RGB432B_10.tif
│   ├── S2B2A_20190718_022_sen2r_RGB432B_10.tif
│   ├── S2B2A_20190721_065_sen2r_RGB432B_10.tif
│   └── thumbnails
│       ├── S2A2A_20190713_022_sen2r_RGB432B_10.jpg
│       ├── S2A2A_20190713_022_sen2r_RGB432B_10.jpg.aux.xml
│       ├── S2A2A_20190716_065_sen2r_RGB432B_10.jpg
│       ├── S2A2A_20190716_065_sen2r_RGB432B_10.jpg.aux.xml
│       ├── S2A2A_20190723_022_sen2r_RGB432B_10.jpg
│       ├── S2A2A_20190723_022_sen2r_RGB432B_10.jpg.aux.xml
│       ├── S2B2A_20190718_022_sen2r_RGB432B_10.jpg
│       ├── S2B2A_20190718_022_sen2r_RGB432B_10.jpg.aux.xml
│       ├── S2B2A_20190721_065_sen2r_RGB432B_10.jpg
│       └── S2B2A_20190721_065_sen2r_RGB432B_10.jpg.aux.xml
├── RGB843B
│   ├── S2A2A_20190713_022_sen2r_RGB843B_10.tif
│   ├── S2A2A_20190716_065_sen2r_RGB843B_10.tif
│   ├── S2A2A_20190723_022_sen2r_RGB843B_10.tif
│   ├── S2B2A_20190718_022_sen2r_RGB843B_10.tif
│   ├── S2B2A_20190721_065_sen2r_RGB843B_10.tif
│   └── thumbnails
│       ├── S2A2A_20190713_022_sen2r_RGB843B_10.jpg
│       ├── S2A2A_20190713_022_sen2r_RGB843B_10.jpg.aux.xml
│       ├── S2A2A_20190716_065_sen2r_RGB843B_10.jpg
│       ├── S2A2A_20190716_065_sen2r_RGB843B_10.jpg.aux.xml
│       ├── S2A2A_20190723_022_sen2r_RGB843B_10.jpg
│       ├── S2A2A_20190723_022_sen2r_RGB843B_10.jpg.aux.xml
│       ├── S2B2A_20190718_022_sen2r_RGB843B_10.jpg
│       ├── S2B2A_20190718_022_sen2r_RGB843B_10.jpg.aux.xml
│       ├── S2B2A_20190721_065_sen2r_RGB843B_10.jpg
│       └── S2B2A_20190721_065_sen2r_RGB843B_10.jpg.aux.xml
└── SCL
    ├── S2A2A_20190713_022_sen2r_SCL_10.tif
    ├── S2A2A_20190716_065_sen2r_SCL_10.tif
    ├── S2A2A_20190723_022_sen2r_SCL_10.tif
    ├── S2B2A_20190718_022_sen2r_SCL_10.tif
    ├── S2B2A_20190721_065_sen2r_SCL_10.tif
    └── thumbnails
        ├── S2A2A_20190713_022_sen2r_SCL_10.png
        ├── S2A2A_20190713_022_sen2r_SCL_10.png.aux.xml
        ├── S2A2A_20190716_065_sen2r_SCL_10.png
        ├── S2A2A_20190716_065_sen2r_SCL_10.png.aux.xml
        ├── S2A2A_20190723_022_sen2r_SCL_10.png
        ├── S2A2A_20190723_022_sen2r_SCL_10.png.aux.xml
        ├── S2B2A_20190718_022_sen2r_SCL_10.png
        ├── S2B2A_20190718_022_sen2r_SCL_10.png.aux.xml
        ├── S2B2A_20190721_065_sen2r_SCL_10.png
        └── S2B2A_20190721_065_sen2r_SCL_10.png.aux.xml

12 directories, 90 files</code></pre>
<p>In each of the 6 subfolders <code>BOA</code>, <code>MSAVI2</code>,
<code>NDVI</code>, <code>RGB432B</code>, <code>RGB843B</code> and
<code>SCL</code> 5 products (one for each date) were created.
Sub-subfolders <code>thumbnails</code> contains thumbnail images.</p>
<p>Users can skip the creation of products’ subfolders setting the
argument <code>sen2r(..., path_subdirs = FALSE)</code> (default:
<code>TRUE</code>), or doing the same with the argument
<code>subdir</code> of other processing functions. The creation of
thumbnails can be skipped using
<code>sen2r(..., thumbnails = FALSE)</code> (default:
<code>TRUE</code>). Both the options can be also set <a href="sen2r_gui.html">using the <code>sen2r()</code> GUI</a>.</p>
<p>For example, the following command would produce the outputs listed
below.</p>
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">out_dir_2</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/tempfile.html" class="external-link">tempfile</a></span><span class="op">(</span>pattern <span class="op">=</span> <span class="st">"sen2r_out_2_"</span><span class="op">)</span></span>
<span></span>
<span><span class="fu"><a href="../reference/sen2r.html">sen2r</a></span><span class="op">(</span></span>
<span>  <span class="va">json_path</span>, </span>
<span>  timewindow <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"2019-07-13"</span>,<span class="st">"2019-07-23"</span><span class="op">)</span>,</span>
<span>  path_out <span class="op">=</span> <span class="va">out_dir_2</span>,</span>
<span>  path_subdirs <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  thumbnails <span class="op">=</span> <span class="cn">FALSE</span></span>
<span><span class="op">)</span></span></code></pre></div>
<pre><code>[2020-02-06 09:52:30] #### Starting sen2r execution. ####
[2020-02-06 09:52:30] Searching for available SAFE products on SciHub...
[2020-02-06 09:52:35] Computing output names...
[2020-02-06 09:52:36] Processing group 1 of 5...

# most of output message were skipped

╔══════════════════════════════════════════════════════════════════════════════
║ sen2r Processing Report
╟──────────────────────────────────────────────────────────────────────────────
║ Dates to be processed based on processing parameters: 5
║ Processing completed for: all expected dates.
╚══════════════════════════════════════════════════════════════════════════════
[2020-02-06 09:54:16] #### sen2r session terminated. ####
The processing chain can be re-launched with the command:
  sen2r("/home/lranghetti/.sen2r/proc_par/s2proc_20200206_095230.json")</code></pre>
<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/base/system.html" class="external-link">system</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/paste.html" class="external-link">paste</a></span><span class="op">(</span><span class="st">"tree"</span>, <span class="va">out_dir_2</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
<pre><code>/tmp/RtmpUlAdHw/sen2r_out_2_a5513ad348b0
├── S2A2A_20190713_022_sen2r_BOA_10.tif
├── S2A2A_20190713_022_sen2r_MSAVI2_10.tif
├── S2A2A_20190713_022_sen2r_NDVI_10.tif
├── S2A2A_20190713_022_sen2r_RGB432B_10.tif
├── S2A2A_20190713_022_sen2r_RGB843B_10.tif
├── S2A2A_20190713_022_sen2r_SCL_10.tif
├── S2A2A_20190716_065_sen2r_BOA_10.tif
├── S2A2A_20190716_065_sen2r_MSAVI2_10.tif
├── S2A2A_20190716_065_sen2r_NDVI_10.tif
├── S2A2A_20190716_065_sen2r_RGB432B_10.tif
├── S2A2A_20190716_065_sen2r_RGB843B_10.tif
├── S2A2A_20190716_065_sen2r_SCL_10.tif
├── S2A2A_20190723_022_sen2r_BOA_10.tif
├── S2A2A_20190723_022_sen2r_MSAVI2_10.tif
├── S2A2A_20190723_022_sen2r_NDVI_10.tif
├── S2A2A_20190723_022_sen2r_RGB432B_10.tif
├── S2A2A_20190723_022_sen2r_RGB843B_10.tif
├── S2A2A_20190723_022_sen2r_SCL_10.tif
├── S2B2A_20190718_022_sen2r_BOA_10.tif
├── S2B2A_20190718_022_sen2r_MSAVI2_10.tif
├── S2B2A_20190718_022_sen2r_NDVI_10.tif
├── S2B2A_20190718_022_sen2r_RGB432B_10.tif
├── S2B2A_20190718_022_sen2r_RGB843B_10.tif
├── S2B2A_20190718_022_sen2r_SCL_10.tif
├── S2B2A_20190721_065_sen2r_BOA_10.tif
├── S2B2A_20190721_065_sen2r_MSAVI2_10.tif
├── S2B2A_20190721_065_sen2r_NDVI_10.tif
├── S2B2A_20190721_065_sen2r_RGB432B_10.tif
├── S2B2A_20190721_065_sen2r_RGB843B_10.tif
└── S2B2A_20190721_065_sen2r_SCL_10.tif

0 directories, 30 files</code></pre>
</div>
  </div>

  <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">

        <nav id="toc" data-toggle="toc"><h2 data-toc-skip>Contents</h2>
    </nav>
</div>

</div>



      <footer><div class="copyright">
  <p></p>
<p>Developed by Luigi Ranghetti, Lorenzo Busetto.</p>
</div>

<div class="pkgdown">
  <p></p>
<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.7.</p>
</div>

      </footer>
</div>

  


  

  </body>
</html>
