The goal of rsat is to help you handling time-series of satellite images from multiple platforms in a local, efficient, and standardized way. The package provides tools to;

  1. Search (run vignette("rsat1_search", package = "rsat") command)
  2. Download (run vignette("rsat2_download", package = "rsat") command)
  3. Customize, and (run vignette("rsat3_customize", package = "rsat") command)
  4. Process (run vignette("rsat4_process", package = "rsat") command)

satellite images from Landsat, MODIS, and Sentinel for a region and time of interest.

Installation

You can install the development version from GitHub with:

# check and install devtools
if(!require("devtools")){
   install.packages("devtools")
}
# check and install rmarkdown
if(!require("rmarkdown")){
  install.packages("rmarkdown")
}

devtools::install_github("spatialstatisticsupna/rsat", build_vignettes=TRUE)

Log-in profiles

The registration in the following online portals is required to get a full access to satellite images with rsat;

  • USGS USGS is the sole science agency for the Department of the Interior of United States. Provide access to Modis Images. More information about USGS can be found Here.
  • EarthData: A repository of NASA’s earth observation data-sets. More information about EarthData can be found here.
  • SciHub, a web service giving access to Copernicus’ scientific data hub. Please go here to find more details about the data hub.

For convenience, try to use the same username and password for all of them. To satisfy the criteria of all web services make sure that the username is 4 characters long and includes a period, number or underscore. The password must be 12 character long and should include characters with at least one capital letter, and numbers.

Example

This is a basic example which shows you how to compute the Normalized Difference Vegetation Index from a MODIS image captured on January 11th, 2020 in northern Spain (Navarre):

library(rsat)

# replace with your own "username" and "password"
set_credentials("username", "password")

# region and time of interest: rtoi
roi <- ex.navarre
toi <- as.Date("2020-01-11")
rtp <- tempdir()

set_database(file.path(tempdir(), "DATABASE"))

navarre <- new_rtoi("Navarre", roi, rtp)

# search, acquire, customize, and process
rsat_search(region = navarre, product = "mod09ga", dates = toi)
rsat_download(navarre)
rsat_mosaic(navarre, overwrite = TRUE)

rsat_derive(navarre, 
            product = "mod09ga", 
            variable = "NDVI")

# plot the results
plot(navarre, "view" , 
      product = "mod09ga", 
      variable = "NDVI", 
      breaks = seq(0, 1, 0.1))
      
plot(navarre,"dates")

See the vignettes for more examples:

Contributing

We accept contributions to improve the package. Before contributing, please follow these steps:

  • Contributions should be thoroughly tested with testthat.
  • Code style should attempt to follow the tidyverse style guide.
  • Please attempt to describe what you want to do prior to contributing by submitting an issue.
  • Please follow the typical github fork - pull-request workflow.
  • Make sure you use roxygen and run Check before contributing. More on this front as the package matures.

Citation

citation("rsat")[1]

To cite the package:

U. Pérez-Goya, M. Montesino-SanMartin, A F Militino, M D Ugarte (2021). rsat: Dealing with Multiplatform Satellite Images from Landsat, MODIS, and Sentinel. R package version 0.1.16. https://github.com/ropensci/rsat.

Acknowledgements

This work has been financed by projects MTM2017-82553-R (AEI/FEDER, UE) and PID2020-113125RB-I00/MCIN/AEI/10.13039/501100011033.