Skip to content

preprocS2 is an R package dedicated to basic preprocessing of Sentinel-2 Level-2A reflectance images.

License

Notifications You must be signed in to change notification settings

jbferet/preprocs2

Repository files navigation

preprocS2

An R package dedicated to basic preprocessing of Sentinel-2 Level-2A reflectance images

licence Build Status

preprocS2

preprocS2 is a basic wrapper of the rstac package. It aims at downloading and preparing Sentinel-2 images for further processings using R packages such as biodivMapR for spectral diversity mapping, prosail for the computation of vegetation biophysical variables, and spinr for the computation of vegetation biophysical variables or spectral indices.

Installation

remotes::install_github('jbferet/preprocS2')

Access to CDSE STAC catalog

preprocS2 uses the STAC API endpoint provided by MPC. However, some products optionally required by preprocS2 are not provided by this STAC API. This is the case for raster data corresponding to the geometry of acquisition of Sentinel-2 images.

These products are available from the STAC catalog provided by the Sentinel-hub Catalog API via Copernicus Dataspace.

To be able to download data from the Sentinel-hub STAC Catalog API via Copernicus Dataspace, create an account on the CDSE platform, then add your credentials to your ~/.Renviron.

First, open the ~/.Renviron file for your R install:

usethis::edit_r_environ()

Then write your CDSE username, corresponding to your email address, along with the corresponding password in this ~/.Renviron file:

CDSE_USERNAME = "my_email_address@email.xx"
CDSE_PASSWORD = "My_PaSsW0rD"

Finally, activate the OAuth clients following this link.

Warning: to activate the OAuth clients, please click on the + Create button, in the Account settings of the CDSE platform (See screenshot below). Make sure you save your ID and password which will be displayed once only. The ID should start with sh- and this is not the User ID and Account ID displayed in the User Info of your account settings.

Then add your OAuth clients credentials to your ~/.Renviron:

OAUTH_CDSE_ID = "sh-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
OAUTH_CDSE_PWD = "XXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Save the ~/.Renviron file and restart your R session. You should then be able to use all functionalities included in preprocS2.

Example

A tutorial vignette is available here.

Tutorial vignettes describing additional functionalities are also available here.

Acknowledgments / Fundings

This research was supported by the Agence Nationale de la Recherche (ANR, France) through the young researchers project BioCop (ANR-17-CE32-0001)

About

preprocS2 is an R package dedicated to basic preprocessing of Sentinel-2 Level-2A reflectance images.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages