-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathoutstructure.Rmd
524 lines (466 loc) · 27.3 KB
/
outstructure.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
---
title: "Output file structure"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Output file structure}
%\VignetteEngine{knitr::knitr}
%\usepackage[UTF-8]{inputenc}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
[Products](#products) 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 [naming convention](#naming-convention),
and are organised within a customisable [folder structure](#folder-structure).
## Products
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:
1. [surface reflectances](#surface-reflectances) (<span style='font-family:monospace;color:#FF6611;'>TOA</span>
or <span style='font-family:monospace;color:#FF6611;'>BOA</span>);
2. [Accessory layers](#accessory-layers)
(<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>);
3. [Spectral indices](#spectral-indices);
4. true or false colour [RGB images](#rgb-colour-images).
### Surface reflectances
<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:
1. Band 1 -- Aerosol (443 nm)
2. Band 2 -- Blue (490 nm)
3. Band 3 -- Green (560 nm)
4. Band 4 -- Red (665 nm)
5. Band 5 -- Red-edge 1 (705 nm)
6. Band 6 -- Red-edge 2 (740 nm)
7. Band 7 -- Red-edge 3 (783 nm)
8.
- on rasters with an output resolution < 20m:
Band 8 -- NIR (842 nm)
- on rasters with an output resolution >= 20m:
Band 8A -- narrow NIR (865 nm)
9. Band 9 -- Water vapour (940 nm)
- on <span style='font-family:monospace;color:#FF6611;'>TOA</span> images:\
10. Band 10 -- Cirrus (1375 nm)\
11. Band 11 -- SWIR1 (1610 nm)\
12. Band 12 -- SWIR2 (2190 nm)
- on <span style='font-family:monospace;color:#FF6611;'>BOA</span> images:\
10. Band 11 -- SWIR1 (1610 nm)\
11. Band 12 -- SWIR2 (2190 nm)
Bands are named if an output ENVI format is chosen.
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">this page</a>.
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.
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 (>= 20m), otherwise band 8 is used.
The possibility to include both NIR bands could be included in a future release.
Reflectances values are provided in integer output type (multiplicated by 10000),
as well as original values included in SAFE archives.
### Accessory layers
#### Scene Classification Map
<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:
0. <font style="family:monospace;background-color:#000000;color:white;"> No data </font>
1. <font style="family:monospace;background-color:#FF0000;color:white;"> Saturated or defective </font>
2. <font style="family:monospace;background-color:#424142;color:white;"> Dark area pixels </font>
3. <font style="family:monospace;background-color:#633400;color:white;"> Cloud shadows </font>
4. <font style="family:monospace;background-color:#29f329;color:black;"> Vegetation </font>
5. <font style="family:monospace;background-color:#ffff00;color:black;"> Bare soils </font>
6. <font style="family:monospace;background-color:#0000ff;color:white;"> Water </font>
7. <font style="family:monospace;background-color:#7b7d7b;color:white;"> Unclassified </font>
8. <font style="family:monospace;background-color:#bdbebd;color:black;"> Cloud (medium probability) </font>
9. <font style="family:monospace;background-color:#ffffff;color:black;"> Cloud (high probability) </font>
10. <font style="family:monospace;background-color:#63cbff;color:black;"> Thin cirrus </font>
11. <font style="family:monospace;background-color:#ff9aff;color:black;"> Snow </font>
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">this page</a>.
<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.
#### Cloud and snow probability
<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).
#### Water vapour column
<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.
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">
Sentinel-2 Level 2A Product Definition</a> document.
### Aerosol Optical Thickness
<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.
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">
Sentinel-2 Level 2A Product Definition</a> document.
### Spectral indices
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 `s2_calcindices()` (or the main function `sen2r()`).
The list of the indices which can be computed can be seen in the GUI (fourth sheet).
In the GUI, the index formula is _usually_ 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:
```{r, eval = FALSE}
list_indices("s2_formula", "^NDVI$")
```
```
## [1] "(band_8-band_4)/(band_8+band_4)"
```
See the function documentation for other examples.
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 `outType` and `scaleFactor` of
function `s2_calcindices()`, or `index_datatype` of function `sen2r()`,
raster values will be multiplicated by 10000 respect to the "expected" index values.
### RGB colour images
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 `s2_rgb()` (or the main function `sen2r()`).
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 `s2_rgb()`.
If cloud masking is required by the user, RGB are never masked
(this because they are thought for visualisation).
The names of RGB products contains information about reflectance source
and reproduced bands (see the next section).
## Naming convention
ESA Sentinel-2 naming convention is particularly long-winded; so, a different
convention was adopted, follows this schema:
<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>
(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>)
* <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>);
* <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);
* <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>);
* <span style='color:#FF3300;font-family:monospace;font-weight:bold;'>EXTNAME</span>
(length: variable, see [details](#extent-name))
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 `s2_translate()`,
and is kept empty for outputs of function `s2_merge()`;
* <span style='color:#FF3300;font-family:monospace;font-weight:bold;'>PROD</span>
(length: variable) is the output product name, being one of these:
- 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);
- a spectral index name (the list of supported index names can be obtained
with the function `list_indices("name")`);
- the name of a RGB image (length: 7, see [details](#rgb-names)).
* <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>);
* <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>).
### Extent name
The extent name is defined with the argument `extent_name` of function `sen2r()`.
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.
### RGB names
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:
- <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);
- <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>.
## Folder structure
Processing functions allows setting an output directory using the arguments
`path_out`, `path_rgb` and `path_indices` (`sen2r()`) or `outdir`
(`s2_translate()`, `s2_merge()`, `s2_mask()`, `s2_rgb()` and `s2_calcindices()`).
These folders are automatically created if their parent directories exist.
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 `thumbnails`,
which contains small JPEG or PNG images which can be used to rapidly monitor
what was done (see `s2_thumbnails()` for further details).
For example, the following command would produce the outputs listed below.
```{r, eval=FALSE}
json_path <- build_example_param_file()
out_dir_1 <- tempfile(pattern = "sen2r_out_1_")
library(sen2r)
sen2r(
json_path,
timewindow = c("2019-07-13","2019-07-23"),
path_out = out_dir_1
)
```
```
[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...
```
_Most of output message were skipped;_
_see [this vignette](sen2r_cmd.html) for further details._
```
╔══════════════════════════════════════════════════════════════════════════════
║ 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")
```
```{r, eval=FALSE}
system(paste("tree", out_dir_1)) # working on Linux with binary "tree" installed
```
```
/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
```
In each of the 6 subfolders `BOA`, `MSAVI2`, `NDVI`, `RGB432B`, `RGB843B` and `SCL`
5 products (one for each date) were created.
Sub-subfolders `thumbnails` contains thumbnail images.
Users can skip the creation of products' subfolders setting the argument
`sen2r(..., path_subdirs = FALSE)` (default: `TRUE`), or doing the same with
the argument `subdir` of other processing functions.
The creation of thumbnails can be skipped using `sen2r(..., thumbnails = FALSE)`
(default: `TRUE`).
Both the options can be also set [using the `sen2r()` GUI](sen2r_gui.html).
For example, the following command would produce the outputs listed below.
```{r, eval=FALSE}
out_dir_2 <- tempfile(pattern = "sen2r_out_2_")
sen2r(
json_path,
timewindow = c("2019-07-13","2019-07-23"),
path_out = out_dir_2,
path_subdirs = FALSE,
thumbnails = FALSE
)
```
```
[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")
```
```{r, eval=FALSE}
system(paste("tree", out_dir_2))
```
```
/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
```