-
Notifications
You must be signed in to change notification settings - Fork 43
/
index.Rmd
208 lines (171 loc) · 21.4 KB
/
index.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
---
output:
github_document:
toc: no
fig_caption: no
---
<!-- IMPORTANT: do NOT edit README.Rmd! Edit index.Rmd instead, -->
<!-- and generate README.Rmd using utils/code/create_README.sh -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
[![CRAN Status](https://www.r-pkg.org/badges/version-ago/sen2r)](https://cran.r-project.org/package=sen2r)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1240384.svg)](https://doi.org/10.5281/zenodo.1240384)
[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/last-month/sen2r?color=green)](https://cran.rstudio.com/web/packages/ggplot2/index.html)
[![R-CMD-check](https://github.com/ranghetti/sen2r/workflows/R-CMD-check/badge.svg)](https://github.com/ranghetti/sen2r/actions/workflows/R-CMD-check.yaml)
[![Coverage Status](http://img.shields.io/codecov/c/github/ranghetti/sen2r/main.svg)](http://codecov.io/github/ranghetti/sen2r?branch=main)
[![Docker Automated build](https://img.shields.io/docker/automated/ranghetti/sen2r.svg)](https://hub.docker.com/r/ranghetti/sen2r)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](.github/CODE-OF-CONDUCT.md)
<img src="man/figures/sen2r_logo_200px.png" width="200" height="113" align="right" />
# sen2r: Find, Download and Process Sentinel-2 Data
<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>
is an R library which helps to download and preprocess Sentinel-2 optical images.
The purpose of the functions contained in the library is to provide the instruments
required to easily perform (and eventually automate) all the steps necessary
to build a complete Sentinel-2 processing chain, without the need of any manual
intervention nor the needing to manually integrate any external tool.
In particular,
<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>
allows to:
* retrieve the list of available products on a selected area
(which can be provided by specifying a bounding box, by loading a vector file
or by drawing it on a map) in a given time window;
* download the required SAFE Level-1C products, or
retrieve the required SAFE Level-2A products by downloading them (if available)
or downloading the corresponding Level-1C and correcting them with **Sen2Cor**;
* obtain the required products (Top of Atmosphere radiances, Bottom of Atmosphere
reflectances, Surface Classification Maps, True Colour Images) clipped on the
specified area (adjacent tiles belonging to the same frame are merged);
* mask cloudy pixels (using the Surface Classification Map as masking layer);
* computing spectral indices and RGB images.
**Important**: since November 2023,
Sentinel-2 SAFE archives can be searched and retrieved only from [Google Cloud Sentinel-2 bucket](https://cloud.google.com/storage/docs/public-datasets/sentinel-2);
to use it, **Google Cloud SDK must be installed** and configured following the
[official instructions](https://cloud.google.com/sdk/docs/install).
Refer to [this post](https://luigi.ranghetti.info/post/safe-gcloud/) for details
about how to install configure the required external dependency Google Cloud SDK.
Notice that this mode is not optimal (a modern STAC API approach should be used),
and searching products could be a very slow process.
Nevertheless, the replacement of the old official data source (ESA Hub) with the
new [Copernicus Data Space](https://dataspace.copernicus.eu/analyse/apis) is not
planned (this package is no longer actively maintained due to a career change of the developer).
Anyone who wants to help [can contribute](https://github.com/ranghetti/sen2r/issues/464)).
Setting the execution of this processing chain is particularly easy using the
<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>
GUI, which allows to set the parameters, to directly launch the main function
or to save them in a JSON file which can be used to launch the processing at a later stage.
The possibility to launch the processing with a set of parameters saved in a JSON file
(or directly passed as function arguments) makes easy to build scripts to
automatically update an archive of Sentinel-2 products.
Specific processing operations (i.e. applying **Sen2Cor** on Level-1c SAFE products,
merging adjacent tiles, computing spectral indices from existing products)
can also be performed using intermediate functions (see [usage](#usage)).
<a href="https://www.sciencedirect.com/science/article/pii/S0098300419304893" target="_blank"><img style="margin-right:20px;" src="data:image/gif;base64,R0lGODdheACgAPcAAAcECAgGCQkGCgkIDA0ICw0MDxYODz0AAC4HB0EAABQVE0MAAEQAAEUAABwTEkECBDgHB0kAAE8AAEcEBCIWFFQAADwLC0sGBlkAAB0bHicYFlsAAFgCAF4AAGAAAEkLCioaFy0dDVoGAFwGAGYAABwcNE4MDDAcGDQWImwAAG4AACIlHUcUDV4LAHAAAGUGBnACAk4TDnYAAGYMACUqHlMSEjYhG30AADIkIi0eO3QGBoIAAIMAAFcUFDsjG4YAAIMCAoQBBVIaFiUlRkAlHIwAADknI4UFBZIAAFkaGngMDC0zIzQtKEUnHZUAADAuMD4qJVwbG4cICJkAAW8UFFkeHkkpHT0wJkMtJXcUFE0rIKEBBpAMDV4jI1EtIDE9LaYCCEAzMVUvIakECXwaGmQlJaoFCkc1MKsFClkxITw5P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IoOKFNnJ9gYr3Kj2yTQaGvcjTZG6h46m98oooHx3AjEUQVS20Ep1YblEnFnRIGIcRa24ZJp1qhhnHmlbm4WacasYZ5hNg1bw002GH9aBeEu6lIhZggKHi3hSUoGIjKgS5BRg+eSPh0XsXhrTeejuAmMgNfvmlGlOUqeYTZV5ohWIITRkn5F80gecXditOR+J3w5IgAgbknXdYkTBoxJQ2bmnDPZ03sEQTKj7JeeXOqMi1gxdGODrXXDGQgOmmmYbaPQnGhA6JaZdhjnlesDDQJOc/lDGFEUtM+cVXSxr5lergGPlFGUta+eOXcpTRRBlgTElb7aolaBlTrLOOOSyafcbgZmVybsPmvNXWuXHHFxfa6b4XoBxwywMXnApTTKn5F1NaseQFyPUmfWbJ+27g5b8vZ52B4TpqI3ZfRy+dUp35xr3lCCJInfLVWwc+6wZ2J7743I9HPnnll2de9+J5b6B334Onvnrrq/c9e+235/73678HP3zxxye/fPPPRz999ddnv333rw8IADs=" width="120" height="160" align="left" /></a>
<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>
was published on the ISI journal *Computers \& Geosciences*; the manuscript is available here:
<a href="https://www.sciencedirect.com/science/article/pii/S0098300419304893" target="_blank">
L.\ Ranghetti, M.\ Boschetti, F.\ Nutini, L.\ Busetto (2020).
<strong>"sen2r: An R toolbox for automatically downloading and preprocessing Sentinel-2 satellite data"</strong>.
<em>Computers \& Geosciences</em>, 139, 104473.
doi: 10.1016/j.cageo.2020.104473,
URL: https://sen2r.ranghetti.info
</a>.
Users which processed Sentinel-2 data and used them for a scientific work
are strongly encouraged to cite this publication within their work (see [Credits](#credits)).
## Installation
The package can be installed from CRAN:
```{r, eval = FALSE}
install.packages("sen2r", dependencies = TRUE)
```
For detailed instructions about installing the package (including dependencies),
see the [Installation](articles/installation.md) page.
A dockerised version of <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> is available [here](https://hub.docker.com/r/ranghetti/sen2r).
For detailed instructions about using it, see the page ["Run in a Docker container"](articles/docker.md).
## Usage
The simplest way to use
<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>
is to execute it in interactive mode (see [this vignette](articles/sen2r_gui.md)):
```{r, eval = FALSE}
library(sen2r)
sen2r()
```
<p style="text-align:center;">
<a href="https://github.com/ranghetti/sen2r/raw/main/man/figures/sen2r_gui_sheet1.png" target="_blank">
<img src="man/figures/sen2r_gui_sheet1_small.png">
</a>
<a href="https://github.com/ranghetti/sen2r/raw/main/man/figures/sen2r_gui_sheet2.png" target="_blank">
<img src="man/figures/sen2r_gui_sheet2_small.png">
</a>
<br/>
<a href="https://github.com/ranghetti/sen2r/raw/main/man/figures/sen2r_gui_sheet3.png" target="_blank">
<img src="man/figures/sen2r_gui_sheet3_small.png">
</a>
<a href="https://github.com/ranghetti/sen2r/raw/main/man/figures/sen2r_gui_sheet4.png" target="_blank">
<img src="man/figures/sen2r_gui_sheet4_small.png">
</a>
<a href="https://github.com/ranghetti/sen2r/raw/main/man/figures/sen2r_gui_sheet5.png" target="_blank">
<img src="man/figures/sen2r_gui_sheet5_small.png">
</a>
</p>
Alternatively,
[`sen2r()`](reference/sen2r.md)
can be launched with a list of parameters (created with
[`s2_gui()`](reference/s2_gui.md))
or passing manually the parameters as arguments of the function
(see [this vignette](articles/sen2r_cmd.md) for further details).
Other specific functions can be used to run single steps separately.
This is a list of the principal processing functions
(the complete list can be found in the Reference page):
* [`s2_list()`](reference/s2_list.md)
to retrieve the list of available Sentinel-2 products based on input parameters;
* [`s2_download()`](reference/s2_download.md)
to download Sentinel-2 products;
* [`s2_order()`](reference/s2_order.md)
to order products from the Long Term Archive;
* [`sen2cor()`](reference/sen2cor.md)
to correct level-1C products using [Sen2Cor](https://step.esa.int/main/snap-supported-plugins/sen2cor/);
* [`s2_mask()`](reference/s2_mask.md)
to apply a cloud mask to Sentinel-2 products;
* [`s2_rgb()`](reference/s2_rgb.md)
to generate RGB images from Sentinel-2 Surface Reflectance multiband raster files;
* [`s2_calcindices()`](reference/s2_calcindices.md)
to compute maps of spectral indices from Sentinel-2 Surface Reflectance multiband raster files.
Output products follow a specific naming convention (see [here](articles/outstructure.md) for details).
## Credits
<a href="http://www.irea.cnr.it" target="_blank"> <img src="man/figures/irea_logo_200px.png" height="100" align="left" style="padding-right: 100px;"/></a>
<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>
is being developed by Luigi Ranghetti and Lorenzo Busetto
([IREA-CNR](http://www.irea.cnr.it)),
and it is released under the [GNU General Public License version 3](https://www.gnu.org/licenses/gpl-3.0.html) (GPL‑3).
The [<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> logo](https://github.com/ranghetti/sen2r/raw/main/man/figures/sen2r_logo_200px.png),
partially derived from the [R logo](https://www.r-project.org/logo),
is released under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0) (CC-BY-SA 4.0).
To cite this library, please use the following entry:
L.\ Ranghetti, M.\ Boschetti, F.\ Nutini, L.\ Busetto (2020).
**"sen2r: An R toolbox for automatically downloading and preprocessing Sentinel-2 satellite data"**.
*Computers \& Geosciences*, 139, 104473.
doi: <a href="https://dx.doi.org/10.1016/j.cageo.2020.104473" target="_blank">10.1016/j.cageo.2020.104473</a>,
URL: <a href="https://sen2r.ranghetti.info" target="_blank">https://sen2r.ranghetti.info</a>.
```bibtex
@Article{sen2r_cageo,
title = {sen2r: An R toolbox for automatically downloading and preprocessing Sentinel-2 satellite data},
author = {Luigi Ranghetti and Mirco Boschetti and Francesco Nutini and Lorenzo Busetto},
journal = {Computers & Geosciences},
year = {2020},
volume = {139},
pages = {104473},
doi = {10.1016/j.cageo.2020.104473},
url = {https://sen2r.ranghetti.info/},
}
```
## Contributing
This project is released with a [Contributor Code of Conduct](.github/CODE-OF-CONDUCT.md).
By participating in this project you agree to abide by its terms.
Users are encouraged to use GitHub issues in case of errors with the package.
Before opening a new issue, please read
<a href="https://github.com/ranghetti/sen2r/issues/186" target="_blank">these notes</a>.