diff --git a/DESCRIPTION b/DESCRIPTION index d920a147..8972709e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,13 +1,12 @@ Package: sen2r Type: Package Title: Find, Download and Process Sentinel-2 Data -Version: 1.3.9.9002 +Version: 1.4.0 Authors@R: c(person("Luigi", "Ranghetti", email = "luigi@ranghetti.info", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-6207-5188")), person("Lorenzo", "Busetto", - email = "lbusett@gmail.com", role = c("aut"), comment = c(ORCID = "0000-0001-9634-6038"))) Description: Functions to download Sentinel-2 optical images diff --git a/NEWS.md b/NEWS.md index ec0128b5..94f5f1e8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,41 @@ +# Version 1.4.0 + +## Major changes +- `gdal_warp()` was partially rewritten: now reshaped rasters conserve square + pixels also after warping operations. _This change also affects `sen2r()` + products if reshaping features (reprojection or custom resolution) + are required._ + This update was necessary due to changes performed in GDAL since version + 3.2.0 (see [OSGeo/gdal♯3294](https://github.com/OSGeo/gdal/issues/3294)), + which did not grant homogeneity between outputs produced with different + GDAL versions. + Note that, in case the user wants to update an existing sen2r archive + produced with `{sen2r}` < 1.4.0, the old existing grid is maintained + so that product grids are equal (in order to produce outputs with the new + grid, users must create a new archive). +- Manage images split in two SAFE products, to avoid producing black areas + in these [uncommon] cases (see #353 for an explanation). + As effects: + 1. now pixels outside footprints (including nodata outside orbits coverage) + are always set to nodata; + 2. now `s2_download()` is no more able to use existing products equivalent + to found ones. + +## Minor changes +- Add templates for GitHub issues. +- Do not return error in tests in case of SciHub server down (#354). + +## Changes in default values +- Pixels outside footprints (because of previous point, or - more frequently - + because outside orbits coverage) are always set to NA even + if no cloud masking is performed. +- `s2_download()` no more uses existing SAFE products instead than downloading + new equivalent ones (this in order to manage images split in two SAFE archives). + +## Documentation +- Update vignette data (granting using online data) (#360). + + # Version 1.3.9 ## Bug fixes diff --git a/R/abs2rel.R b/R/abs2rel.R index 1792877f..92ccd818 100644 --- a/R/abs2rel.R +++ b/R/abs2rel.R @@ -18,9 +18,8 @@ #' @author Luigi Ranghetti, phD (2017) \email{luigi.ranghetti@@gmail.com} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @export #' diff --git a/R/add_rgb_image.R b/R/add_rgb_image.R index 0f1dee1b..446cdccc 100644 --- a/R/add_rgb_image.R +++ b/R/add_rgb_image.R @@ -5,9 +5,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 add_rgb_image <- function(s2_bands) { diff --git a/R/add_tile_suffix.R b/R/add_tile_suffix.R index 6c361003..20eb6dee 100644 --- a/R/add_tile_suffix.R +++ b/R/add_tile_suffix.R @@ -26,9 +26,8 @@ #' @author Luigi Ranghetti, phD (2020) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @examples #' safe_names <- c( diff --git a/R/build_example_param_file.R b/R/build_example_param_file.R index c98b3591..c4da1880 100644 --- a/R/build_example_param_file.R +++ b/R/build_example_param_file.R @@ -11,9 +11,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom jsonlite toJSON #' @export diff --git a/R/calcindex.R b/R/calcindex.R index 3080b544..5c7fc393 100644 --- a/R/calcindex.R +++ b/R/calcindex.R @@ -27,10 +27,9 @@ #' #' @author Luigi Ranghetti, phD (2020) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' "sen2r": An R toolbox for automatically downloading and preprocessing +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 calcindex_raster <- function( diff --git a/R/check_gdal.R b/R/check_gdal.R index 3d360cc5..56d387a6 100644 --- a/R/check_gdal.R +++ b/R/check_gdal.R @@ -24,9 +24,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom jsonlite toJSON #' @export diff --git a/R/check_gui_deps.R b/R/check_gui_deps.R index e56f1a86..b1bdcda2 100644 --- a/R/check_gui_deps.R +++ b/R/check_gui_deps.R @@ -13,9 +13,8 @@ #' @author Luigi Ranghetti, phD (2020) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @export #' @examples diff --git a/R/check_param_list.R b/R/check_param_list.R index d3c460d4..bbdc8aec 100644 --- a/R/check_param_list.R +++ b/R/check_param_list.R @@ -22,9 +22,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 diff --git a/R/check_sen2r_deps.R b/R/check_sen2r_deps.R index 9da3e014..941a5306 100644 --- a/R/check_sen2r_deps.R +++ b/R/check_sen2r_deps.R @@ -14,9 +14,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom utils capture.output #' @importFrom httr RETRY write_disk progress diff --git a/R/compute_s2_paths.R b/R/compute_s2_paths.R index 1083bae9..cff6cd26 100644 --- a/R/compute_s2_paths.R +++ b/R/compute_s2_paths.R @@ -46,9 +46,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @import data.table diff --git a/R/comsub.R b/R/comsub.R index 4ec278a8..61c4be6b 100644 --- a/R/comsub.R +++ b/R/comsub.R @@ -11,9 +11,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note Modified from a suggestion taken from #' [stackoverflow](https://stackoverflow.com/questions/28273716/r-implementation-for-finding-the-longest-common-starting-substrings-in-a-set-of). #' @export diff --git a/R/create_indices_db.R b/R/create_indices_db.R index fbbe8797..a3b941fc 100644 --- a/R/create_indices_db.R +++ b/R/create_indices_db.R @@ -20,9 +20,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @import data.table #' @importFrom XML htmlTreeParse xmlRoot readHTMLTable xmlAttrs saveXML @@ -195,11 +194,14 @@ create_indices_db <- function(xslt_path = NA, } - # last manual corrections on formulas + # last manual corrections on names s2_table[,s2_formula:=gsub("par\\_([0-9])", "band_\\1", s2_table$s2_formula)] # some bands were wrongly classified as parameters s2_table$name[s2_table$name=="TCI"] <- "TCIdx" # in order not to mess with TCI True Color Image product s2_table$name[s2_table$name=="NDSI"] <- "NDSaI" # in order not to mess with Normalized Difference Snow Index + # last manual corrections on formulas + s2_table[name=="ARVI", s2_formula := gsub("band_8a", "band_8", s2_formula)] # revert manual change on IDB + # rename parameters (A, B, ...) s2_table[,s2_formula:=gsub("par\\_([aALyY]r?)", "par_a", s2_table$s2_formula)] # first parameters (a, A, ar, y, Y, L) -> "a" s2_table[,s2_formula:=gsub("par\\_([bB])", "par_b", s2_table$s2_formula)] # second parameters (b, B) -> "b" diff --git a/R/create_s2_dop.R b/R/create_s2_dop.R index 73b94be4..058aa55d 100644 --- a/R/create_s2_dop.R +++ b/R/create_s2_dop.R @@ -12,9 +12,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @import data.table #' @importFrom jsonlite toJSON fromJSON diff --git a/R/expand_path.R b/R/expand_path.R index 9a013c71..52b77c97 100644 --- a/R/expand_path.R +++ b/R/expand_path.R @@ -20,9 +20,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 @@ -81,9 +80,8 @@ expand_path <- function(path, parent=getwd(), silent=TRUE, normalize=TRUE) { #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 diff --git a/R/expect_equal_crs.R b/R/expect_equal_crs.R index fc30c08e..b8b82e4b 100644 --- a/R/expect_equal_crs.R +++ b/R/expect_equal_crs.R @@ -8,9 +8,8 @@ #' @author Luigi Ranghetti, phD (2020) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 expect_equal_crs <- function(crs1, crs2) { diff --git a/R/fix_envi_format.R b/R/fix_envi_format.R index 47981f4d..65268771 100644 --- a/R/fix_envi_format.R +++ b/R/fix_envi_format.R @@ -14,9 +14,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 fix_envi_format <- function(infiles) { diff --git a/R/gdalUtil.R b/R/gdalUtil.R index 83249dd7..2ff4222e 100644 --- a/R/gdalUtil.R +++ b/R/gdalUtil.R @@ -26,9 +26,8 @@ #' @author Luigi Ranghetti, phD (2020) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @examples #' # Define product names @@ -50,8 +49,8 @@ #' options = c("-tr", "2", "2", "-r", "cubicspline", "-co", "COMPRESS=DEFLATE") #' ) #' oldpar <- par(mfrow = c(1,2), mar = rep(0,4)) -#' image(stars::read_stars(examplename), rgb = c(11,8,4)) -#' image(stars::read_stars(outname1), rgb = c(11,8,4)) +#' image(stars::read_stars(examplename), rgb = c(11,8,4), useRaster = TRUE) +#' image(stars::read_stars(outname1), rgb = c(11,8,4), useRaster = TRUE) #' #' ## gdalwarp @@ -62,8 +61,8 @@ #' options = c("-t_srs", "EPSG:32633", "-co", "COMPRESS=DEFLATE") #' ) #' oldpar <- par(mfrow = c(1,2), mar = rep(0,4)) -#' image(stars::read_stars(examplename), rgb = c(11,8,4)) -#' image(stars::read_stars(outname2), rgb = c(11,8,4)) +#' image(stars::read_stars(examplename), rgb = c(11,8,4), useRaster = TRUE) +#' image(stars::read_stars(outname2), rgb = c(11,8,4), useRaster = TRUE) #' #' ## gdal_calc #' outname3 <- tempfile(fileext = ".tif") @@ -78,8 +77,8 @@ #' options = c("--A_band", "8", "--B_band", "4", "--type", "Int16") #' ) #' oldpar <- par(mfrow = c(1,2), mar = rep(0,4)) -#' image(stars::read_stars(ndvirefname)) -#' image(stars::read_stars(outname3)) +#' image(stars::read_stars(ndvirefname), useRaster = TRUE) +#' image(stars::read_stars(outname3), useRaster = TRUE) #' } diff --git a/R/gdal_abs2rel.R b/R/gdal_abs2rel.R index 9743e9f4..3c7d5f9d 100644 --- a/R/gdal_abs2rel.R +++ b/R/gdal_abs2rel.R @@ -13,9 +13,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @export #' @name gdal_abs2rel diff --git a/R/gdal_warp.R b/R/gdal_warp.R index 79344951..c0628874 100644 --- a/R/gdal_warp.R +++ b/R/gdal_warp.R @@ -58,9 +58,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @examples #' \donttest{ @@ -87,12 +86,12 @@ #' # Show output #' crop_bbox <- sf::st_as_sfc(sf::st_bbox(crop_line)) #' oldpar <- par(mfrow = c(1,3), mar = rep(0,4)) -#' image(stars::read_stars(ex_sel), rgb = 1:3) +#' image(stars::read_stars(ex_sel), rgb = 1:3, useRaster = TRUE) #' plot(crop_line, add = TRUE, col = "blue", lwd = 2) #' plot(crop_bbox, add = TRUE, border = "red", lwd = 2) -#' image(stars::read_stars(test1), rgb = 1:3) +#' image(stars::read_stars(test1), rgb = 1:3, useRaster = TRUE) #' plot(crop_bbox, add = TRUE, border = "red", lwd = 2) -#' image(stars::read_stars(test2), rgb = 1:3) +#' image(stars::read_stars(test2), rgb = 1:3, useRaster = TRUE) #' plot(crop_line, add = TRUE, col = "blue", lwd = 2) #' #' # Warp on a reference raster @@ -101,9 +100,9 @@ #' #' # Show output #' par(mfrow = c(1,3)) -#' par(mar = rep(0,4)); image(stars::read_stars(ex_sel), rgb = 1:3) -#' par(mar = rep(2/3,4)); image(stars::read_stars(ex_ref)) -#' par(mar = rep(0,4)); image(stars::read_stars(test3), rgb = 1:3) +#' par(mar = rep(0,4)); image(stars::read_stars(ex_sel), rgb = 1:3, useRaster = TRUE) +#' par(mar = rep(2/3,4)); image(stars::read_stars(ex_ref), useRaster = TRUE) +#' par(mar = rep(0,4)); image(stars::read_stars(test3), rgb = 1:3, useRaster = TRUE) #' #' # Reproject all the input file #' test4 <- tempfile(fileext = "_test4.tif") @@ -122,13 +121,13 @@ #' test1_bbox <- sf::st_as_sfc(sf::st_bbox(stars::read_stars(test1))) #' test1_bbox_31N <- sf::st_transform(test1_bbox, 32631) #' par(mfrow = c(1,4), mar = rep(0,4)) -#' image(stars::read_stars(ex_sel), rgb = 1:3) +#' image(stars::read_stars(ex_sel), rgb = 1:3, useRaster = TRUE) #' plot(crop_line, add = TRUE, col = "blue", lwd = 2) #' plot(test1_bbox, add = TRUE, border = "red", lwd = 2) -#' image(stars::read_stars(test4), rgb = 1:3) -#' image(stars::read_stars(test5), rgb = 1:3) +#' image(stars::read_stars(test4), rgb = 1:3, useRaster = TRUE) +#' image(stars::read_stars(test5), rgb = 1:3, useRaster = TRUE) #' plot(test1_bbox_31N, add = TRUE, border = "red", lwd = 2) -#' image(stars::read_stars(test6), rgb = 1:3) +#' image(stars::read_stars(test6), rgb = 1:3, useRaster = TRUE) #' plot(crop_line_31N, add = TRUE, col = "blue", lwd = 2) #' #' # Use a reference raster with a different projection @@ -146,13 +145,13 @@ #' #' # Show output #' par(mfrow = c(1,4), mar = rep(0,4)) -#' image(stars::read_stars(ex_sel), rgb = 1:3) +#' image(stars::read_stars(ex_sel), rgb = 1:3, useRaster = TRUE) #' plot(crop_line, add = TRUE, col = "blue", lwd = 2) -#' image(stars::read_stars(test7), rgb = 1:3) +#' image(stars::read_stars(test7), rgb = 1:3, useRaster = TRUE) #' plot(crop_line_31N, add = TRUE, col = "blue", lwd = 2) -#' image(stars::read_stars(test8), rgb = 1:3) +#' image(stars::read_stars(test8), rgb = 1:3, useRaster = TRUE) #' plot(test1_bbox_31N, add = TRUE, border = "red", lwd = 2) -#' image(stars::read_stars(test9), rgb = 1:3) +#' image(stars::read_stars(test9), rgb = 1:3, useRaster = TRUE) #' plot(crop_line_31N, add = TRUE, col = "blue", lwd = 2) #' #' par(oldpar) @@ -232,24 +231,6 @@ gdal_warp <- function(srcfiles, } } - # if "ref" is specified, read ref parameters - if (!is.null(ref)) { - ref_metadata <- raster_metadata(ref, format = "list")[[1]] - ref_res <- ref_metadata$res - ref_size <- ref_metadata$size - t_srs <- ref_metadata$proj - ref_bbox <- ref_metadata$bbox - ref_ll <- ref_bbox[c("xmin","ymin")] - sel_of <- ifelse(is.null(of), ref_metadata$outformat, of) - - # round "tr" to ref grid - if (is.null(tr)) { - tr <- ref_res - } else { - tr <- ref_size*ref_res/round((ref_size*ref_res)/tr) - } - } - # define tmpdir if (is.na(tmpdir)) { tmpdir <- tempfile(pattern="gdalwarp_") @@ -257,8 +238,13 @@ gdal_warp <- function(srcfiles, tmpdir <- file.path(tmpdir, basename(tempfile(pattern="gdalwarp_"))) } - # if "mask" is specified, take "mask" and "te" from it - if (!is.null(mask)) { + # actions to perform if "mask" is specified + if ( + !is.null(mask) && + (!inherits(mask, "logical") || inherits(mask, "logical") && !anyNA(mask)) + ) { + + # cast "mask" to sf mask <- st_zm( if (is(mask, "sf") | is(mask, "sfc")) { st_sf(mask) @@ -304,9 +290,9 @@ gdal_warp <- function(srcfiles, } } - # cast to multipolygon + # save as cropping cutline file (if cutline must be applied) + dir.create(tmpdir, recursive=FALSE, showWarnings=FALSE) if (length(grep("POLYGON",st_geometry_type(mask)))>=1) { - dir.create(tmpdir, recursive=FALSE, showWarnings=FALSE) st_write( st_cast(mask, "MULTIPOLYGON"), mask_file <- file.path( @@ -314,19 +300,43 @@ gdal_warp <- function(srcfiles, ), quiet = TRUE ) - } # if not, mask_polygon is not created + } - # create mask_bbox if t_srs is specified; - # otherwise, create each time within srcfile cycle - if (!is.null(t_srs)) { - mask_bbox <- matrix( - st_bbox(st_transform(mask, t_srs)), - nrow=2, ncol=2, - dimnames=list(c("x","y"),c("min","max")) - ) + } + + # if "ref" is specified, read ref parameters + if (length(ref) > 0) { + + ref_metadata <- raster_metadata(ref, format = "list")[[1]] + ref_res <- ref_metadata$res + ref_size <- ref_metadata$size + t_srs <- ref_metadata$proj + ref_bbox <- ref_metadata$bbox + ref_offset <- ref_bbox %% ref_res + sel_of <- ifelse(is.null(of), ref_metadata$outformat, of) + + # round "tr" to ref grid + if (is.null(tr)) { + tr <- ref_res + } else { + tr <- ref_size*ref_res/round((ref_size*ref_res)/tr) + } + + # compute "te" + te <- if (is.null(mask)) { + ref_bbox + } else if ( + !inherits(mask, "logical") || inherits(mask, "logical") && !anyNA(mask) + ) { + te_1 <- st_bbox(st_transform(mask, t_srs)) + te_1 + c(0,0,ref_res) - (te_1-ref_offset) %% ref_res + } else { + NULL # define "sel_te" in the srcfile cycle } + } + # cycle on each srcfile for (i in seq_along(srcfiles)) { srcfile <- srcfiles[i] @@ -356,85 +366,16 @@ gdal_warp <- function(srcfiles, r } - # get reprojected extent - # (if already set it was referring to mask; in this case, to srcfile) - sel_src_bbox <- suppressMessages( - matrix( - st_bbox(st_transform(st_as_sfc(sel_bbox), sel_t_srs)), - nrow=2, ncol=2, - dimnames=list(c("x","y"),c("min","max")) - ) - ) - - # dimnames(sel_src_bbox) <- list(c("x","y"), c("min","max")) - - # set the correct bounding box for srcfile - if (is.null(ref)) { - if (is.null(mask)) { - # ref NULL & mask NULL: use bbox of srcfile, reprojected - sel_te <- sel_src_bbox - } else if (inherits(mask, "logical") && is.na(mask)) { # check if mask==NA - # ref NULL & mask NA: the same (use bbox of srcfile, reprojected) - sel_te <- sel_src_bbox - } else { - # ref NULL & mask provided: use bbox of mask, reprojected and aligned to src grid - sel_mask_bbox <- if (exists("mask_bbox")) { - mask_bbox - } else { - matrix( - st_bbox(st_transform(mask, sel_t_srs)), - nrow=2, ncol=2, - dimnames = list(c("x","y"), c("min","max")) - ) - } - if (sel_t_srs == sel_s_srs) { - sel_te <- (sel_mask_bbox - sel_ll) / sel_tr - sel_te <- cbind(floor(sel_te[,1]), ceiling(sel_te[,2])) - dimnames(sel_te) <- list(c("x","y"), c("min","max")) - sel_te <- sel_te * sel_tr + sel_ll - } else { - sel_te <- sel_mask_bbox - } - } - } else { - if (is.null(mask)) { - # ref provided & mask NULL: use bbox of ref - sel_te <- ref_bbox - } else if (inherits(mask, "logical") && is.na(mask)) { - # ref provided & mask NA: use bbox of srcfile (reprojected and aligned to ref grid) - if (sel_t_srs == sel_s_srs) { - sel_te <- (sel_src_bbox - ref_ll) / sel_tr - sel_te <- cbind(floor(sel_te[,1]), ceiling(sel_te[,2])) - dimnames(sel_te) <- list(c("x","y"),c("min","max")) - sel_te <- sel_te * sel_tr + ref_ll - } else { - sel_te <- sel_mask_bbox - } + if (length(ref) > 0) { + sel_te <- if (!is.null(te)) { + te } else { - # ref provided & mask provided: use bbox of mask (reprojected and aligned to ref grid) - sel_mask_bbox <- if (exists("mask_bbox")) { - mask_bbox - } else { - matrix( - st_bbox(st_transform(mask, sel_t_srs)), - nrow=2, ncol=2, - dimnames = list(c("x","y"), c("min","max")) - ) - } - if (sel_t_srs == sel_s_srs) { - sel_te <- (sel_mask_bbox - ref_ll) / sel_tr - sel_te <- cbind(floor(sel_te[,1]), ceiling(sel_te[,2])) - dimnames(sel_te) <- list(c("x","y"),c("min","max")) - sel_te <- sel_te * sel_tr + ref_ll - } else { - sel_te <- sel_mask_bbox - } + sel_te_1 <- st_bbox(st_transform(st_as_sfc(sel_bbox), sel_t_srs)) + sel_te_1 + c(0,0,ref_res) - (sel_te_1-ref_offset) %% ref_res } } - # finally, apply gdal_warp or gdal_translate - # temporary leave only gdal_warp to avoid some problems - # (e.g., translating a 1001x1001 20m to 10m results in 2002x2002 instead of 200[12]x200[12]) + # define CRS strings sel_s_srs_string <- if (!is.na(sel_s_srs$epsg)) { paste0("EPSG:",sel_s_srs$epsg) } else { @@ -456,18 +397,41 @@ gdal_warp <- function(srcfiles, sel_t_srs_path } + # Is cropping needed? + # if "ref" is defined, crop in the first step + # (this is possible because the output grid is known) + crop_in_step1 <- length(ref) > 0 + # if "res" not defined and "mask" is provided, crop in a separate step + # (this is required because the grid applied by gdalwarp is unknown) + crop_in_step2 <- !is.null(mask) && + (!inherits(mask, "logical") || inherits(mask, "logical") && !anyNA(mask)) && + length(ref) == 0 + + # first gdal_warp application (all except cropping) + if (crop_in_step2) { + step1_dstfile <- file.path( + tmpdir, + basename(tempfile(pattern = "warp_", fileext = ".vrt")) + ) + step1_of <- "VRT" + step1_co <- NULL + } else { + step1_dstfile <- dstfile + step1_of <- sel_of + step1_co <- co + } gdalUtil( "warp", source = srcfile, - destination = dstfile, + destination = step1_dstfile, options = c( "-s_srs", sel_s_srs_string, "-t_srs", sel_t_srs_string, - "-te", c(sel_te), + if (crop_in_step1) {c("-te", c(sel_te))}, if (exists("mask_file")) {c("-cutline", mask_file)}, if (!is.null(tr)) {c("-tr", as.vector(sel_tr))}, - if (!is.null(of)) {c("-of",as.vector(sel_of))}, - if (!is.null(co)) {unlist(lapply(co, function(x){c("-co", x)}))}, + if (!is.null(step1_of)) {c("-of",as.vector(step1_of))}, + if (!is.null(step1_co)) {unlist(lapply(step1_co, function(x){c("-co", x)}))}, "-r", sel_r, if (!is.null(sel_nodata)) { if (is.na(sel_nodata)) { @@ -481,6 +445,40 @@ gdal_warp <- function(srcfiles, quiet = TRUE ) + if (crop_in_step2) { + + # retrieve gdalwarp_path1 grid info + step1_metadata <- raster_metadata(step1_dstfile, format = "list")[[1]] + step1_res <- step1_metadata$res + step1_offset <- step1_metadata$bbox %% step1_res + + # get reprojected extent + sel_te_1 <- st_bbox(st_transform(mask, sel_t_srs)) + sel_te <- sel_te_1 + c(0,0,step1_res) - (sel_te_1-step1_offset) %% step1_res + + # final gdal_warp application (crop matching the out grid) + gdalUtil( + "warp", + source = step1_dstfile, + destination = dstfile, + options = c( + "-te", c(sel_te), + if (!is.null(of)) {c("-of",as.vector(sel_of))}, + if (!is.null(co)) {unlist(lapply(co, function(x){c("-co", x)}))}, + if (!is.null(sel_nodata)) { + if (is.na(sel_nodata)) { + c("-dstnodata", "None") + } else { + c("-dstnodata", sel_nodata) + } + }, + if (overwrite) {"-overwrite"} + ), + quiet = TRUE + ) + + } + } # end of overwrite IF cycle } diff --git a/R/gdalwarp_grid.R b/R/gdalwarp_grid.R index 4aae86df..00c967e2 100644 --- a/R/gdalwarp_grid.R +++ b/R/gdalwarp_grid.R @@ -19,9 +19,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @examples #' \donttest{ @@ -41,9 +40,11 @@ #' #' # Show output #' oldpar <- par(mfrow = c(1,3), mar = rep(0,4)) -#' image(stars::read_stars(ex_sel), rgb = 4:2, maxColorValue = 3500) -#' par(mar = rep(2/3,4)); image(stars::read_stars(ex_ref)) -#' par(mar = rep(0,4)); image(stars::read_stars(ex_out), rgb = 4:2, maxColorValue = 3500) +#' image(stars::read_stars(ex_sel), rgb = 4:2, maxColorValue = 3500, useRaster = TRUE) +#' par(mar = rep(2/3,4)) +#' image(stars::read_stars(ex_ref), useRaster = TRUE) +#' par(mar = rep(0,4)) +#' image(stars::read_stars(ex_out), rgb = 4:2, maxColorValue = 3500, useRaster = TRUE) #' par(oldpar) #' } diff --git a/R/gipp.R b/R/gipp.R index b76ff0f3..e288a05e 100644 --- a/R/gipp.R +++ b/R/gipp.R @@ -14,9 +14,8 @@ #' @author Luigi Ranghetti, phD (2020) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @examples #' \dontrun{ @@ -94,7 +93,7 @@ gipp_init <- function(gipp_sen2r_path = NA, force = FALSE, dem_warning = FALSE) "To use ESA-CCI data-package, download it at ", "http://maps.elie.ucl.ac.be/CCI/viewer/download.php and install it ", "(further information can be found at ", - "http://step.esa.int/main/third-party-plugins-2/sen2cor/)." + "http://step.esa.int/main/snap-supported-plugins/sen2cor/)." ) } @@ -132,9 +131,8 @@ gipp_init <- function(gipp_sen2r_path = NA, force = FALSE, dem_warning = FALSE) #' @author Luigi Ranghetti, phD (2020) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @export read_gipp <- function(gipp_names, gipp_path = NA) { diff --git a/R/give_write_permission.R b/R/give_write_permission.R index 86f94f40..790ae660 100644 --- a/R/give_write_permission.R +++ b/R/give_write_permission.R @@ -10,13 +10,12 @@ #' denied). #' @return Logical: if TRUE, R was authorised saving in the directory; #' if FALSE, it was not and a temporary directory is being used. -#' @author Lorenzo Busetto, phD (2019) \email{lbusett@@gmail.com} +#' @author Lorenzo Busetto, phD (2019) #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 give_write_permission <- function(agree = NA) { diff --git a/R/helpers_extent.R b/R/helpers_extent.R index 0fb83f4c..bd2fdb8c 100644 --- a/R/helpers_extent.R +++ b/R/helpers_extent.R @@ -4,9 +4,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @name load_extent_bbox diff --git a/R/ignorelist.R b/R/ignorelist.R index 03679105..d957327d 100644 --- a/R/ignorelist.R +++ b/R/ignorelist.R @@ -16,9 +16,8 @@ #' @author Luigi Ranghetti, phD (2020) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @name write_ignorelist diff --git a/R/init_python.R b/R/init_python.R index af565af0..b4bb8bca 100644 --- a/R/init_python.R +++ b/R/init_python.R @@ -5,9 +5,8 @@ #' @author Luigi Ranghetti, phD (2020) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 init_python <- function() { diff --git a/R/install_aria2.R b/R/install_aria2.R index 89fd92db..2e1eeb46 100644 --- a/R/install_aria2.R +++ b/R/install_aria2.R @@ -9,9 +9,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom httr RETRY write_disk progress #' @export diff --git a/R/install_sen2cor.R b/R/install_sen2cor.R index 4e4ee1a4..47472751 100644 --- a/R/install_sen2cor.R +++ b/R/install_sen2cor.R @@ -1,6 +1,6 @@ #' @title Download and install (or link) Sen2Cor #' @description [install_sen2cor()] downloads and installs a standalone version of -#' [Sen2Cor](http://step.esa.int/main/third-party-plugins-2/sen2cor/). +#' [Sen2Cor](http://step.esa.int/main/snap-supported-plugins/sen2cor/). #' @param sen2cor_dir Path where sen2cor will be installed or searched #' (by default it is a subdirectory `"sen2cor"` of the default sen2r directory). #' @param version (optional) Character: Sen2Cor version (one among @@ -12,9 +12,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom jsonlite toJSON fromJSON #' @importFrom utils download.file unzip @@ -220,7 +219,7 @@ install_sen2cor <- function( #' @name link_sen2cor #' @rdname install_sen2cor #' @description `link_sen2cor()` links an existing standalone version of -#' [Sen2Cor](http://step.esa.int/main/third-party-plugins-2/sen2cor/) to sen2r. +#' [Sen2Cor](http://step.esa.int/main/snap-supported-plugins/sen2cor/) to sen2r. #' @export link_sen2cor <- function(sen2cor_dir) { diff --git a/R/list_indices.R b/R/list_indices.R index 066f075f..0d9dbb8f 100644 --- a/R/list_indices.R +++ b/R/list_indices.R @@ -26,9 +26,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @examples #' # Show index names diff --git a/R/load_binpaths.R b/R/load_binpaths.R index 25fbb5cf..fc97b5ed 100644 --- a/R/load_binpaths.R +++ b/R/load_binpaths.R @@ -10,9 +10,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom jsonlite fromJSON #' @export @@ -34,7 +33,7 @@ load_binpaths <- function(bins = NULL) { # Define where the JSON with the paths is binpaths_file <- file.path( - if (dir.exists(normalize_path("~/.sen2r"))) { + if (dir.exists(normalize_path("~/.sen2r", mustWork = FALSE))) { normalize_path("~/.sen2r") } else { tempdir() diff --git a/R/mountpoint.R b/R/mountpoint.R index a29fe998..191f6592 100644 --- a/R/mountpoint.R +++ b/R/mountpoint.R @@ -14,9 +14,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @export diff --git a/R/nn.R b/R/nn.R index 82a2e3c9..a85563c6 100644 --- a/R/nn.R +++ b/R/nn.R @@ -6,9 +6,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' #' @examples diff --git a/R/path_check.R b/R/path_check.R index 2d4e3346..de354243 100644 --- a/R/path_check.R +++ b/R/path_check.R @@ -7,7 +7,7 @@ #' permissions #' @rdname path_check #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} -#' @author Lorenzo Busetto, PhD (2019) \email{lbusett@@gmail.com} +#' @author Lorenzo Busetto, PhD (2019) path_check <- function(path, mustbe_empty = FALSE, mustbe_writable = TRUE) { if (all(length(path)>0, path[1]!="")) { diff --git a/R/print_message.R b/R/print_message.R index 1397407f..41cae86c 100644 --- a/R/print_message.R +++ b/R/print_message.R @@ -39,9 +39,8 @@ #' @author Luigi Ranghetti, phD (2020) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 print_message <- function( diff --git a/R/projpar.R b/R/projpar.R index 9e59e1f2..191ae2a7 100644 --- a/R/projpar.R +++ b/R/projpar.R @@ -17,9 +17,8 @@ #' @author Luigi Ranghetti, phD (2020) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @export #' @importFrom sf st_as_text st_crs diff --git a/R/raster_metadata.R b/R/raster_metadata.R index 1065c198..22267834 100644 --- a/R/raster_metadata.R +++ b/R/raster_metadata.R @@ -11,9 +11,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @export #' @import data.table diff --git a/R/s2_calcindices.R b/R/s2_calcindices.R index 80383c61..e97f6951 100644 --- a/R/s2_calcindices.R +++ b/R/s2_calcindices.R @@ -90,9 +90,8 @@ #' @author Luigi Ranghetti, phD (2020) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @examples #' # Define file names @@ -112,8 +111,9 @@ #' #' # Show output #' oldpar <- par(mfrow = c(1,2), mar = rep(0,4)) -#' image(stars::read_stars(ex_in), rgb = 4:2, maxColorValue = 3500) -#' par(mar = rep(2/3,4)); image(stars::read_stars(ex_out)) +#' image(stars::read_stars(ex_in), rgb = 4:2, maxColorValue = 3500, useRaster = TRUE) +#' par(mar = rep(2/3,4)) +#' image(stars::read_stars(ex_out), useRaster = TRUE) #' par(oldpar) s2_calcindices <- function( diff --git a/R/s2_dop.R b/R/s2_dop.R index 752cca65..18c5a66d 100644 --- a/R/s2_dop.R +++ b/R/s2_dop.R @@ -29,9 +29,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @import data.table #' @importFrom jsonlite fromJSON diff --git a/R/s2_download.R b/R/s2_download.R index 76213893..4cb7a2f2 100644 --- a/R/s2_download.R +++ b/R/s2_download.R @@ -28,12 +28,11 @@ #' (being downloaded or already existing). #' #' @author Luigi Ranghetti, phD (2020) \email{luigi@@ranghetti.info} -#' @author Lorenzo Busetto, phD (2019) \email{lbusett@@gmail.com} +#' @author Lorenzo Busetto, phD (2019) #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom httr RETRY authenticate progress write_disk #' @importFrom foreach foreach "%do%" @@ -280,15 +279,15 @@ s2_download <- function( # )] # safe_existing <- list.files(dirname(zip_path), safe_regex, full.names = TRUE) # safe_existing <- safe_existing[safe_isvalid(safe_existing)] - - # if footprint exists, check if existing SAFEs are actually equivalent - if (!is.null(s2_meta$footprint)) { - safe_existing_footprint <- safe_getMetadata(safe_existing, "footprint") - safe_existing_centroid <- st_centroid(st_transform(st_as_sfc(safe_existing_footprint, crs = 4326), 3857)) - safe_centroid <- st_centroid(st_transform(st_as_sfc(s2_meta[i,footprint], crs = 4326), 3857)) - centroid_distance <- st_distance(safe_existing_centroid, safe_centroid)[1,1] - # TODO - } + # + # # if footprint exists, check if existing SAFEs are actually equivalent + # if (!is.null(s2_meta$footprint)) { + # safe_existing_footprint <- safe_getMetadata(safe_existing, "footprint") + # safe_existing_centroid <- st_centroid(st_transform(st_as_sfc(safe_existing_footprint, crs = 4326), 3857)) + # safe_centroid <- st_centroid(st_transform(st_as_sfc(s2_meta[i,footprint], crs = 4326), 3857)) + # centroid_distance <- st_distance(safe_existing_centroid, safe_centroid)[1,1] + # # TODO + # } if (any(overwrite == TRUE, !dir.exists(safe_path))) { diff --git a/R/s2_gui.R b/R/s2_gui.R index de641581..da5cc72d 100644 --- a/R/s2_gui.R +++ b/R/s2_gui.R @@ -9,9 +9,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom jsonlite fromJSON toJSON #' @import data.table @@ -3112,7 +3111,7 @@ s2_gui <- function(param_list = NULL, title = "Method to obtain level-2A corrected images", p(HTML( "Note: this selector is active only if", - "Sen2Cor was installed and configured;", "to do it, run check_sen2r_deps()." )), diff --git a/R/s2_list.R b/R/s2_list.R index d57502b7..4623b50f 100644 --- a/R/s2_list.R +++ b/R/s2_list.R @@ -49,15 +49,14 @@ #' `availability != "ignore"`, values are TRUE / FALSE for #' products available for download / stored in the Long Term Archive; #' otherwise, values are set to NA. -#' @author Lorenzo Busetto, phD (2019) \email{lbusett@@gmail.com} - Inspired by +#' @author Lorenzo Busetto, phD (2019) - Inspired by #' function `getSentinel_query` of package #' [`getSpatialData`](https://github.com/16EAGLE/getSpatialData) by J. Schwalb-Willmann #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @import data.table #' @importFrom methods is @@ -161,7 +160,7 @@ s2_list <- function(spatial_extent = NULL, # to avoid NOTE on check . <- online <- id_tile <- id_orbit <- - sensing_datetime <- ingestion_datetime <- NULL + sensing_datetime <- ingestion_datetime <- centroid <- footprint <- NULL # convert input NA arguments in NULL for (a in c("spatial_extent","tile","orbit","time_interval","apihub")) { diff --git a/R/s2_mask.R b/R/s2_mask.R index 1720ba23..c22718cf 100644 --- a/R/s2_mask.R +++ b/R/s2_mask.R @@ -122,9 +122,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @examples #' \donttest{ @@ -149,9 +148,12 @@ #' #' # Show output #' oldpar <- par(mfrow = c(1,3)) -#' par(mar = rep(0,4)); image(stars::read_stars(ex_in), rgb = 1:3) -#' par(mar = rep(2/3,4)); image(stars::read_stars(ex_mask)) -#' par(mar = rep(0,4)); image(stars::read_stars(ex_out), rgb = 1:3) +#' par(mar = rep(0,4)) +#' image(stars::read_stars(ex_in), rgb = 1:3, useRaster = TRUE) +#' par(mar = rep(2/3,4)) +#' image(stars::read_stars(ex_mask), useRaster = TRUE) +#' par(mar = rep(0,4)) +#' image(stars::read_stars(ex_out), rgb = 1:3, useRaster = TRUE) #' par(oldpar) #' } diff --git a/R/s2_merge.R b/R/s2_merge.R index dc99936b..bfd87efd 100644 --- a/R/s2_merge.R +++ b/R/s2_merge.R @@ -62,9 +62,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 diff --git a/R/s2_order.R b/R/s2_order.R index 8f154dca..26dc8dd3 100644 --- a/R/s2_order.R +++ b/R/s2_order.R @@ -38,12 +38,11 @@ #' and not ordered) was saved (if `export_prodlist = TRUE`). #' #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} -#' @author Lorenzo Busetto, phD (2020) \email{lbusett@@gmail.com} +#' @author Lorenzo Busetto, phD (2020) #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom httr RETRY authenticate #' @importFrom foreach foreach "%do%" diff --git a/R/s2_rgb.R b/R/s2_rgb.R index 36ef4062..6f181fb7 100644 --- a/R/s2_rgb.R +++ b/R/s2_rgb.R @@ -65,9 +65,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @import data.table #' @importFrom foreach foreach "%do%" "%dopar%" @@ -95,9 +94,9 @@ #' #' # Show output #' oldpar <- par(mfrow = c(1,3), mar = rep(0,4)) -#' image(stars::read_stars(ex_in), rgb = 4:2, maxColorValue = 3500) -#' image(stars::read_stars(ex_out[1]), rgb = 1:3) -#' image(stars::read_stars(ex_out[2]), rgb = 1:3) +#' image(stars::read_stars(ex_in), rgb = 4:2, maxColorValue = 3500, useRaster = TRUE) +#' image(stars::read_stars(ex_out[1]), rgb = 1:3, useRaster = TRUE) +#' image(stars::read_stars(ex_out[2]), rgb = 1:3, useRaster = TRUE) #' par(oldpar) #' } diff --git a/R/s2_thumbnails.R b/R/s2_thumbnails.R index adc5923f..5f4b8c90 100644 --- a/R/s2_thumbnails.R +++ b/R/s2_thumbnails.R @@ -42,9 +42,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom raster raster #' @importFrom jsonlite fromJSON @@ -287,9 +286,8 @@ stack2rgb <- function(in_rast, #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom raster raster #' @importFrom jsonlite fromJSON @@ -462,9 +460,8 @@ raster2rgb <- function(in_rast, #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @import data.table #' @importFrom jsonlite fromJSON diff --git a/R/s2_tiles.R b/R/s2_tiles.R index 57ce3329..88b50367 100644 --- a/R/s2_tiles.R +++ b/R/s2_tiles.R @@ -10,9 +10,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @examples #' # Retrieve all the tiles diff --git a/R/s2_translate.R b/R/s2_translate.R index 898d3303..86c6c559 100644 --- a/R/s2_translate.R +++ b/R/s2_translate.R @@ -56,9 +56,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom jsonlite fromJSON #' @export diff --git a/R/safe_getMetadata.R b/R/safe_getMetadata.R index e2eb7674..65df3e21 100644 --- a/R/safe_getMetadata.R +++ b/R/safe_getMetadata.R @@ -86,9 +86,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @export #' @import data.table diff --git a/R/safe_is_online.R b/R/safe_is_online.R index d3f9811a..17237080 100644 --- a/R/safe_is_online.R +++ b/R/safe_is_online.R @@ -16,12 +16,11 @@ #' available for download, FALSE if it is not or NA in case of errors with #' the SAFE url. #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} -#' @author Lorenzo Busetto, phD (2020) \email{lbusett@@gmail.com} +#' @author Lorenzo Busetto, phD (2020) #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom httr RETRY authenticate content #' @importFrom jsonlite fromJSON diff --git a/R/safe_shortname.R b/R/safe_shortname.R index cb998b07..4f7b9859 100644 --- a/R/safe_shortname.R +++ b/R/safe_shortname.R @@ -62,9 +62,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @export diff --git a/R/safelist-class.R b/R/safelist-class.R index a1a05e45..80cc6896 100644 --- a/R/safelist-class.R +++ b/R/safelist-class.R @@ -23,9 +23,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @examples #' \donttest{ diff --git a/R/scihub_login.R b/R/scihub_login.R index 65b852f7..c94624bc 100644 --- a/R/scihub_login.R +++ b/R/scihub_login.R @@ -19,9 +19,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' #' @examples @@ -66,7 +65,7 @@ read_scihub_login <- function(apihub_path=NA) { #' @return `check_scihub_login` returns TRUE if credentials are valid, #' FALSE elsewhere. #' @importFrom httr RETRY authenticate handle -#' @author Lorenzo Busetto, phD (2019) \email{lbusett@@gmail.com} +#' @author Lorenzo Busetto, phD (2019) #' @rdname scihub_login #' @export diff --git a/R/sen2cor.R b/R/sen2cor.R index ca014be5..dd09364e 100644 --- a/R/sen2cor.R +++ b/R/sen2cor.R @@ -1,7 +1,7 @@ #' @title Correct L1C products using Sen2Cor #' @description The function uses Sen2Cor to manually correct L1C products. #' Standalone version of -#' [sen2cor](http://step.esa.int/main/third-party-plugins-2/sen2cor/) +#' [sen2cor](http://step.esa.int/main/snap-supported-plugins/sen2cor/) #' (version 2.8.0 or 2.5.5) is used. #' @param l1c_prodlist List of L1C product names to be corrected. They can be both #' product names with full/relative path or only names of SAFE products (in this case, also @@ -38,8 +38,8 @@ #' to maintain the value specified in the XML file). #' #' For details about the GIPP parameters, refer to the Sen2Cor documentation -#' (v. [2.5.5](http://step.esa.int/main/third-party-plugins-2/sen2cor/sen2cor_v2-5-5/) -#' or [2.8.0](http://step.esa.int/main/third-party-plugins-2/sen2cor/sen2cor_v2-8/): +#' (v. [2.5.5](http://step.esa.int/main/snap-supported-plugins/sen2cor/sen2cor_v2-5-5/) +#' or [2.8.0](http://step.esa.int/main/snap-supported-plugins/sen2cor/sen2cor_v2-8/): #' see the "Schemas of the GIPP file" at the end of each page). #' _Note_: this argument takes effect only in the current execution of #' `sen2cor()` function. @@ -102,9 +102,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom jsonlite fromJSON #' @importFrom doParallel registerDoParallel diff --git a/R/sen2r.R b/R/sen2r.R index 56d5d074..94ee250b 100644 --- a/R/sen2r.R +++ b/R/sen2r.R @@ -327,12 +327,11 @@ #' @importFrom stats na.omit setNames #' @export #' @author Luigi Ranghetti, phD (2020) \email{luigi@@ranghetti.info} -#' @author Lorenzo Busetto, phD (2020) \email{lbusett@@gmail.com} +#' @author Lorenzo Busetto, phD (2020) #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @examples #' \donttest{ @@ -390,28 +389,28 @@ #' gsub("jpg$", "png", thumb_4[grep("SCL", thumb_4)]) #' #' oldpar <- par(mfrow = c(1,2), mar = rep(0,4)) -#' image(stars::read_stars(thumb_3[grep("BOA", thumb_3)]), rgb = 1:3) -#' image(stars::read_stars(thumb_3[grep("SCL", thumb_3)]), rgb = 1:3) +#' image(stars::read_stars(thumb_3[grep("BOA", thumb_3)]), rgb = 1:3, useRaster = TRUE) +#' image(stars::read_stars(thumb_3[grep("SCL", thumb_3)]), rgb = 1:3, useRaster = TRUE) #' #' par(mfrow = c(1,2), mar = rep(0,4)) -#' image(stars::read_stars(thumb_3[grep("MSAVI2", thumb_3)]), rgb = 1:3) -#' image(stars::read_stars(thumb_3[grep("NDVI", thumb_3)]), rgb = 1:3) +#' image(stars::read_stars(thumb_3[grep("MSAVI2", thumb_3)]), rgb = 1:3, useRaster = TRUE) +#' image(stars::read_stars(thumb_3[grep("NDVI", thumb_3)]), rgb = 1:3, useRaster = TRUE) #' #' par(mfrow = c(1,2), mar = rep(0,4)) -#' image(stars::read_stars(thumb_3[grep("RGB432B", thumb_3)]), rgb = 1:3) -#' image(stars::read_stars(thumb_3[grep("RGB843B", thumb_3)]), rgb = 1:3) +#' image(stars::read_stars(thumb_3[grep("RGB432B", thumb_3)]), rgb = 1:3, useRaster = TRUE) +#' image(stars::read_stars(thumb_3[grep("RGB843B", thumb_3)]), rgb = 1:3, useRaster = TRUE) #' #' par(mfrow = c(1,2), mar = rep(0,4)) -#' image(stars::read_stars(thumb_4[grep("BOA", thumb_4)]), rgb = 1:3) -#' image(stars::read_stars(thumb_4[grep("SCL", thumb_4)]), rgb = 1:3) +#' image(stars::read_stars(thumb_4[grep("BOA", thumb_4)]), rgb = 1:3, useRaster = TRUE) +#' image(stars::read_stars(thumb_4[grep("SCL", thumb_4)]), rgb = 1:3, useRaster = TRUE) #' #' par(mfrow = c(1,2), mar = rep(0,4)) -#' image(stars::read_stars(thumb_4[grep("MSAVI2", thumb_4)]), rgb = 1:3) -#' image(stars::read_stars(thumb_4[grep("NDVI", thumb_4)]), rgb = 1:3) +#' image(stars::read_stars(thumb_4[grep("MSAVI2", thumb_4)]), rgb = 1:3, useRaster = TRUE) +#' image(stars::read_stars(thumb_4[grep("NDVI", thumb_4)]), rgb = 1:3, useRaster = TRUE) #' #' par(mfrow = c(1,2), mar = rep(0,4)) -#' image(stars::read_stars(thumb_4[grep("RGB432B", thumb_4)]), rgb = 1:3) -#' image(stars::read_stars(thumb_4[grep("RGB843B", thumb_4)]), rgb = 1:3) +#' image(stars::read_stars(thumb_4[grep("RGB432B", thumb_4)]), rgb = 1:3, useRaster = TRUE) +#' image(stars::read_stars(thumb_4[grep("RGB843B", thumb_4)]), rgb = 1:3, useRaster = TRUE) #' #' par(oldpar) #' } @@ -667,7 +666,9 @@ sen2r <- function(param_list = NULL, # to avoid NOTE on check . <- sensing_datetime <- creation_datetime <- mission <- level <- id_orbit <- id_tile <- name <- id_baseline <- prod_type <- name <- sel_group_A <- - i_group_A <- sel_apihub_path <- i_group_B <- sensing_date <- lta <- NULL + i_group_A <- sel_apihub_path <- i_group_B <- sensing_date <- lta <- + centroid_x <- centroid_y <- res_type <-path <- footprint <- sel_out <- + NULL ### Preliminary settings ### @@ -1559,6 +1560,21 @@ sen2r <- function(param_list = NULL, return(sen2r_output) } + ## determine the output grid (this will be used later) + exi_meta <- cbind( + sen2r_getElements(unlist(s2names$exi[c("indices","rgb","masked","warped_nomsk","warped")])), + data.frame(path=unlist(s2names$exi[c("indices","rgb","masked","warped_nomsk","warped")])) + # raster_metadata(unlist(s2names$exi[c("indices","rgb","masked","warped_nomsk","warped")])) + ) + # res_type: "res20" if the minimum native resolution is 20m, "res10" if it is 10m + exi_meta[,res_type:=ifelse(prod_type %in% c("SCL","CLD","SNW"), "res20", "res10")] + reference_exi_paths <- if (nrow(exi_meta)>0) { + exi_meta[!duplicated(res_type),list(res_type,path)] + } else { + data.table(res_type = character(0), path = character(0)) + } + + ### SAFE processing: download and atmospheric correction ### ## Generate the list of required SAFE @@ -2425,7 +2441,17 @@ sen2r <- function(param_list = NULL, sel_s2names$req$warped[[sel_prod]], warped_tomsk_reqout[[sel_prod]], of = out_format["warped"], - ref = if (!is.na(pm$reference_path)) {pm$reference_path} else {NULL}, + ref = if (!is.na(pm$reference_path)) { + pm$reference_path + } else { + reference_exi_paths[ + res_type == ifelse( + sel_prod %in% c("SCL","CLD","SNW"), + "res20", "res10" + ), + path + ] + }, mask = s2_mask_extent, tr = if (!anyNA(pm$res)) {pm$res} else {NULL}, t_srs = if (!is.na(pm$proj)){pm$proj} else {NULL}, @@ -2464,7 +2490,17 @@ sen2r <- function(param_list = NULL, sel_s2names$req$warped_nomsk[[sel_prod]], warped_nomsk_reqout[[sel_prod]], of = out_format["warped_nomsk"], # use physical files to speed up next steps - ref = if (!is.na(pm$reference_path)) {pm$reference_path} else {NULL}, + ref = if (!is.na(pm$reference_path)) { + pm$reference_path + } else { + reference_exi_paths[ + res_type == ifelse( + sel_prod %in% c("SCL","CLD","SNW"), + "res20", "res10" + ), + path + ] + }, mask = s2_mask_extent, tr = if (!anyNA(pm$res)) {pm$res} else {NULL}, t_srs = if (!is.na(pm$proj)) {pm$proj} else {NULL}, diff --git a/R/sen2r_getElements.R b/R/sen2r_getElements.R index cf992a6e..7a8da78b 100644 --- a/R/sen2r_getElements.R +++ b/R/sen2r_getElements.R @@ -13,9 +13,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @export #' @import data.table diff --git a/R/sen2r_process_report.R b/R/sen2r_process_report.R index 66435eb6..4bff2ddd 100644 --- a/R/sen2r_process_report.R +++ b/R/sen2r_process_report.R @@ -39,12 +39,11 @@ #' - `n_corrected`: number of images atmospherically corrected using sen2cor; #' - `completed`: logical, indicating if processing can be considered #' "complete" (it is set to TRUE in case `n_notonline_dates = 0`). -#' @author Lorenzo Busetto, phD (2020) \email{lbusett@@gmail.com} +#' @author Lorenzo Busetto, phD (2020) #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 diff --git a/R/smooth_mask.R b/R/smooth_mask.R index d49ba750..05e0f4fd 100644 --- a/R/smooth_mask.R +++ b/R/smooth_mask.R @@ -24,9 +24,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 smooth_mask <- function( diff --git a/R/st_as_text_2.R b/R/st_as_text_2.R index b172a621..66781e0b 100644 --- a/R/st_as_text_2.R +++ b/R/st_as_text_2.R @@ -18,22 +18,22 @@ #' sen2r:::st_as_text_2(sf::st_crs(32632)) st_as_text_2 <- function(x, pretty = FALSE) { - if ( - package_version(sf_extSoftVersion()["proj.4"]) >= 6 && - requireNamespace("rgdal", quietly = TRUE) && - packageVersion("rgdal") >= 1.5 - ) { - x_crs <- st_crs(x) - x_proj <- if (is.na(x_crs$epsg)) { - x_crs$proj4string - } else { - paste0("EPSG:",x_crs$epsg) - } - srid_multiline <- if (pretty == TRUE) {"YES"} else {"NO"} - eval(parse( - text = "rgdal::showSRID(x_proj, format = 'WKT2', multiline = srid_multiline)" - )) - } else { + # if ( + # package_version(sf_extSoftVersion()["proj.4"]) >= 6 && + # requireNamespace("rgdal", quietly = TRUE) && + # packageVersion("rgdal") >= 1.5 + # ) { + # x_crs <- st_crs(x) + # x_proj <- if (is.na(x_crs$epsg)) { + # x_crs$proj4string + # } else { + # paste0("EPSG:",x_crs$epsg) + # } + # srid_multiline <- if (pretty == TRUE) {"YES"} else {"NO"} + # eval(parse( + # text = "rgdal::showSRID(x_proj, format = 'WKT2', multiline = srid_multiline)" + # )) + # } else { st_as_text(x, pretty = pretty) - } + # } } diff --git a/R/st_crs2.R b/R/st_crs2.R index 06f755b9..762370d8 100644 --- a/R/st_crs2.R +++ b/R/st_crs2.R @@ -29,9 +29,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @examples #' ## CRS from EPSG diff --git a/R/str_pad2.R b/R/str_pad2.R index 638c7b03..f0d0071c 100644 --- a/R/str_pad2.R +++ b/R/str_pad2.R @@ -12,9 +12,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @export #' @examples diff --git a/R/tiles_intersects.R b/R/tiles_intersects.R index 1a9817f0..c4f745b7 100644 --- a/R/tiles_intersects.R +++ b/R/tiles_intersects.R @@ -21,9 +21,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @examples #' ex_extent <- sf::st_read( diff --git a/R/trace_functions.R b/R/trace_functions.R index 0a4ea7d1..26313ab7 100644 --- a/R/trace_functions.R +++ b/R/trace_functions.R @@ -36,9 +36,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom methods is diff --git a/README.Rmd b/README.Rmd index 3555b105..9e836c26 100644 --- a/README.Rmd +++ b/README.Rmd @@ -74,7 +74,7 @@ was published on the ISI journal *Computers \& Geosciences*; the manuscript is a 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: 10.1016/j.cageo.2020.104473, +doi: 10.1016/j.cageo.2020.104473, URL: http://sen2r.ranghetti.info . @@ -142,8 +142,8 @@ This is a list of the principal processing functions to download Sentinel-2 products; * [`s2_order()`](http://sen2r.ranghetti.info/reference/s2_order.html) to order products from the Long Term Archive; -* [`sen2cor()`](reference/sen2cor.html) - to correct level-1C products using [Sen2Cor](http://step.esa.int/main/third-party-plugins-2/sen2cor/); +* [`sen2cor()`](http://sen2r.ranghetti.info/reference/sen2cor.html) + to correct level-1C products using [Sen2Cor](http://step.esa.int/main/snap-supported-plugins/sen2cor/); * [`s2_mask()`](http://sen2r.ranghetti.info/reference/s2_mask.html) to apply a cloud mask to Sentinel-2 products; * [`s2_rgb()`](http://sen2r.ranghetti.info/reference/s2_rgb.html) @@ -170,7 +170,7 @@ 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: 10.1016/j.cageo.2020.104473, +doi: 10.1016/j.cageo.2020.104473, URL: http://sen2r.ranghetti.info. ```bibtex diff --git a/README.md b/README.md index d9c9a3f8..71762f13 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ - +- [sen2r: Find, Download and Process Sentinel-2 + Data](#sen2r-find-download-and-process-sentinel-2-data) + - [Installation](#installation) + - [Usage](#usage) + - [Credits](#credits) + - [Contributing](#contributing) + [![CRAN @@ -23,7 +29,10 @@ Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff6 # sen2r: Find, Download and Process Sentinel-2 Data -sen2r +sen2r 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 @@ -31,28 +40,32 @@ 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, -sen2r +In particular, sen2r allows to: - - retrieve the list of available products on a selected area (which +- 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 +- 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 +- 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 +- mask cloudy pixels (using the Surface Classification Map as masking layer); - - computing spectral indices and RGB images. +- computing spectral indices and RGB images. Setting the execution of this processing chain is particularly easy -using the -sen2r +using the sen2r 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. @@ -63,21 +76,22 @@ 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)). +(see [usage](#usage)). -sen2r +sen2r was published on the ISI journal *Computers & Geosciences*; the -manuscript is available -here: +manuscript is available here: 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: 10.1016/j.cageo.2020.104473, URL: +Geosciences, 139, 104473. doi: 10.1016/j.cageo.2020.104473, URL: http://sen2r.ranghetti.info . Users which processed Sentinel-2 data and used them for a scientific @@ -97,16 +111,20 @@ dependencies), see the [Installation](http://sen2r.ranghetti.info/articles/installation.html) page. -A dockerised version of -sen2r +A dockerised version of sen2r is available [here](https://hub.docker.com/r/ranghetti/sen2r). For detailed instructions about using it, see the page [“Run in a Docker container”](http://sen2r.ranghetti.info/articles/docker.html). ## Usage -The simplest way to use -sen2r +The simplest way to use sen2r is to execute it in interactive mode (see [this vignette](http://sen2r.ranghetti.info/articles/sen2r_gui.html)): @@ -116,7 +134,6 @@ sen2r() ```

- @@ -127,7 +144,6 @@ sen2r() -

Alternatively, @@ -142,23 +158,22 @@ 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()`](http://sen2r.ranghetti.info/reference/s2_list.html) to +- [`s2_list()`](http://sen2r.ranghetti.info/reference/s2_list.html) to retrieve the list of available Sentinel-2 products based on input parameters; - - [`s2_download()`](http://sen2r.ranghetti.info/reference/s2_download.html) +- [`s2_download()`](http://sen2r.ranghetti.info/reference/s2_download.html) to download Sentinel-2 products; - - [`s2_order()`](http://sen2r.ranghetti.info/reference/s2_order.html) +- [`s2_order()`](http://sen2r.ranghetti.info/reference/s2_order.html) to order products from the Long Term Archive; - - [`sen2cor()`](reference/sen2cor.html) to correct level-1C products - using - [Sen2Cor](http://step.esa.int/main/third-party-plugins-2/sen2cor/); - - [`s2_mask()`](http://sen2r.ranghetti.info/reference/s2_mask.html) to +- [`sen2cor()`](http://sen2r.ranghetti.info/reference/sen2cor.html) to + correct level-1C products using + [Sen2Cor](http://step.esa.int/main/snap-supported-plugins/sen2cor/); +- [`s2_mask()`](http://sen2r.ranghetti.info/reference/s2_mask.html) to apply a cloud mask to Sentinel-2 products; - - [`s2_rgb()`](http://sen2r.ranghetti.info/reference/s2_rgb.html) to +- [`s2_rgb()`](http://sen2r.ranghetti.info/reference/s2_rgb.html) to generate RGB images from Sentinel-2 Surface Reflectance multiband - raster - files; - - [`s2_calcindices()`](http://sen2r.ranghetti.info/reference/s2_calcindices.html) + raster files; +- [`s2_calcindices()`](http://sen2r.ranghetti.info/reference/s2_calcindices.html) to compute maps of spectral indices from Sentinel-2 Surface Reflectance multiband raster files. @@ -170,14 +185,19 @@ details). -sen2r +sen2r 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). +General Public License version +3](https://www.gnu.org/licenses/gpl-3.0.html) (GPL‑3). -The -[sen2r +The [sen2r logo](https://github.com/ranghetti/sen2r/raw/master/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 @@ -188,7 +208,7 @@ 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: +satellite data”**. *Computers & Geosciences*, 139, 104473. doi: 10.1016/j.cageo.2020.104473, URL: http://sen2r.ranghetti.info. diff --git a/cran-comments.md b/cran-comments.md index d8bd0a84..83b6f64d 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,11 +1,20 @@ -# sen2r v. 1.3.9 +# sen2r v. 1.4.0 ## Test environments -* [local installation] Ubuntu 18.04, 64 bit, R 3.6.3 -* [local installation] Archlinux, 64 bit, R 4.0.2 -* [local installation] Windows 10, 64 bit, R 3.6.3 -* [travis-ci] Ubuntu 16.04.6 LTS, 64 bit, R unstable, 4.0.0 and 3.6.3 (devel, release and oldrelease) -* [win-builder] R unstable, 4.0.2 and 3.6.3 (devel, release and oldrelease) +* [local installation] Ubuntu 18.04, 64 bit, R 4.0.3 +* [local installation] Archlinux, 64 bit, R 4.0.3 +* [local installation] Windows 10, 64 bit, R 4.0.3 +* [win-builder] R unstable, 4.0.3 and 3.6.3 (devel, release and oldrelease) ## R CMD check results There were no ERRORs, WARNINGs or NOTEs. + + +## CRAN review +> The auto-check found additional issues for the *last* version released on CRAN: + M1mac +CRAN incoming checks do not test for these additional issues and you will need +an appropriately instrumented build of R to reproduce these. +Hence please reply-all and explain: Have these been fixed? + +All the errors found in M1mac were fixed (see the NEWS.md file for details). diff --git a/docs/404.html b/docs/404.html index 2df9b140..c7c721db 100644 --- a/docs/404.html +++ b/docs/404.html @@ -71,7 +71,7 @@ sen2r - 1.3.9 + 1.4.0 diff --git a/docs/CODE-OF-CONDUCT.html b/docs/CODE-OF-CONDUCT.html index 54d3a19e..3243a210 100644 --- a/docs/CODE-OF-CONDUCT.html +++ b/docs/CODE-OF-CONDUCT.html @@ -71,7 +71,7 @@ sen2r - 1.3.9 + 1.4.0 diff --git a/docs/ISSUE_TEMPLATE.html b/docs/ISSUE_TEMPLATE.html new file mode 100644 index 00000000..3555e7c5 --- /dev/null +++ b/docs/ISSUE_TEMPLATE.html @@ -0,0 +1,189 @@ + + + + + + + + + • sen2r + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + + + +
+ + + +
+ + + +
+ + +
+

Site built with pkgdown 1.6.1.

+
+ +
+
+ + + + + + + + diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 83cd6e2e..4949052f 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -71,7 +71,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -351,27 +351,27 @@

How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.

-
<one line to give the program's name and a brief idea of what it does.>
-Copyright (C) 2019 Luigi Ranghetti, Lorenzo Busetto
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
<one line to give the program's name and a brief idea of what it does.>
+Copyright (C) 2019 Luigi Ranghetti, Lorenzo Busetto
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:

-
sen2r Copyright (C) 2019 Luigi Ranghetti, Lorenzo Busetto
-This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
-This is free software, and you are welcome to redistribute it
-under certain conditions; type 'show c' for details.
+
sen2r Copyright (C) 2019 Luigi Ranghetti, Lorenzo Busetto
+This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type 'show c' for details.

The hypothetical commands show w and show c should show the appropriate parts of the General Public License. Of course, your program’s commands might be different; for a GUI interface, you would use an “about box”.

You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.

diff --git a/docs/articles/docker.html b/docs/articles/docker.html index fb5b2058..decc9103 100644 --- a/docs/articles/docker.html +++ b/docs/articles/docker.html @@ -31,7 +31,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -106,7 +106,8 @@ -
+ +
diff --git a/docs/articles/docker_files/anchor-sections-1.0/anchor-sections.css b/docs/articles/docker_files/anchor-sections-1.0/anchor-sections.css new file mode 100644 index 00000000..07aee5fc --- /dev/null +++ b/docs/articles/docker_files/anchor-sections-1.0/anchor-sections.css @@ -0,0 +1,4 @@ +/* Styles for section anchors */ +a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} +a.anchor-section::before {content: '#';} +.hasAnchor:hover a.anchor-section {visibility: visible;} diff --git a/docs/articles/docker_files/anchor-sections-1.0/anchor-sections.js b/docs/articles/docker_files/anchor-sections-1.0/anchor-sections.js new file mode 100644 index 00000000..570f99a0 --- /dev/null +++ b/docs/articles/docker_files/anchor-sections-1.0/anchor-sections.js @@ -0,0 +1,33 @@ +// Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020. +document.addEventListener('DOMContentLoaded', function() { + // Do nothing if AnchorJS is used + if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) { + return; + } + + const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); + + // Do nothing if sections are already anchored + if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) { + return null; + } + + // Use section id when pandoc runs with --section-divs + const section_id = function(x) { + return ((x.classList.contains('section') || (x.tagName === 'SECTION')) + ? x.id : ''); + }; + + // Add anchors + h.forEach(function(x) { + const id = x.id || section_id(x.parentElement); + if (id === '') { + return null; + } + let anchor = document.createElement('a'); + anchor.href = '#' + id; + anchor.classList = ['anchor-section']; + x.classList.add('hasAnchor'); + x.appendChild(anchor); + }); +}); diff --git a/docs/articles/docker_files/header-attrs-2.5/header-attrs.js b/docs/articles/docker_files/header-attrs-2.5/header-attrs.js new file mode 100644 index 00000000..dd57d92e --- /dev/null +++ b/docs/articles/docker_files/header-attrs-2.5/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/index.html b/docs/articles/index.html index 7085fdce..22370713 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -71,7 +71,7 @@ sen2r - 1.3.9 + 1.4.0
diff --git a/docs/articles/installation.html b/docs/articles/installation.html index 0035bdf7..bc3a40e0 100644 --- a/docs/articles/installation.html +++ b/docs/articles/installation.html @@ -31,7 +31,7 @@ sen2r - 1.3.9 + 1.4.0
@@ -106,7 +106,8 @@ -
+ +
@@ -250,23 +251,23 @@

On Windows

R must be installed before proceeding.

In the case it was already installed, it is suggested to update the existing R packages:

-
-update.packages(ask = FALSE)
+
+update.packages(ask = FALSE)

sen2r can be installed from CRAN:

- +

Alternatively, the development version can be installed from GitHub with the R package remotes. To do it:

  1. install the package remotes, if missing:

    -
    -install.packages("remotes")
    +
    +install.packages("remotes")
  2. load it and install sen2r:

    -
    -library(remotes)
    -install_github("ranghetti/sen2r")
    +
    +library(remotes)
    +install_github("ranghetti/sen2r")

This will install the R package along with its package dependencies, containing all the functions necessary to preprocess data.

@@ -276,27 +277,27 @@

On MacOS

R must be installed before proceeding.

In the case it was already installed, it is suggested to update the existing R packages:

-
-update.packages(ask = FALSE)
+
+update.packages(ask = FALSE)

Packages can be installed using the compiled binaries, except from sp, sf, rgdal and rgeos, which are recommended to be compiled. To do it, use the command

-
-install.packages(c("sp", "sf", "rgdal", "rgeos"), type = "source")
+
+install.packages(c("sp", "sf", "rgdal", "rgeos"), type = "source")

after having installed GDAL as described above.

sen2r can be installed from CRAN:

- +

Alternatively, the development version can be installed from GitHub with the R package remotes. To do it:

  1. install the package remotes, if missing:

    -
    -install.packages("remotes")
    +
    +install.packages("remotes")
  2. load it and install sen2r:

    -
    -library(remotes)
    -install_github("ranghetti/sen2r")
    +
    +library(remotes)
    +install_github("ranghetti/sen2r")

This will install the R package along with its package dependencies, containing all the functions necessary to preprocess data.

@@ -304,15 +305,15 @@

Installing Sen2Cor

-

Sen2Cor is used to perform atmospheric correction of Sentinel-2 Level-1C products, so its installation can be skipped in case this function is not required by the user (using only Level-1C – TOA products or downloading directly Level-2A products).

+

Sen2Cor is used to perform atmospheric correction of Sentinel-2 Level-1C products, so its installation can be skipped in case this function is not required by the user (using only Level-1C – TOA products or downloading directly Level-2A products).

It can be graphically checked / installed launching the function

- +

This function opens a GUI which help to check if this and other dependencies are satisfied; from this GUI a new Sen2Cor installation can be performed, or an existing environment can be linked to Sen2Cor.

Alternatively, it can be installed from the command line with the following function:

- +

@@ -325,13 +326,13 @@

aria2 is an alternative downloader which can be used to faster the download of SAFE archives; it can be optionally installed and used. Since the number of concurrent downloads from ESA SciHub is limited to 2, the use of aria2 is generally not faster than the default downloader; for this reason, its use is recommended only in case of problems with the default downloader.

These dependences can be graphically checked launching the function

- +

Alternatively, they can be installed individually from the command line with the following functions (see their respective references for further details):

- +

Note on GDAL installation on MacOS

@@ -339,13 +340,13 @@

  1. if Homebrew is missing on your system, install it opening a terminal and typing:

    -
    /usr/bin/ruby -e "$(curl -fsSL https://github.com/Homebrew/install/raw/master/install)"
    +
    /usr/bin/ruby -e "$(curl -fsSL https://github.com/Homebrew/install/raw/master/install)"

    (see the Homebrew webpage for details);

  2. install GDAL by typing:

    -
    brew tap osgeo/osgeo4mac
    -brew install osgeo-gdal-python
    +
    brew tap osgeo/osgeo4mac
    +brew install osgeo-gdal-python

    (see the OSGeo Homebrew webpage for details). At this step, an error could be returned in case another GDAL installation was already present; in this case, follow the instruction returned in the terminal to solve it (probably some packages must be unlinked with the instructions brew unlink <package>).

diff --git a/docs/articles/installation_files/anchor-sections-1.0/anchor-sections.css b/docs/articles/installation_files/anchor-sections-1.0/anchor-sections.css new file mode 100644 index 00000000..07aee5fc --- /dev/null +++ b/docs/articles/installation_files/anchor-sections-1.0/anchor-sections.css @@ -0,0 +1,4 @@ +/* Styles for section anchors */ +a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} +a.anchor-section::before {content: '#';} +.hasAnchor:hover a.anchor-section {visibility: visible;} diff --git a/docs/articles/installation_files/anchor-sections-1.0/anchor-sections.js b/docs/articles/installation_files/anchor-sections-1.0/anchor-sections.js new file mode 100644 index 00000000..570f99a0 --- /dev/null +++ b/docs/articles/installation_files/anchor-sections-1.0/anchor-sections.js @@ -0,0 +1,33 @@ +// Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020. +document.addEventListener('DOMContentLoaded', function() { + // Do nothing if AnchorJS is used + if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) { + return; + } + + const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); + + // Do nothing if sections are already anchored + if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) { + return null; + } + + // Use section id when pandoc runs with --section-divs + const section_id = function(x) { + return ((x.classList.contains('section') || (x.tagName === 'SECTION')) + ? x.id : ''); + }; + + // Add anchors + h.forEach(function(x) { + const id = x.id || section_id(x.parentElement); + if (id === '') { + return null; + } + let anchor = document.createElement('a'); + anchor.href = '#' + id; + anchor.classList = ['anchor-section']; + x.classList.add('hasAnchor'); + x.appendChild(anchor); + }); +}); diff --git a/docs/articles/installation_files/header-attrs-2.5/header-attrs.js b/docs/articles/installation_files/header-attrs-2.5/header-attrs.js new file mode 100644 index 00000000..dd57d92e --- /dev/null +++ b/docs/articles/installation_files/header-attrs-2.5/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/outstructure.html b/docs/articles/outstructure.html index 79227653..b3730972 100644 --- a/docs/articles/outstructure.html +++ b/docs/articles/outstructure.html @@ -31,7 +31,7 @@ sen2r - 1.3.9 + 1.4.0

@@ -106,7 +106,8 @@ -
+ +
@@ -106,7 +106,8 @@ -
+ +

Load processing parameters from a previously saved JSON file

Users can set the desired parameters with the GUI, export them to a JSON file and run the command sen2r() specifying the JSON path in the argument param_list to specify processing options. For example, the command would launch sen2r() using settings specified in file "myparams.json" (or "file30ac6089ea3_sen2r_params.json" in the reproducible case):

-
-# set the path to an existing JSON file 
+
+# set the path to an existing JSON file 
 # (commented here, and substituted with an instruction that creates 
 # a test JSON file)
 # json_path <- "/path/to/myparams.json"
 json_path_2 <- build_example_param_file()
-json_path_2
-
[1] "/tmp/RtmpDLx7qh/file30ac6089ea3_sen2r_params.json"
-
-out_paths_2 <- sen2r(param_list = json_path_2)
-
[2020-02-05 11:58:09] #### Starting sen2r execution. ####
-[2020-02-05 11:58:09] Searching for available SAFE products on SciHub...
-[2020-02-05 11:58:12] Computing output names...
-[2020-02-05 11:58:13] Starting to download the required level-2A SAFE products.
-Images S2A_MSIL2A_20170703T101021_N0205_R022_T32TNS_20170703T101041.SAFE are 
-already on your system and will be skipped. Set "overwrite_safe" to TRUE to 
-re-download them.
+json_path_2
+
[1] "/tmp/RtmpHUtF1k/file9a625065871c_sen2r_params.json"
+
+out_paths_2 <- sen2r(param_list = json_path_2)
+
[2020-11-27 17:25:23] #### Starting sen2r execution. ####
+[2020-11-27 17:25:23] Searching for available SAFE products on SciHub...
+[2020-11-27 17:25:26] Computing output names...
+[2020-11-27 17:25:28] Starting to download the required level-2A SAFE products.
 
 # (skipping most processing messages here)
+
 ╔══════════════════════════════════════════════════════════════════════════════
 ║ sen2r Processing Report
 ╟──────────────────────────────────────────────────────────────────────────────
 ║ Dates to be processed based on processing parameters: 1
 ║ Processing completed for: all expected dates.
 ╚══════════════════════════════════════════════════════════════════════════════
-[2020-02-05 11:58:20] #### Execution of sen2r session terminated. ####
+[2020-11-27 17:26:43] #### sen2r session terminated. ####
 The processing chain can be re-launched with the command:
-  sen2r("/home/lb/.sen2r/proc_par/s2proc_20200205_115809.json")
+ sen2r("/home/lranghetti/.sen2r/proc_par/s2proc_20201127_172523.json")

This is for example particularly useful if a sen2r() processing requires ordering images from the LTA archive (see https://scihub.copernicus.eu/userguide/LongTermArchive).

The user can in fact, in that case:

    @@ -263,12 +264,12 @@

    This allows users to use a previously saved JSON file as a “template” for a processing, but changing “manually” any desired parameter.

    For example, the following instructions would execute the same processing as in the previous example, but changing both the extent and time window of the analysis.

    -
    -# use the previously saved JSON path
    -json_path_2
    +
    +# use the previously saved JSON path
    +json_path_2
    [1] "/tmp/RtmpDLx7qh/file30ac6089ea3_sen2r_params.json"
    -
    -out_dir_3 <- tempfile(pattern = "sen2r_out_3_")  # new output folder
    +
    +out_dir_3 <- tempfile(pattern = "sen2r_out_3_")  # new output folder
     
     myextent_3 <- system.file("extdata/vector/scalve.kml", package = "sen2r")
     
    @@ -276,9 +277,9 @@ 

    param_list = json_path_2, extent = myextent_3, extent_name = "newxtent", - timewindow = c(as.Date("2019-01-01"), as.Date("2019-01-30")), + timewindow = c(as.Date("2020-10-01"), as.Date("2020-10-30")), path_out = out_dir_3 -)

    +)

    This allows for example to easily run the same processing over different spatial/temporal extents.

diff --git a/docs/articles/sen2r_cmd_files/anchor-sections-1.0/anchor-sections.css b/docs/articles/sen2r_cmd_files/anchor-sections-1.0/anchor-sections.css new file mode 100644 index 00000000..07aee5fc --- /dev/null +++ b/docs/articles/sen2r_cmd_files/anchor-sections-1.0/anchor-sections.css @@ -0,0 +1,4 @@ +/* Styles for section anchors */ +a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} +a.anchor-section::before {content: '#';} +.hasAnchor:hover a.anchor-section {visibility: visible;} diff --git a/docs/articles/sen2r_cmd_files/anchor-sections-1.0/anchor-sections.js b/docs/articles/sen2r_cmd_files/anchor-sections-1.0/anchor-sections.js new file mode 100644 index 00000000..570f99a0 --- /dev/null +++ b/docs/articles/sen2r_cmd_files/anchor-sections-1.0/anchor-sections.js @@ -0,0 +1,33 @@ +// Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020. +document.addEventListener('DOMContentLoaded', function() { + // Do nothing if AnchorJS is used + if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) { + return; + } + + const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); + + // Do nothing if sections are already anchored + if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) { + return null; + } + + // Use section id when pandoc runs with --section-divs + const section_id = function(x) { + return ((x.classList.contains('section') || (x.tagName === 'SECTION')) + ? x.id : ''); + }; + + // Add anchors + h.forEach(function(x) { + const id = x.id || section_id(x.parentElement); + if (id === '') { + return null; + } + let anchor = document.createElement('a'); + anchor.href = '#' + id; + anchor.classList = ['anchor-section']; + x.classList.add('hasAnchor'); + x.appendChild(anchor); + }); +}); diff --git a/docs/articles/sen2r_cmd_files/header-attrs-2.5/header-attrs.js b/docs/articles/sen2r_cmd_files/header-attrs-2.5/header-attrs.js new file mode 100644 index 00000000..dd57d92e --- /dev/null +++ b/docs/articles/sen2r_cmd_files/header-attrs-2.5/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/sen2r_gui.html b/docs/articles/sen2r_gui.html index 20097b9a..f7e7309e 100644 --- a/docs/articles/sen2r_gui.html +++ b/docs/articles/sen2r_gui.html @@ -31,7 +31,7 @@ sen2r - 1.3.9 + 1.4.0
@@ -106,7 +106,8 @@ -
+ +
@@ -155,7 +155,7 @@

Citation

Source: inst/CITATION
-

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: 10.1016/j.cageo.2020.104473, URL: http://sen2r.ranghetti.info/.

+

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: 10.1016/j.cageo.2020.104473, URL: http://sen2r.ranghetti.info/.

@Article{,
   author = {Luigi Ranghetti and Mirco Boschetti and Francesco Nutini and Lorenzo Busetto},
   title = {sen2r: An R toolbox for automatically downloading and preprocessing Sentinel-2 satellite data},
diff --git a/docs/index.html b/docs/index.html
index c44aac76..62b79be2 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -38,7 +38,7 @@
       
       
         sen2r
-        1.3.9
+        1.4.0
       
     
@@ -116,7 +116,18 @@
- + +

diff --git a/docs/news/index.html b/docs/news/index.html index 1b155091..cd684798 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -71,7 +71,7 @@ sen2r - 1.3.9 + 1.4.0

@@ -155,9 +155,52 @@

Changelog

Source: NEWS.md
+
+

+Version 1.4.0 Unreleased +

+
+

+Major changes

+
    +
  • +gdal_warp() was partially rewritten: now reshaped rasters conserve square pixels also after warping operations. This change also affects sen2r() products if reshaping features (reprojection or custom resolution) are required. This update was necessary due to changes performed in GDAL since version 3.2.0 (see OSGeo/gdal♯3294), which did not grant homogeneity between outputs produced with different GDAL versions. Note that, in case the user wants to update an existing sen2r archive produced with sen2r < 1.4.0, the old existing grid is maintained so that product grids are equal (in order to produce outputs with the new grid, users must create a new archive).
  • +
  • Manage images split in two SAFE products, to avoid producing black areas in these [uncommon] cases (see #353 for an explanation). As effects: +
      +
    1. now pixels outside footprints (including nodata outside orbits coverage) are always set to nodata;
    2. +
    3. now s2_download() is no more able to use existing products equivalent to found ones.
    4. +
    +
  • +
+
+
+

+Minor changes

+
    +
  • Add templates for GitHub issues.
  • +
  • Do not return error in tests in case of SciHub server down (#354).
  • +
+
+
+

+Changes in default values

+
    +
  • Pixels outside footprints (because of previous point, or - more frequently - because outside orbits coverage) are always set to NA even if no cloud masking is performed.
  • +
  • +s2_download() no more uses existing SAFE products instead than downloading new equivalent ones (this in order to manage images split in two SAFE archives).
  • +
+
+
+

+Documentation

+
    +
  • Update vignette data (granting using online data) (#360).
  • +
+
+

-Version 1.3.9 Unreleased +Version 1.3.9 2020-10-14

@@ -171,9 +214,9 @@

Version 1.3.8 2020-08-26

-
+

-Minor changes

+Minor changes

-
+

-Changes in default values

+Changes in default values

  • build_example_param_file() now generates more recent images, 2020-08-01 instead than 2019-07-23 (this because the previous ones required two SAFE which are now on LTA); the same was done for some tests.
  • @@ -201,25 +244,25 @@

    Version 1.3.7 2020-07-06

    -
    +

    -Major changes

    +Major changes
    • Some additional products are now supported: CLD, SNW, AOT, WVP (see documentation for description). The GUI and internal functions were modified to support their selection and generation.
    -
    +

    -Minor changes

    +Minor changes
    • Add indices Red / Green / Blue Chromatic Coordinate (Rcc, Gcc, Bcc) and Excess Green (ExG) (#330).
    • All methods based on runtime GDAL are now discouraged and never called by default (before this version, they were used in case GDAL was found on paths.json).
    • Output GeoTIFF files are now tiled.
    -
    +

    -Documentation

    +Documentation
    • New products were documented in function references and in the article “Output file structure”.
    • Function references explicit discourage the use of GDAL-based methods.
    • @@ -250,25 +293,25 @@

      Version 1.3.5 2020-06-01

      -
      +

      -Major changes

      +Major changes
      • GDAL is no longer a mandatory external dependency, being used only to smooth/bufferise cloud masks (and optionally to compute spectral indices, RGB images and thumbnails).
      • “Graphical” packages needed to run the GUI (leaflet, leafpm, mapedit, shiny, shinyFiles, shinydashboard, shinyjs, shinyWidgets) are now suggested dependencies. In the case they are missing and the user tries to run the GUI, an error is returned with the command for installing them.
      -
      +

      -Minor changes

      +Minor changes
      • Edit the GUI in order to disable selectors when dependencies required to run them are not available.
      • Automatic tests were reorganised and improved after GDAL changes.
      -
      +

      -Documentation

      +Documentation
      • Document sen2r installation over Ubuntu Focal.
      • Update documentation according to GDAL changes.
      • @@ -295,9 +338,9 @@

        gdalUtil(): function used to perform GDAL operations, calling C-based GDAL utilities using sf::gdal_utils(), and Python-based ones through system calls (a standalone GDAL environment is request to do it, as it was in previous versions).

      -
      +

      -Documentation

      +Documentation
      • Improve documentation of vignette “Output file structure”, including the description of output products.
      @@ -310,9 +353,9 @@

      rgdal is now an explicit dependency (this because it is used by raster but it is not a mandatory dependency).

    -
    +

    -Minor changes

    +Minor changes
    • GDAL C-based utilities are called using internal GDAL routines in package sf (see gdalUtil()). This allows reducing the use of external runtime dependencies.
    • GDAL messages are suppressed if the suggested dependency sys is installed (#257).
    • @@ -332,9 +375,9 @@

      Version 1.3.3 2020-03-30

      -
      +

      -Major changes

      +Major changes
      • Move the list of ignored / cloud-covered images in the output path (#271): before this release, two files (*_ignorelist.txt and *_cloudlist.txt) were created in the directory of the parameter file (if existing) and used, during subsequent sen2r() executions, in order not to try reprocessing images cloud covered or failed for some reason. Now these files were replaced with an hidden TOML file .ignorelist.txt containing the list of base names of non-produced files and the dates of cloud covered images. This file is placed in the output folder, so to be linked with the produced archive. The usefulness of this edit is twofold:
          @@ -352,9 +395,9 @@

          RcppTOML (used to manage TOML ignore list TOML file).

      -
      +

      -Documentation

      +Documentation
      • Improve the installation page.
      @@ -399,9 +442,9 @@

    • Prepare to move shiny* and leaflet* dependencies to suggested (this will be done in a future release).
    -
    +

    -Minor changes

    +Minor changes
    • Allow choosing if ordering SAFE products from dhus or apihub (experimental).
    • Replace all GET() calls with RETRY(), so to avoid errors in case of temporary unavailability of services.
    • @@ -414,9 +457,9 @@

      Version 1.3.1 2020-02-07

      -
      +

      -Major changes

      +Major changes
      • Documentation was improved with three new vignettes about GUI usage, command line usage and output structure.
      @@ -438,9 +481,9 @@

    • In the GUI, the maximum allowed cloud cover was set to 100% accordingly to the sen2r() defaults.
    -
    +

    -Minor changes

    +Minor changes
    • Add check on max_mask - mask_type coherence (if max_mask < 100 and mask_type is not specified, a warning is returned).
    • Suppress some useless warnings.
    • @@ -453,9 +496,9 @@

      Version 1.3.0 2020-02-04

      -
      +

      -Major changes

      +Major changes
      • Support for GDAL 3 / PROJ 6 was added:
          @@ -496,9 +539,9 @@

          use_python argument in sen2r() was deprecated (no longer needed).

      -
      +

      -Minor changes

      +Minor changes
      • All components of the order (available, ordered and notordered) are now saved in JSON files. This allows using them to re-do an order, specifying if re-ordering already ordered datasets or only order the ones identified as “notordered” (based on new argument “reorder”).
      • Output messages are formatted so not to exceed output line length.
      • @@ -533,9 +576,9 @@

        Version 1.2.1 2019-11-12

        -
        +

        -Major changes

        +Major changes
        • New safelist class for lists of SAFE Sentinel-2 archives (see safelist-class);
        • @@ -554,9 +597,9 @@

          as() methods can be used to convert safelist from/to character, data.frame and data.table (as well as as.character()',as.data.frame()andas.data.table()` functions).

        -
        +

        -Changes in default values

        +Changes in default values
        • safe_getMetadata(): new arguments format, simplify and allow_oldnames (see the function reference for details);
        • @@ -566,9 +609,9 @@

          safe_shortname(): arguments tiles, force_tiles, set.seed and multiple_names were deprecated, since they are not used with SAFE compact names (old names are no more supported);

        -
        +

        -Minor changes

        +Minor changes
        • Sys.setenv() effects now do not affect the R environment after exiting from sen2r() execution;
        • @@ -620,20 +663,22 @@

          sen2r CRAN release


          sen2r was accepted on CRAN (2019-10-21, version 1.1.0). From now, it is possible to install the CRAN version with the following command:

          - +
          +
          +install.packages("sen2r")

          The development version – which may contain updated features – can still be installed with the following command:

          -
          -remotes::install_packages_github("ranghetti/sen2r")
          +
          +
          +remotes::install_packages_github("ranghetti/sen2r")

        Version 1.1.0 2019-10-21

        -
        +

        -Changes in default values

        +Changes in default values
        • The default value for "list_prods" argument in sen2r() is NULL instead of 'BOA'.
        • Remove 'no' value for argument "step_atmcorr" in sen2r() (use 'l2a' without selecting any L2A products instead).
        • @@ -643,9 +688,9 @@

        • In the case the users manually defines the path to be used as temporary directory and this directory already exists, a casual subdirectory of the user-defined folder is used (this to prevent to accidentally delete existing files).
        -
        +

        -Major changes

        +Major changes
        • sen2r package directory is no more used to store files, but a subfolder .sen2r of the user Home directory is created and used. In this way, reinstalling sen2r will not require anymore to reinstall runtime dependencies / to reconfigure the package. The permission to write on this folder is asked to the user when the package is loaded for the first time.
        • @@ -757,9 +802,9 @@

          Changes from version 1.0.0

          -
          +

          -Major changes

          +Major changes

          • A new algorithm was implemented in s2_calcindices(): now internal raster routines are used by default instead than gdal_calc.py, allowing reducing RAM usage and computation time.
          • Better RAM usage and reduction of execution time: sen2r_getElements() was rewritten in order to: 1) avoid a RAM leak present in the function, which was causing a high RAM use in the first part of the execution of sen2r(); 2) considerably speed up the execution (now the metadata of 100 files is retrieved in 4 milliseconds instead than 80).
          • @@ -903,9 +948,9 @@

            Version 0.3.3 Unreleased

            This is an improvement of version 0.3.2, with several fixes and improvements.

            -
            +

            -Major changes

            +Major changes
            • Add internal logging (argument log of function sen2r())
            • New function s2_dop() to know the Dates Of Passage over orbits
            • diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index a0eb0c34..c3dfb847 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,4 +1,4 @@ -pandoc: 2.10.1 +pandoc: 2.11.2 pkgdown: 1.6.1 pkgdown_sha: ~ articles: @@ -7,5 +7,5 @@ articles: outstructure: outstructure.html sen2r_cmd: sen2r_cmd.html sen2r_gui: sen2r_gui.html -last_built: 2020-10-11T06:33Z +last_built: 2021-01-05T16:07Z diff --git a/docs/reference/Rplot003.png b/docs/reference/Rplot003.png new file mode 100644 index 00000000..1eba04f4 Binary files /dev/null and b/docs/reference/Rplot003.png differ diff --git a/docs/reference/Rplot004.png b/docs/reference/Rplot004.png new file mode 100644 index 00000000..097e23c8 Binary files /dev/null and b/docs/reference/Rplot004.png differ diff --git a/docs/reference/Rplot005.png b/docs/reference/Rplot005.png new file mode 100644 index 00000000..259b17c2 Binary files /dev/null and b/docs/reference/Rplot005.png differ diff --git a/docs/reference/Rplot006.png b/docs/reference/Rplot006.png new file mode 100644 index 00000000..3958329b Binary files /dev/null and b/docs/reference/Rplot006.png differ diff --git a/docs/reference/abs2rel.html b/docs/reference/abs2rel.html index 503a35ab..1b0e5d2f 100644 --- a/docs/reference/abs2rel.html +++ b/docs/reference/abs2rel.html @@ -75,7 +75,7 @@ sen2r - 1.3.9 + 1.4.0
            @@ -203,9 +203,9 @@

            R

            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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

            +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

            Author

            Luigi Ranghetti, phD (2017) luigi.ranghetti@gmail.com

            diff --git a/docs/reference/add_rgb_image.html b/docs/reference/add_rgb_image.html index efc2c15e..2039d575 100644 --- a/docs/reference/add_rgb_image.html +++ b/docs/reference/add_rgb_image.html @@ -72,7 +72,7 @@ sen2r - 1.3.9 + 1.4.0
            @@ -180,9 +180,9 @@

            R

            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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

            +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

            Author

            Luigi Ranghetti, phD (2019) luigi@ranghetti.info

            diff --git a/docs/reference/add_tile_suffix.html b/docs/reference/add_tile_suffix.html index a0ac4e1f..8c872fa0 100644 --- a/docs/reference/add_tile_suffix.html +++ b/docs/reference/add_tile_suffix.html @@ -76,7 +76,7 @@ sen2r - 1.3.9.9001 + 1.4.0
        @@ -169,11 +169,11 @@

        Add/remove suffixes for split tiles

        extract_tile_suffix() extracts suffixes from input paths.

        -
        add_tile_suffix(paths, suffix)
        +    
        add_tile_suffix(paths, suffix)
         
        -remove_tile_suffix(paths)
        +remove_tile_suffix(paths)
         
        -extract_tile_suffix(paths)
        +extract_tile_suffix(paths)

        Arguments

        @@ -217,27 +217,27 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2020) luigi@ranghetti.info

        Examples

        -
        safe_names <- c( +
        safe_names <- c( "S2A_MSIL2A_20200408T101021_N0214_R022_T32TNK_20200408T175711.SAFE", "S2A_MSIL2A_20200408T101021_N0214_R022_T32TNL_20200408T175711.SAFE", "S2A_MSIL2A_20200408T101021_N0214_R022_T32TNL_20200408T161405.SAFE" -) -prod_names <- safe_shortname(safe_names, ext = ".tif", allow_duplicated = TRUE) -( prod_names_univoc <- sen2r:::add_tile_suffix(prod_names) ) +) +prod_names <- safe_shortname(safe_names, ext = ".tif", allow_duplicated = TRUE) +( prod_names_univoc <- sen2r:::add_tile_suffix(prod_names) )
        #> [1] "S2A2A_20200408_022_32TNK_BOA_10.tif" #> [2] "S2A2A_20200408_022_32TNLa_BOA_10.tif" -#> [3] "S2A2A_20200408_022_32TNLb_BOA_10.tif"
        ( prod_names_custom <- sen2r:::add_tile_suffix(prod_names, "a") ) +#> [3] "S2A2A_20200408_022_32TNLb_BOA_10.tif"
        ( prod_names_custom <- sen2r:::add_tile_suffix(prod_names, "a") )
        #> [1] "S2A2A_20200408_022_32TNKa_BOA_10.tif" #> [2] "S2A2A_20200408_022_32TNLa_BOA_10.tif" -#> [3] "S2A2A_20200408_022_32TNLb_BOA_10.tif"
        sen2r:::remove_tile_suffix(prod_names_univoc) +#> [3] "S2A2A_20200408_022_32TNLb_BOA_10.tif"
        sen2r:::remove_tile_suffix(prod_names_univoc)
        #> [1] "S2A2A_20200408_022_32TNK_BOA_10.tif" "S2A2A_20200408_022_32TNL_BOA_10.tif" #> [3] "S2A2A_20200408_022_32TNL_BOA_10.tif"
        diff --git a/docs/reference/build_example_param_file.html b/docs/reference/build_example_param_file.html index 54111ea0..ee61e1c3 100644 --- a/docs/reference/build_example_param_file.html +++ b/docs/reference/build_example_param_file.html @@ -74,7 +74,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -195,16 +195,16 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        Examples

        build_example_param_file() -
        #> [1] "/tmp/RtmpZIH1VX/file1620370789cb_sen2r_params.json"
        +
        #> [1] "/tmp/RtmpIwBWvo/file9d5a33cea76df_sen2r_params.json"
        @@ -251,9 +251,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2020) luigi@ranghetti.info

        diff --git a/docs/reference/check_gdal.html b/docs/reference/check_gdal.html index 730a3749..10652b43 100644 --- a/docs/reference/check_gdal.html +++ b/docs/reference/check_gdal.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -210,9 +210,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/check_gui_deps.html b/docs/reference/check_gui_deps.html index e2a98f59..0d1776ab 100644 --- a/docs/reference/check_gui_deps.html +++ b/docs/reference/check_gui_deps.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -192,9 +192,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2020) luigi@ranghetti.info

        diff --git a/docs/reference/check_param_list.html b/docs/reference/check_param_list.html index 282ce51e..2c7558b0 100644 --- a/docs/reference/check_param_list.html +++ b/docs/reference/check_param_list.html @@ -74,7 +74,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -207,9 +207,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/check_sen2r_deps.html b/docs/reference/check_sen2r_deps.html index 873c8ec7..1b19d933 100644 --- a/docs/reference/check_sen2r_deps.html +++ b/docs/reference/check_sen2r_deps.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -188,9 +188,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/compute_s2_paths.html b/docs/reference/compute_s2_paths.html index f9b8e3a9..40755af6 100644 --- a/docs/reference/compute_s2_paths.html +++ b/docs/reference/compute_s2_paths.html @@ -81,7 +81,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -549,9 +549,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/comsub.html b/docs/reference/comsub.html index d9027929..85a1ba01 100644 --- a/docs/reference/comsub.html +++ b/docs/reference/comsub.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -192,9 +192,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/create_indices_db.html b/docs/reference/create_indices_db.html index 8d483a71..674abd11 100644 --- a/docs/reference/create_indices_db.html +++ b/docs/reference/create_indices_db.html @@ -78,7 +78,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -209,9 +209,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/create_s2_dop.html b/docs/reference/create_s2_dop.html index f12f5172..6f5c49ba 100644 --- a/docs/reference/create_s2_dop.html +++ b/docs/reference/create_s2_dop.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -193,9 +193,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/dontuse.html b/docs/reference/dontuse.html index c6514d27..d2eda827 100644 --- a/docs/reference/dontuse.html +++ b/docs/reference/dontuse.html @@ -72,7 +72,7 @@ sen2r - 1.3.9 + 1.4.0 diff --git a/docs/reference/expand_path.html b/docs/reference/expand_path.html index 5541443b..9db54466 100644 --- a/docs/reference/expand_path.html +++ b/docs/reference/expand_path.html @@ -77,7 +77,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -210,9 +210,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/expect_equal_crs.html b/docs/reference/expect_equal_crs.html index c9915e00..6bea1f14 100644 --- a/docs/reference/expect_equal_crs.html +++ b/docs/reference/expect_equal_crs.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -188,9 +188,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2020) luigi@ranghetti.info

        diff --git a/docs/reference/fix_envi_format.html b/docs/reference/fix_envi_format.html index 3507e2ef..f1a33a21 100644 --- a/docs/reference/fix_envi_format.html +++ b/docs/reference/fix_envi_format.html @@ -81,7 +81,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -201,9 +201,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/gdalUtil-1.png b/docs/reference/gdalUtil-1.png index 7daa2306..7ba5005c 100644 Binary files a/docs/reference/gdalUtil-1.png and b/docs/reference/gdalUtil-1.png differ diff --git a/docs/reference/gdalUtil-2.png b/docs/reference/gdalUtil-2.png index 06fc45e1..7509f0c6 100644 Binary files a/docs/reference/gdalUtil-2.png and b/docs/reference/gdalUtil-2.png differ diff --git a/docs/reference/gdalUtil-3.png b/docs/reference/gdalUtil-3.png index f20bc9a4..e8be7648 100644 Binary files a/docs/reference/gdalUtil-3.png and b/docs/reference/gdalUtil-3.png differ diff --git a/docs/reference/gdalUtil.html b/docs/reference/gdalUtil.html index 592a5ab1..0bebd5f9 100644 --- a/docs/reference/gdalUtil.html +++ b/docs/reference/gdalUtil.html @@ -76,7 +76,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -235,9 +235,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2020) luigi@ranghetti.info

        @@ -339,9 +339,9 @@

        Examp options = c("-tr", "2", "2", "-r", "cubicspline", "-co", "COMPRESS=DEFLATE") )
        #> 0...10...20...30...40...50...60...70...80...90...100 - done.
        oldpar <- par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(examplename), rgb = c(11,8,4)) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        image(stars::read_stars(outname1), rgb = c(11,8,4)) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        +image(stars::read_stars(examplename), rgb = c(11,8,4), useRaster = TRUE) +image(stars::read_stars(outname1), rgb = c(11,8,4), useRaster = TRUE) +
        ## gdalwarp outname2 <- tempfile(fileext = ".tif") gdalUtil( @@ -350,9 +350,9 @@

        Examp options = c("-t_srs", "EPSG:32633", "-co", "COMPRESS=DEFLATE") ) oldpar <- par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(examplename), rgb = c(11,8,4)) -

        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        image(stars::read_stars(outname2), rgb = c(11,8,4)) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        +image(stars::read_stars(examplename), rgb = c(11,8,4), useRaster = TRUE) +image(stars::read_stars(outname2), rgb = c(11,8,4), useRaster = TRUE) +
        ## gdal_calc outname3 <- tempfile(fileext = ".tif") ndvirefname <- system.file( @@ -366,9 +366,9 @@

        Examp options = c("--A_band", "8", "--B_band", "4", "--type", "Int16") ) oldpar <- par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(ndvirefname)) -

        #> Error in if (useRaster) { if (check_irregular(x, y)) stop(gettextf("%s can only be used with a regular grid", sQuote("useRaster = TRUE")), domain = NA) if (!is.character(col)) { col <- as.integer(col) if (any(!is.na(col) & col < 0L)) stop("integer colors must be non-negative") col[col < 1L] <- NA_integer_ p <- palette() col <- p[((col - 1L)%%length(p)) + 1L] } zc <- col[zi + 1L] dim(zc) <- dim(z) zc <- t(zc)[ncol(zc):1L, , drop = FALSE] rasterImage(as.raster(zc), min(x), min(y), max(x), max(y), interpolate = FALSE)} else .External.graphics(C_image, x, y, zi, col): valore mancante dove è richiesto TRUE/FALSE
        image(stars::read_stars(outname3)) -
        #> Error in if (useRaster) { if (check_irregular(x, y)) stop(gettextf("%s can only be used with a regular grid", sQuote("useRaster = TRUE")), domain = NA) if (!is.character(col)) { col <- as.integer(col) if (any(!is.na(col) & col < 0L)) stop("integer colors must be non-negative") col[col < 1L] <- NA_integer_ p <- palette() col <- p[((col - 1L)%%length(p)) + 1L] } zc <- col[zi + 1L] dim(zc) <- dim(z) zc <- t(zc)[ncol(zc):1L, , drop = FALSE] rasterImage(as.raster(zc), min(x), min(y), max(x), max(y), interpolate = FALSE)} else .External.graphics(C_image, x, y, zi, col): valore mancante dove è richiesto TRUE/FALSE
        # } +image(stars::read_stars(ndvirefname), useRaster = TRUE) +image(stars::read_stars(outname3), useRaster = TRUE) +
        # }
        @@ -207,9 +207,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/gdal_warp-1.png b/docs/reference/gdal_warp-1.png index 694989a9..fafb1307 100644 Binary files a/docs/reference/gdal_warp-1.png and b/docs/reference/gdal_warp-1.png differ diff --git a/docs/reference/gdal_warp-2.png b/docs/reference/gdal_warp-2.png index abed2058..a52c11b6 100644 Binary files a/docs/reference/gdal_warp-2.png and b/docs/reference/gdal_warp-2.png differ diff --git a/docs/reference/gdal_warp-3.png b/docs/reference/gdal_warp-3.png index 10b68955..a8e01d60 100644 Binary files a/docs/reference/gdal_warp-3.png and b/docs/reference/gdal_warp-3.png differ diff --git a/docs/reference/gdal_warp-4.png b/docs/reference/gdal_warp-4.png index c7f699b8..26d8306b 100644 Binary files a/docs/reference/gdal_warp-4.png and b/docs/reference/gdal_warp-4.png differ diff --git a/docs/reference/gdal_warp.html b/docs/reference/gdal_warp.html index d5c6c351..c972ddbd 100644 --- a/docs/reference/gdal_warp.html +++ b/docs/reference/gdal_warp.html @@ -75,7 +75,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -282,9 +282,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        @@ -314,24 +314,24 @@

        Examp # Show output crop_bbox <- sf::st_as_sfc(sf::st_bbox(crop_line)) oldpar <- par(mfrow = c(1,3), mar = rep(0,4)) -image(stars::read_stars(ex_sel), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        plot(crop_line, add = TRUE, col = "blue", lwd = 2) -
        #> Error in plot.xy(xy.coords(x, y), type = type, ...): plot.new has not been called yet
        plot(crop_bbox, add = TRUE, border = "red", lwd = 2) -
        #> Error in polypath(p_bind(x[[i]]), border = border[i], lty = lty[i], lwd = lwd[i], col = col[i], rule = rule): plot.new has not been called yet
        image(stars::read_stars(test1), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        plot(crop_bbox, add = TRUE, border = "red", lwd = 2) -
        #> Error in polypath(p_bind(x[[i]]), border = border[i], lty = lty[i], lwd = lwd[i], col = col[i], rule = rule): plot.new has not been called yet
        image(stars::read_stars(test2), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        plot(crop_line, add = TRUE, col = "blue", lwd = 2) -
        #> Error in plot.xy(xy.coords(x, y), type = type, ...): plot.new has not been called yet
        +image(stars::read_stars(ex_sel), rgb = 1:3, useRaster = TRUE) +plot(crop_line, add = TRUE, col = "blue", lwd = 2) +plot(crop_bbox, add = TRUE, border = "red", lwd = 2) +image(stars::read_stars(test1), rgb = 1:3, useRaster = TRUE) +plot(crop_bbox, add = TRUE, border = "red", lwd = 2) +image(stars::read_stars(test2), rgb = 1:3, useRaster = TRUE) +
        plot(crop_line, add = TRUE, col = "blue", lwd = 2) +
        # Warp on a reference raster test3 <- tempfile(fileext = "_test3.tif") gdal_warp(ex_sel, test3, ref = ex_ref) # Show output par(mfrow = c(1,3)) -par(mar = rep(0,4)); image(stars::read_stars(ex_sel), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        par(mar = rep(2/3,4)); image(stars::read_stars(ex_ref)) -
        #> Error in if (useRaster) { if (check_irregular(x, y)) stop(gettextf("%s can only be used with a regular grid", sQuote("useRaster = TRUE")), domain = NA) if (!is.character(col)) { col <- as.integer(col) if (any(!is.na(col) & col < 0L)) stop("integer colors must be non-negative") col[col < 1L] <- NA_integer_ p <- palette() col <- p[((col - 1L)%%length(p)) + 1L] } zc <- col[zi + 1L] dim(zc) <- dim(z) zc <- t(zc)[ncol(zc):1L, , drop = FALSE] rasterImage(as.raster(zc), min(x), min(y), max(x), max(y), interpolate = FALSE)} else .External.graphics(C_image, x, y, zi, col): valore mancante dove è richiesto TRUE/FALSE
        par(mar = rep(0,4)); image(stars::read_stars(test3), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        +par(mar = rep(0,4)); image(stars::read_stars(ex_sel), rgb = 1:3, useRaster = TRUE) +par(mar = rep(2/3,4)); image(stars::read_stars(ex_ref), useRaster = TRUE) +par(mar = rep(0,4)); image(stars::read_stars(test3), rgb = 1:3, useRaster = TRUE) +
        # Reproject all the input file test4 <- tempfile(fileext = "_test4.tif") gdal_warp(ex_sel, test4, t_srs = 32631) @@ -349,15 +349,15 @@

        Examp test1_bbox <- sf::st_as_sfc(sf::st_bbox(stars::read_stars(test1))) test1_bbox_31N <- sf::st_transform(test1_bbox, 32631) par(mfrow = c(1,4), mar = rep(0,4)) -image(stars::read_stars(ex_sel), rgb = 1:3) -

        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        plot(crop_line, add = TRUE, col = "blue", lwd = 2) +image(stars::read_stars(ex_sel), rgb = 1:3, useRaster = TRUE) +plot(crop_line, add = TRUE, col = "blue", lwd = 2) plot(test1_bbox, add = TRUE, border = "red", lwd = 2) -image(stars::read_stars(test4), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        image(stars::read_stars(test5), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        plot(test1_bbox_31N, add = TRUE, border = "red", lwd = 2) -image(stars::read_stars(test6), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        plot(crop_line_31N, add = TRUE, col = "blue", lwd = 2) - +image(stars::read_stars(test4), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(test5), rgb = 1:3, useRaster = TRUE) +plot(test1_bbox_31N, add = TRUE, border = "red", lwd = 2) +image(stars::read_stars(test6), rgb = 1:3, useRaster = TRUE) +
        plot(crop_line_31N, add = TRUE, col = "blue", lwd = 2) +
        # Use a reference raster with a different projection test7 <- tempfile(fileext = "_test7.tif") gdal_warp(ex_sel, test7, ref = test6) @@ -373,15 +373,15 @@

        Examp # Show output par(mfrow = c(1,4), mar = rep(0,4)) -image(stars::read_stars(ex_sel), rgb = 1:3) -

        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        plot(crop_line, add = TRUE, col = "blue", lwd = 2) -image(stars::read_stars(test7), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        plot(crop_line_31N, add = TRUE, col = "blue", lwd = 2) -image(stars::read_stars(test8), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        plot(test1_bbox_31N, add = TRUE, border = "red", lwd = 2) -image(stars::read_stars(test9), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        plot(crop_line_31N, add = TRUE, col = "blue", lwd = 2) - +image(stars::read_stars(ex_sel), rgb = 1:3, useRaster = TRUE) +plot(crop_line, add = TRUE, col = "blue", lwd = 2) +image(stars::read_stars(test7), rgb = 1:3, useRaster = TRUE) +plot(crop_line_31N, add = TRUE, col = "blue", lwd = 2) +image(stars::read_stars(test8), rgb = 1:3, useRaster = TRUE) +plot(test1_bbox_31N, add = TRUE, border = "red", lwd = 2) +image(stars::read_stars(test9), rgb = 1:3, useRaster = TRUE) +
        plot(crop_line_31N, add = TRUE, col = "blue", lwd = 2) +
        par(oldpar) # }
        diff --git a/docs/reference/gdalwarp_grid-1.png b/docs/reference/gdalwarp_grid-1.png index 7daa2306..3506c0d1 100644 Binary files a/docs/reference/gdalwarp_grid-1.png and b/docs/reference/gdalwarp_grid-1.png differ diff --git a/docs/reference/gdalwarp_grid.html b/docs/reference/gdalwarp_grid.html index 359d1cd4..3354674f 100644 --- a/docs/reference/gdalwarp_grid.html +++ b/docs/reference/gdalwarp_grid.html @@ -75,7 +75,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -224,9 +224,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        @@ -249,11 +249,13 @@

        Examp # Show output oldpar <- par(mfrow = c(1,3), mar = rep(0,4)) -image(stars::read_stars(ex_sel), rgb = 4:2, maxColorValue = 3500) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        par(mar = rep(2/3,4)); image(stars::read_stars(ex_ref)) -
        #> Error in if (useRaster) { if (check_irregular(x, y)) stop(gettextf("%s can only be used with a regular grid", sQuote("useRaster = TRUE")), domain = NA) if (!is.character(col)) { col <- as.integer(col) if (any(!is.na(col) & col < 0L)) stop("integer colors must be non-negative") col[col < 1L] <- NA_integer_ p <- palette() col <- p[((col - 1L)%%length(p)) + 1L] } zc <- col[zi + 1L] dim(zc) <- dim(z) zc <- t(zc)[ncol(zc):1L, , drop = FALSE] rasterImage(as.raster(zc), min(x), min(y), max(x), max(y), interpolate = FALSE)} else .External.graphics(C_image, x, y, zi, col): valore mancante dove è richiesto TRUE/FALSE
        par(mar = rep(0,4)); image(stars::read_stars(ex_out), rgb = 4:2, maxColorValue = 3500) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        par(oldpar) -
        # } +image(stars::read_stars(ex_sel), rgb = 4:2, maxColorValue = 3500, useRaster = TRUE) +par(mar = rep(2/3,4)) +image(stars::read_stars(ex_ref), useRaster = TRUE) +par(mar = rep(0,4)) +image(stars::read_stars(ex_out), rgb = 4:2, maxColorValue = 3500, useRaster = TRUE) +
        par(oldpar) +# }
        @@ -221,9 +221,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2020) luigi@ranghetti.info

        diff --git a/docs/reference/gipp_init.html b/docs/reference/gipp_init.html index 6ccc841e..23020cdc 100644 --- a/docs/reference/gipp_init.html +++ b/docs/reference/gipp_init.html @@ -74,7 +74,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -199,9 +199,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2020) luigi@ranghetti.info

        diff --git a/docs/reference/give_write_permission.html b/docs/reference/give_write_permission.html index d152f3ee..26a90de0 100644 --- a/docs/reference/give_write_permission.html +++ b/docs/reference/give_write_permission.html @@ -76,7 +76,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -194,12 +194,12 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        -

        Lorenzo Busetto, phD (2019) lbusett@gmail.com

        +

        Lorenzo Busetto, phD (2019)

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/ignorelist.html b/docs/reference/ignorelist.html index 763bf1f3..745ffe08 100644 --- a/docs/reference/ignorelist.html +++ b/docs/reference/ignorelist.html @@ -74,7 +74,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -237,9 +237,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2020) luigi@ranghetti.info

        diff --git a/docs/reference/index.html b/docs/reference/index.html index 4d684512..657013dd 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -71,7 +71,7 @@ sen2r - 1.3.9 + 1.4.0 diff --git a/docs/reference/init_python.html b/docs/reference/init_python.html index 30a98021..6a2b2ef5 100644 --- a/docs/reference/init_python.html +++ b/docs/reference/init_python.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -176,9 +176,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2020) luigi@ranghetti.info

        diff --git a/docs/reference/install_aria2.html b/docs/reference/install_aria2.html index 25666354..4ef70cc3 100644 --- a/docs/reference/install_aria2.html +++ b/docs/reference/install_aria2.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -189,9 +189,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/install_sen2cor.html b/docs/reference/install_sen2cor.html index c14667c0..aaf48b44 100644 --- a/docs/reference/install_sen2cor.html +++ b/docs/reference/install_sen2cor.html @@ -75,7 +75,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -162,9 +162,9 @@

        Download and install (or link) Sen2Cor

        install_sen2cor() downloads and installs a standalone version of -Sen2Cor.

        +Sen2Cor.

        link_sen2cor() links an existing standalone version of -Sen2Cor to sen2r.

        +Sen2Cor to sen2r.

        install_sen2cor(sen2cor_dir = NA, version = "2.5.5", force = FALSE)
        @@ -201,9 +201,9 @@ 

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/list_indices.html b/docs/reference/list_indices.html index ed5f5c54..db0ec84d 100644 --- a/docs/reference/list_indices.html +++ b/docs/reference/list_indices.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -210,9 +210,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        @@ -304,9 +304,9 @@

        Examp list_indices("s2_formula", "^MSAVI2$")
        #> [1] "(2*band_8+1-sqrt(power((2*band_8+1),2)-8*(band_8-band_4)))/(2)" #> attr(,"pkg_version") -#> [1] ‘1.3.6.9002’ +#> [1] ‘1.4.0’ #> attr(,"creation_date") -#> [1] "2020-06-24 15:14:33 CEST"
        +#> [1] "2021-01-02 10:55:13 CET"
        # Return all index names (including unchecked) list_indices("name", all = TRUE)
        #> [1] "ATSAVI" "AFRI1600" "AFRI2100" "ARI" @@ -368,9 +368,9 @@

        Examp #> [225] "NDVIre" "NDBI" "Rcc" "Gcc" #> [229] "Bcc" "ExG" #> attr(,"pkg_version") -#> [1] ‘1.3.6.9002’ +#> [1] ‘1.4.0’ #> attr(,"creation_date") -#> [1] "2020-06-24 15:14:33 CEST"

        +#> [1] "2021-01-02 10:55:13 CET" @@ -187,9 +187,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/load_extent.html b/docs/reference/load_extent.html index 3dd8cdfd..fcf89ed8 100644 --- a/docs/reference/load_extent.html +++ b/docs/reference/load_extent.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -185,9 +185,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/mountpoint.html b/docs/reference/mountpoint.html index aa3cb35b..836440cb 100644 --- a/docs/reference/mountpoint.html +++ b/docs/reference/mountpoint.html @@ -74,7 +74,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -195,9 +195,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/nn.html b/docs/reference/nn.html index 144d31e8..77e3353c 100644 --- a/docs/reference/nn.html +++ b/docs/reference/nn.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -184,9 +184,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/normalize_path.html b/docs/reference/normalize_path.html index 0912289c..1196b8b9 100644 --- a/docs/reference/normalize_path.html +++ b/docs/reference/normalize_path.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -188,9 +188,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/path_check.html b/docs/reference/path_check.html index 7a747abb..c20cac50 100644 --- a/docs/reference/path_check.html +++ b/docs/reference/path_check.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -186,7 +186,7 @@

        Arg

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        -

        Lorenzo Busetto, PhD (2019) lbusett@gmail.com

        +

        Lorenzo Busetto, PhD (2019)

        @@ -256,9 +256,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2020) luigi@ranghetti.info

        diff --git a/docs/reference/projpar.html b/docs/reference/projpar.html index 6b42b92c..7211edf2 100644 --- a/docs/reference/projpar.html +++ b/docs/reference/projpar.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -202,9 +202,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2020) luigi@ranghetti.info

        @@ -212,7 +212,7 @@

        AuthorExamples

        # \donttest{ projpar(4326, "name") -
        #> [1] "WGS 84 (with axis order normalized for visualization)" +
        #> [1] "WGS 84" #> attr(,"crs") #> Coordinate Reference System: #> User input: EPSG:4326 @@ -260,7 +260,7 @@

        Examp #> ID["EPSG",4326]]

        # } # \donttest{ projname(4326) -
        #> [1] "WGS 84 (with axis order normalized for visualization)" +
        #> [1] "WGS 84" #> attr(,"crs") #> Coordinate Reference System: #> User input: EPSG:4326 diff --git a/docs/reference/raster2rgb.html b/docs/reference/raster2rgb.html index 04a58323..7cad6e47 100644 --- a/docs/reference/raster2rgb.html +++ b/docs/reference/raster2rgb.html @@ -74,7 +74,7 @@ sen2r - 1.3.9 + 1.4.0
        @@ -230,9 +230,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/raster_metadata.html b/docs/reference/raster_metadata.html index 06f30afc..c0a4f040 100644 --- a/docs/reference/raster_metadata.html +++ b/docs/reference/raster_metadata.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -194,9 +194,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        @@ -218,9 +218,9 @@

        Examp #> valid res.x res.y size.x size.y nbands xmin ymin xmax ymax #> 1: TRUE 28.5 28.5 349 352 6 288776.3 9110729 298722.8 9120761 #> 2: TRUE 10.0 10.0 24 42 11 580560.0 5101700 580800.0 5102120 -#> proj -#> 1: PROJCRS["unknown",\n BASEGEOGCRS["unknown",\n DATUM["Unknown based on GRS80 ellipsoid",\n ELLIPSOID["GRS 1980",6378137,298.257222101,\n LENGTHUNIT["metre",1],\n ID["EPSG",7019]]],\n PRIMEM["Greenwich",0,\n ANGLEUNIT["degree",0.0174532925199433],\n ID["EPSG",8901]]],\n CONVERSION["UTM zone 25S",\n METHOD["Transverse Mercator",\n ID["EPSG",9807]],\n PARAMETER["Latitude of natural origin",0,\n ANGLEUNIT["degree",0.0174532925199433],\n ID["EPSG",8801]],\n PARAMETER["Longitude of natural origin",-33,\n ANGLEUNIT["degree",0.0174532925199433],\n ID["EPSG",8802]],\n PARAMETER["Scale factor at natural origin",0.9996,\n SCALEUNIT["unity",1],\n ID["EPSG",8805]],\n PARAMETER["False easting",500000,\n LENGTHUNIT["metre",1],\n ID["EPSG",8806]],\n PARAMETER["False northing",10000000,\n LENGTHUNIT["metre",1],\n ID["EPSG",8807]],\n ID["EPSG",17025]],\n CS[Cartesian,2],\n AXIS["(E)",east,\n ORDER[1],\n LENGTHUNIT["metre",1,\n ID["EPSG",9001]]],\n AXIS["(N)",north,\n ORDER[2],\n LENGTHUNIT["metre",1,\n ID["EPSG",9001]]]] -#> 2: EPSG:32632 +#> proj +#> 1: PROJCS["UTM Zone 25, Southern Hemisphere",GEOGCS["GRS 1980(IUGG, 1980)",DATUM["unknown",SPHEROID["GRS80",6378137,298.257222101],TOWGS84[0,0,0,0,0,0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH]] +#> 2: EPSG:32632 #> unit outformat type #> 1: metre GTiff Byte #> 2: metre GTiff UInt16
        # } @@ -411,10 +411,10 @@

        Examp #> 1: TRUE 288776.3 9110729 298722.8 9120761 #> 2: TRUE 580560.0 5101700 580800.0 5102120 #> 3: FALSE NA NA NA NA -#> proj -#> 1: PROJCRS["unknown",\n BASEGEOGCRS["unknown",\n DATUM["Unknown based on GRS80 ellipsoid",\n ELLIPSOID["GRS 1980",6378137,298.257222101,\n LENGTHUNIT["metre",1],\n ID["EPSG",7019]]],\n PRIMEM["Greenwich",0,\n ANGLEUNIT["degree",0.0174532925199433],\n ID["EPSG",8901]]],\n CONVERSION["UTM zone 25S",\n METHOD["Transverse Mercator",\n ID["EPSG",9807]],\n PARAMETER["Latitude of natural origin",0,\n ANGLEUNIT["degree",0.0174532925199433],\n ID["EPSG",8801]],\n PARAMETER["Longitude of natural origin",-33,\n ANGLEUNIT["degree",0.0174532925199433],\n ID["EPSG",8802]],\n PARAMETER["Scale factor at natural origin",0.9996,\n SCALEUNIT["unity",1],\n ID["EPSG",8805]],\n PARAMETER["False easting",500000,\n LENGTHUNIT["metre",1],\n ID["EPSG",8806]],\n PARAMETER["False northing",10000000,\n LENGTHUNIT["metre",1],\n ID["EPSG",8807]],\n ID["EPSG",17025]],\n CS[Cartesian,2],\n AXIS["(E)",east,\n ORDER[1],\n LENGTHUNIT["metre",1,\n ID["EPSG",9001]]],\n AXIS["(N)",north,\n ORDER[2],\n LENGTHUNIT["metre",1,\n ID["EPSG",9001]]]] -#> 2: EPSG:32632 -#> 3: <NA>

        +#> proj +#> 1: PROJCS["UTM Zone 25, Southern Hemisphere",GEOGCS["GRS 1980(IUGG, 1980)",DATUM["unknown",SPHEROID["GRS80",6378137,298.257222101],TOWGS84[0,0,0,0,0,0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH]] +#> 2: EPSG:32632 +#> 3: <NA> @@ -328,9 +328,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2020) luigi@ranghetti.info

        @@ -349,14 +349,15 @@

        Examp outdir = tempdir(), dataType = "Float32" ) -
        #> Carico il pacchetto richiesto: sp
        #> Carico il pacchetto richiesto: abind
        #> Carico il pacchetto richiesto: sf
        #> Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.2
        #> [2020-10-11 08:34:39] Computing index EVI on date 2019-07-23...
        ex_out -
        #> [1] "/tmp/RtmpZIH1VX/S2A2A_20190723_022_Barbellino_EVI_10.tif"
        +
        #> Carico il pacchetto richiesto: sp
        #> Carico il pacchetto richiesto: abind
        #> Carico il pacchetto richiesto: sf
        #> Linking to GEOS 3.8.1, GDAL 3.0.4, PROJ 6.3.2
        #> [2021-01-05 17:07:34] Computing index EVI on date 2019-07-23...
        ex_out +
        #> [1] "/tmp/RtmpIwBWvo/S2A2A_20190723_022_Barbellino_EVI_10.tif"
        # Show output oldpar <- par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(ex_in), rgb = 4:2, maxColorValue = 3500) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        par(mar = rep(2/3,4)); image(stars::read_stars(ex_out)) -
        #> Error in if (useRaster) { if (check_irregular(x, y)) stop(gettextf("%s can only be used with a regular grid", sQuote("useRaster = TRUE")), domain = NA) if (!is.character(col)) { col <- as.integer(col) if (any(!is.na(col) & col < 0L)) stop("integer colors must be non-negative") col[col < 1L] <- NA_integer_ p <- palette() col <- p[((col - 1L)%%length(p)) + 1L] } zc <- col[zi + 1L] dim(zc) <- dim(z) zc <- t(zc)[ncol(zc):1L, , drop = FALSE] rasterImage(as.raster(zc), min(x), min(y), max(x), max(y), interpolate = FALSE)} else .External.graphics(C_image, x, y, zi, col): valore mancante dove è richiesto TRUE/FALSE
        par(oldpar) -
        +image(stars::read_stars(ex_in), rgb = 4:2, maxColorValue = 3500, useRaster = TRUE) +par(mar = rep(2/3,4)) +image(stars::read_stars(ex_out), useRaster = TRUE) +
        par(oldpar) +
        diff --git a/docs/reference/s2_dop.html b/docs/reference/s2_dop.html index dc06fed2..d3ff99f3 100644 --- a/docs/reference/s2_dop.html +++ b/docs/reference/s2_dop.html @@ -81,7 +81,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -221,9 +221,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        @@ -232,42 +232,43 @@

        Examp
        # All the passages in a cycle of 10 days over all the orbits s2_dop()
        #> date mission orbit -#> 1: 2020-10-11 2A 102 -#> 2: 2020-10-11 2A 103 -#> 3: 2020-10-11 2A 104 -#> 4: 2020-10-11 2A 105 -#> 5: 2020-10-11 2A 106 +#> 1: 2021-01-05 2A 045 +#> 2: 2021-01-05 2A 046 +#> 3: 2021-01-05 2A 047 +#> 4: 2021-01-05 2A 048 +#> 5: 2021-01-05 2A 049 #> --- -#> 282: 2020-10-20 2B 025 -#> 283: 2020-10-20 2B 026 -#> 284: 2020-10-20 2B 027 -#> 285: 2020-10-20 2B 028 -#> 286: 2020-10-20 2B 029
        +#> 282: 2021-01-14 2B 111 +#> 283: 2021-01-14 2B 112 +#> 284: 2021-01-14 2B 113 +#> 285: 2021-01-14 2B 114 +#> 286: 2021-01-14 2B 115
        # The passages in the current month over two orbits s2_dop(c("022", "065"), "this month")
        #> date mission orbit -#> 1: 2020-10-03 2B 065 -#> 2: 2020-10-05 2A 022 -#> 3: 2020-10-08 2A 065 -#> 4: 2020-10-10 2B 022 -#> 5: 2020-10-13 2B 065 -#> 6: 2020-10-15 2A 022 -#> 7: 2020-10-18 2A 065 -#> 8: 2020-10-20 2B 022 -#> 9: 2020-10-23 2B 065 -#> 10: 2020-10-25 2A 022 -#> 11: 2020-10-28 2A 065 -#> 12: 2020-10-30 2B 022
        +#> 1: 2021-01-01 2B 065 +#> 2: 2021-01-03 2A 022 +#> 3: 2021-01-06 2A 065 +#> 4: 2021-01-08 2B 022 +#> 5: 2021-01-11 2B 065 +#> 6: 2021-01-13 2A 022 +#> 7: 2021-01-16 2A 065 +#> 8: 2021-01-18 2B 022 +#> 9: 2021-01-21 2B 065 +#> 10: 2021-01-23 2A 022 +#> 11: 2021-01-26 2A 065 +#> 12: 2021-01-28 2B 022 +#> 13: 2021-01-31 2B 065
        # The dates in which Sentinel-2A will pass in next six weeks over one orbit s2_dop("022", "6 weeks", mission = "2A")$date -
        #> [1] "2020-10-05" "2020-10-15" "2020-10-25" "2020-11-04" "2020-11-14"
        +
        #> [1] "2021-01-13" "2021-01-23" "2021-02-02" "2021-02-12"
        # The date in which Sentinel-2A would be passed in the last 10 days over one orbit s2_dop("022", "-10 days", mission = "2A")$date -
        #> [1] "2020-10-05"
        +
        #> [1] "2021-01-03"
        # All the orbits covered today s2_dop(timewindow = Sys.Date(), mission = "2B")$orbit -
        #> [1] "030" "031" "032" "033" "034" "035" "036" "037" "038" "039" "040" "041" -#> [13] "042" "043" "044"
        +
        #> [1] "116" "117" "118" "119" "120" "121" "122" "123" "124" "125" "126" "127" +#> [13] "128" "129" "130"
        # The passages in a fixed time window for one orbit s2_dop(65, as.Date(c("2018-08-01", "2018-08-31")))
        #> date mission orbit diff --git a/docs/reference/s2_download.html b/docs/reference/s2_download.html index 53caddf4..c4104294 100644 --- a/docs/reference/s2_download.html +++ b/docs/reference/s2_download.html @@ -75,7 +75,7 @@ sen2r - 1.3.9 + 1.4.0
        @@ -239,13 +239,13 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2020) luigi@ranghetti.info

        -

        Lorenzo Busetto, phD (2019) lbusett@gmail.com

        +

        Lorenzo Busetto, phD (2019)

        Examples

        if (FALSE) { diff --git a/docs/reference/s2_gui.html b/docs/reference/s2_gui.html index a8b920eb..283b9775 100644 --- a/docs/reference/s2_gui.html +++ b/docs/reference/s2_gui.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0
        @@ -190,9 +190,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/s2_list.html b/docs/reference/s2_list.html index 2b3baab3..aa886d68 100644 --- a/docs/reference/s2_list.html +++ b/docs/reference/s2_list.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -278,12 +278,12 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        -

        Lorenzo Busetto, phD (2019) lbusett@gmail.com - Inspired by +

        Lorenzo Busetto, phD (2019) - Inspired by function getSentinel_query of package getSpatialData by J. Schwalb-Willmann

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/s2_mask-1.png b/docs/reference/s2_mask-1.png index 7daa2306..2d2d00ec 100644 Binary files a/docs/reference/s2_mask-1.png and b/docs/reference/s2_mask-1.png differ diff --git a/docs/reference/s2_mask.html b/docs/reference/s2_mask.html index fef00c02..ea78a64e 100644 --- a/docs/reference/s2_mask.html +++ b/docs/reference/s2_mask.html @@ -77,7 +77,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -383,9 +383,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        @@ -409,18 +409,21 @@

        Examp mask_type = "land", outdir = tempdir() ) -
        #> [2020-10-11 08:34:59] Masking file +
        #> [2021-01-05 17:07:52] Masking file #> S2A2A_20190723_022_Barbellino_RGB432B_10.tif...
        ex_out -
        #> [1] "/tmp/RtmpZIH1VX/S2A2A_20190723_022_Barbellino_RGB432B_10.tif" +
        #> [1] "/tmp/RtmpIwBWvo/S2A2A_20190723_022_Barbellino_RGB432B_10.tif" #> attr(,"toomasked") #> character(0)
        # Show output oldpar <- par(mfrow = c(1,3)) -par(mar = rep(0,4)); image(stars::read_stars(ex_in), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        par(mar = rep(2/3,4)); image(stars::read_stars(ex_mask)) -
        #> Error in if (useRaster) { if (check_irregular(x, y)) stop(gettextf("%s can only be used with a regular grid", sQuote("useRaster = TRUE")), domain = NA) if (!is.character(col)) { col <- as.integer(col) if (any(!is.na(col) & col < 0L)) stop("integer colors must be non-negative") col[col < 1L] <- NA_integer_ p <- palette() col <- p[((col - 1L)%%length(p)) + 1L] } zc <- col[zi + 1L] dim(zc) <- dim(z) zc <- t(zc)[ncol(zc):1L, , drop = FALSE] rasterImage(as.raster(zc), min(x), min(y), max(x), max(y), interpolate = FALSE)} else .External.graphics(C_image, x, y, zi, col): valore mancante dove è richiesto TRUE/FALSE
        par(mar = rep(0,4)); image(stars::read_stars(ex_out), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        par(oldpar) -
        # } +par(mar = rep(0,4)) +image(stars::read_stars(ex_in), rgb = 1:3, useRaster = TRUE) +par(mar = rep(2/3,4)) +image(stars::read_stars(ex_mask), useRaster = TRUE) +par(mar = rep(0,4)) +image(stars::read_stars(ex_out), rgb = 1:3, useRaster = TRUE) +
        par(oldpar) +# }

        @@ -289,9 +289,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/s2_order.html b/docs/reference/s2_order.html index a19ba545..6d29f727 100644 --- a/docs/reference/s2_order.html +++ b/docs/reference/s2_order.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -241,13 +241,13 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        -

        Lorenzo Busetto, phD (2020) lbusett@gmail.com

        +

        Lorenzo Busetto, phD (2020)

        Examples

        # \donttest{ @@ -273,15 +273,15 @@

        Examp # Order the products ordered_prods <- s2_order(list_safe) -

        #> [2020-10-11 08:35:17] Check if products are already available for -#> download...
        #> [2020-10-11 08:35:17] Ordering 7 Sentinel-2 images stored in the Long -#> Term Archive...
        #> [2020-10-11 08:35:23] 7 of 7 Sentinel-2 images were correctly ordered. +
        #> [2021-01-05 17:08:13] Check if products are already available for +#> download...
        #> [2021-01-05 17:08:14] Ordering 7 Sentinel-2 images stored in the Long +#> Term Archive...
        #> [2021-01-05 17:08:20] 7 of 7 Sentinel-2 images were correctly ordered. #> You can check at a later time if the ordered products are #> available online using the command: -#>   safe_is_online("/home/lranghetti/.sen2r/lta_orders/lta_20201011_083523.json")
        +#>   safe_is_online("/home/lranghetti/.sen2r/lta_orders/lta_20210105_170820.json")
        # Check in a second time if the product was made available (order_path <- attr(ordered_prods, "path")) -
        #> [1] "/home/lranghetti/.sen2r/lta_orders/lta_20201011_083523.json"
        safe_is_online(order_path) +
        #> [1] "/home/lranghetti/.sen2r/lta_orders/lta_20210105_170820.json"
        safe_is_online(order_path)
        #> 0 out of 7 products are online.
        #> S2B_MSIL1C_20180224T133629_N0206_R038_T21FVC_20180224T194845.SAFE #> FALSE #> S2B_MSIL1C_20180227T134629_N0206_R081_T21FVC_20180227T200327.SAFE diff --git a/docs/reference/s2_rgb-1.png b/docs/reference/s2_rgb-1.png index 45594afb..1d316b14 100644 Binary files a/docs/reference/s2_rgb-1.png and b/docs/reference/s2_rgb-1.png differ diff --git a/docs/reference/s2_rgb.html b/docs/reference/s2_rgb.html index 42c07948..3708537a 100644 --- a/docs/reference/s2_rgb.html +++ b/docs/reference/s2_rgb.html @@ -72,7 +72,7 @@ sen2r - 1.3.9 + 1.4.0
        @@ -303,9 +303,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        @@ -326,17 +326,17 @@

        Examp outdir = tempdir(), compress = 50 ) -
        #> [2020-10-11 08:35:24] Generating image -#> S2A2A_20190723_022_Barbellino_RGBb84B_10.tif...
        #> [2020-10-11 08:35:34] Generating image +
        #> [2021-01-05 17:08:22] Generating image +#> S2A2A_20190723_022_Barbellino_RGBb84B_10.tif...
        #> [2021-01-05 17:08:28] Generating image #> S2A2A_20190723_022_Barbellino_RGB954B_10.tif...
        #> 2 output RGB files were correctly created.
        ex_out -
        #> [1] "/tmp/RtmpZIH1VX/RGBb84B/S2A2A_20190723_022_Barbellino_RGBb84B_10.tif" -#> [2] "/tmp/RtmpZIH1VX/RGB954B/S2A2A_20190723_022_Barbellino_RGB954B_10.tif"
        +
        #> [1] "/tmp/RtmpIwBWvo/RGBb84B/S2A2A_20190723_022_Barbellino_RGBb84B_10.tif" +#> [2] "/tmp/RtmpIwBWvo/RGB954B/S2A2A_20190723_022_Barbellino_RGB954B_10.tif"
        # Show output oldpar <- par(mfrow = c(1,3), mar = rep(0,4)) -image(stars::read_stars(ex_in), rgb = 4:2, maxColorValue = 3500) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        image(stars::read_stars(ex_out[1]), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        image(stars::read_stars(ex_out[2]), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        par(oldpar) +image(stars::read_stars(ex_in), rgb = 4:2, maxColorValue = 3500, useRaster = TRUE) +image(stars::read_stars(ex_out[1]), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(ex_out[2]), rgb = 1:3, useRaster = TRUE) +
        par(oldpar) # }

        diff --git a/docs/reference/s2_thumbnails.html b/docs/reference/s2_thumbnails.html index 5923e149..51be3003 100644 --- a/docs/reference/s2_thumbnails.html +++ b/docs/reference/s2_thumbnails.html @@ -77,7 +77,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -276,9 +276,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/s2_tiles.html b/docs/reference/s2_tiles.html index c8363de5..0418258c 100644 --- a/docs/reference/s2_tiles.html +++ b/docs/reference/s2_tiles.html @@ -74,7 +74,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -178,9 +178,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        @@ -195,11 +195,11 @@

        Examp httr::write_disk(ch_path <- tempfile()) )
        #> Response [https://raw.githubusercontent.com/ranghetti/sen2r/master/utils/vector/ch_bound.rds] -#> Date: 2020-10-11 06:36 +#> Date: 2021-01-05 16:11 #> Status: 200 #> Content-Type: application/octet-stream #> Size: 43.8 kB -#> <ON DISK> /tmp/RtmpZIH1VX/file16203292cdd59
        ch <- readRDS(ch_path) +#> <ON DISK> /tmp/RtmpIwBWvo/file9d5a359eec5bb
        ch <- readRDS(ch_path) s2tiles_ch <- s2tiles[suppressMessages(sf::st_intersects(ch, s2tiles))[[1]],] s2_coords <- sf::st_coordinates(suppressWarnings(sf::st_centroid(s2tiles_ch))) diff --git a/docs/reference/s2_translate.html b/docs/reference/s2_translate.html index b57c8f64..73d14bfa 100644 --- a/docs/reference/s2_translate.html +++ b/docs/reference/s2_translate.html @@ -75,7 +75,7 @@ sen2r - 1.3.9 + 1.4.0
        @@ -290,9 +290,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/safe_getMetadata.html b/docs/reference/safe_getMetadata.html index 4b71fe73..f50d90b0 100644 --- a/docs/reference/safe_getMetadata.html +++ b/docs/reference/safe_getMetadata.html @@ -77,7 +77,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -320,9 +320,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/safe_is_online.html b/docs/reference/safe_is_online.html index 04c4624b..af650537 100644 --- a/docs/reference/safe_is_online.html +++ b/docs/reference/safe_is_online.html @@ -74,7 +74,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -203,13 +203,13 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        -

        Lorenzo Busetto, phD (2020) lbusett@gmail.com

        +

        Lorenzo Busetto, phD (2020)

        Examples

        # \donttest{ diff --git a/docs/reference/safe_shortname.html b/docs/reference/safe_shortname.html index 100aa731..b0bbb7b1 100644 --- a/docs/reference/safe_shortname.html +++ b/docs/reference/safe_shortname.html @@ -77,7 +77,7 @@ sen2r - 1.3.9.9001 + 1.4.0
        @@ -171,19 +171,19 @@

        Rename products using a shorten convention

        Old long names are no more supported.

        -
        safe_shortname(
        -  prod_name,
        -  prod_type = NULL,
        -  ext = NULL,
        -  res = "10m",
        -  tiles = NULL,
        -  force_tiles = NULL,
        -  full.name = TRUE,
        -  allow_duplicated = FALSE,
        -  set.seed = NULL,
        -  multiple_names = NULL,
        -  abort = FALSE
        -)
        +
        safe_shortname(
        +  prod_name,
        +  prod_type = NULL,
        +  ext = NULL,
        +  res = "10m",
        +  tiles = NULL,
        +  force_tiles = NULL,
        +  full.name = TRUE,
        +  allow_duplicated = FALSE,
        +  set.seed = NULL,
        +  multiple_names = NULL,
        +  abort = FALSE
        +)

        Arguments

        @@ -286,15 +286,15 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        Examples

        -
        safe_shortname("S2A_MSIL1C_20170603T101031_N0205_R022_T32TQQ_20170603T101026.SAFE", ext="tif") +
        safe_shortname("S2A_MSIL1C_20170603T101031_N0205_R022_T32TQQ_20170603T101026.SAFE", ext="tif")
        #> [1] "S2A1C_20170603_022_32TQQ_TOA_10.tif"
        @@ -202,9 +202,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/scihub_login.html b/docs/reference/scihub_login.html index 41e3bccd..c7a910ef 100644 --- a/docs/reference/scihub_login.html +++ b/docs/reference/scihub_login.html @@ -77,7 +77,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -238,13 +238,13 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        -

        Lorenzo Busetto, phD (2019) lbusett@gmail.com

        +

        Lorenzo Busetto, phD (2019)

        Examples

        check_scihub_login("user", "user") diff --git a/docs/reference/sen2cor.html b/docs/reference/sen2cor.html index f072cdd1..63193d38 100644 --- a/docs/reference/sen2cor.html +++ b/docs/reference/sen2cor.html @@ -75,7 +75,7 @@ sen2r - 1.3.9 + 1.4.0
        @@ -163,7 +163,7 @@

        Correct L1C products using Sen2Cor

        The function uses Sen2Cor to manually correct L1C products. Standalone version of -sen2cor +sen2cor (version 2.8.0 or 2.5.5) is used.

        @@ -242,8 +242,8 @@

        Arg both "NONE" and NA can be used, but not NULL, which has the effect to maintain the value specified in the XML file).

        For details about the GIPP parameters, refer to the Sen2Cor documentation -(v. 2.5.5 -or 2.8.0: +(v. 2.5.5 +or 2.8.0: see the "Schemas of the GIPP file" at the end of each page). Note: this argument takes effect only in the current execution of sen2cor() function.

        @@ -336,9 +336,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/sen2r-1.png b/docs/reference/sen2r-1.png index 47b2a4de..4b0ebcc3 100644 Binary files a/docs/reference/sen2r-1.png and b/docs/reference/sen2r-1.png differ diff --git a/docs/reference/sen2r-2.png b/docs/reference/sen2r-2.png index a4fbdd1e..294c7b6b 100644 Binary files a/docs/reference/sen2r-2.png and b/docs/reference/sen2r-2.png differ diff --git a/docs/reference/sen2r-3.png b/docs/reference/sen2r-3.png index 636862c6..e4b6e7b4 100644 Binary files a/docs/reference/sen2r-3.png and b/docs/reference/sen2r-3.png differ diff --git a/docs/reference/sen2r-4.png b/docs/reference/sen2r-4.png index b6ccad82..5a0e80be 100644 Binary files a/docs/reference/sen2r-4.png and b/docs/reference/sen2r-4.png differ diff --git a/docs/reference/sen2r-5.png b/docs/reference/sen2r-5.png index d28e5388..44352669 100644 Binary files a/docs/reference/sen2r-5.png and b/docs/reference/sen2r-5.png differ diff --git a/docs/reference/sen2r-6.png b/docs/reference/sen2r-6.png index 856f59ea..6aa7cdaf 100644 Binary files a/docs/reference/sen2r-6.png and b/docs/reference/sen2r-6.png differ diff --git a/docs/reference/sen2r.html b/docs/reference/sen2r.html index 41c0dd5b..bf215e99 100644 --- a/docs/reference/sen2r.html +++ b/docs/reference/sen2r.html @@ -76,7 +76,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -744,13 +744,13 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2020) luigi@ranghetti.info

        -

        Lorenzo Busetto, phD (2020) lbusett@gmail.com

        +

        Lorenzo Busetto, phD (2020)

        Examples

        # \donttest{ @@ -764,22 +764,22 @@

        Examp json_path <- build_example_param_file() out_paths_2 <- sen2r(json_path) -

        #> [2020-10-11 08:36:29] #### Starting sen2r execution. ####
        #> Loading required namespace: stringi
        #> Registered S3 method overwritten by 'geojsonlint': +
        #> [2021-01-05 17:09:03] #### Starting sen2r execution. ####
        #> Loading required namespace: stringi
        #> Registered S3 method overwritten by 'geojsonlint': #> method from -#> print.location dplyr
        #> [2020-10-11 08:36:31] Searching for available SAFE products on -#> SciHub...
        #> [2020-10-11 08:36:35] Computing output names...
        #> [2020-10-11 08:36:36] Starting to download the required level-2A SAFE +#> print.location dplyr
        #> [2021-01-05 17:09:03] Searching for available SAFE products on +#> SciHub...
        #> [2021-01-05 17:09:06] Computing output names...
        #> [2021-01-05 17:09:07] Starting to download the required level-2A SAFE #> products.
        #> Images #> S2B_MSIL2A_20200801T100559_N0214_R022_T32TNS_20200801T135302.SAFE are #> already on your system and will be skipped. Set "overwrite_safe" to -#> TRUE to re-download them.
        #> No L2A images are needed.
        #> [2020-10-11 08:36:36] Download of level-2A SAFE products terminated.
        #> [2020-10-11 08:36:36] Starting to download the required level-1C SAFE -#> products.
        #> No L1C images are needed.
        #> [2020-10-11 08:36:36] Download of level-1C SAFE products terminated.
        #> [2020-10-11 08:36:36] Updating output names...
        #> [2020-10-11 08:36:36] Starting to translate SAFE products in custom -#> format.
        #> Using UTM zone 32N.
        #> 2 output files were correctly created.
        #> [2020-10-11 08:36:36] Starting to merge tiles by orbit.
        #> Using projection "EPSG:32632".
        #> [2020-10-11 08:36:37] Starting to edit geometry (clip, reproject, -#> rescale).
        #> [2020-10-11 08:36:37] Producing required RGB images.
        #> [2020-10-11 08:36:37] Generating image -#> S2B2A_20200801_022_sen2r_RGB432B_10.tif...
        #> [2020-10-11 08:36:48] Generating image -#> S2B2A_20200801_022_sen2r_RGB843B_10.tif...
        #> 2 output RGB files were correctly created.
        #> [2020-10-11 08:37:20] Computing required spectral indices.
        #> [2020-10-11 08:37:21] Computing index MSAVI2 on date 2020-08-01...
        #> [2020-10-11 08:37:32] Computing index NDVI on date 2020-08-01...
        #> [2020-10-11 08:37:44] Generating thumbnails.
        #> 6 output files were correctly created.
        #> ╔══════════════════════════════════════════════════════════════════════ +#> TRUE to re-download them.
        #> No L2A images are needed.
        #> [2021-01-05 17:09:07] Download of level-2A SAFE products terminated.
        #> [2021-01-05 17:09:07] Starting to download the required level-1C SAFE +#> products.
        #> No L1C images are needed.
        #> [2021-01-05 17:09:07] Download of level-1C SAFE products terminated.
        #> [2021-01-05 17:09:07] Updating output names...
        #> [2021-01-05 17:09:07] Starting to translate SAFE products in custom +#> format.
        #> Using UTM zone 32N.
        #> 2 output files were correctly created.
        #> [2021-01-05 17:09:08] Starting to merge tiles by orbit.
        #> Using projection "EPSG:32632".
        #> [2021-01-05 17:09:08] Starting to edit geometry (clip, reproject, +#> rescale).
        #> [2021-01-05 17:09:08] Producing required RGB images.
        #> [2021-01-05 17:09:09] Generating image +#> S2B2A_20200801_022_sen2r_RGB432B_10.tif...
        #> [2021-01-05 17:09:14] Generating image +#> S2B2A_20200801_022_sen2r_RGB843B_10.tif...
        #> 2 output RGB files were correctly created.
        #> [2021-01-05 17:09:31] Computing required spectral indices.
        #> [2021-01-05 17:09:31] Computing index MSAVI2 on date 2020-08-01...
        #> [2021-01-05 17:09:37] Computing index NDVI on date 2020-08-01...
        #> [2021-01-05 17:09:42] Generating thumbnails.
        #> 6 output files were correctly created.
        #> ╔══════════════════════════════════════════════════════════════════════ #> ║ sen2r Processing Report -#> ╟──────────────────────────────────────────────────────────────────────
        #> ║ Dates to be processed based on processing parameters: 1
        #> ║ Processing completed for: all expected dates.
        #> ╚══════════════════════════════════════════════════════════════════════
        #> [2020-10-11 08:37:57] #### sen2r session terminated. ####
        #> The processing chain can be re-launched with the command: -#>   sen2r("/home/lranghetti/.sen2r/proc_par/s2proc_20201011_083630.json")
        # Notice that passing the path of a JSON file results in launching +#> ╟──────────────────────────────────────────────────────────────────────
        #> ║ Dates to be processed based on processing parameters: 1
        #> ║ Processing completed for: all expected dates.
        #> ╚══════════════════════════════════════════════════════════════════════
        #> [2021-01-05 17:09:49] #### sen2r session terminated. ####
        #> The processing chain can be re-launched with the command: +#>   sen2r("/home/lranghetti/.sen2r/proc_par/s2proc_20210105_170903.json")
        # Notice that passing the path of a JSON file results in launching # a session without opening the gui, unless gui = TRUE is passed. # Launch a processing using function arguments @@ -800,26 +800,26 @@

        Examp path_l2a = safe_dir, path_out = out_dir_3 ) -

        #> [2020-10-11 08:37:58] #### Starting sen2r execution. ####
        #> [2020-10-11 08:37:58] Searching for available SAFE products on -#> SciHub...
        #> [2020-10-11 08:38:03] Computing output names...
        #> [2020-10-11 08:38:04] Starting to download the required level-2A SAFE +
        #> [2021-01-05 17:09:49] #### Starting sen2r execution. ####
        #> [2021-01-05 17:09:49] Searching for available SAFE products on +#> SciHub...
        #> [2021-01-05 17:09:53] Computing output names...
        #> [2021-01-05 17:09:53] Starting to download the required level-2A SAFE #> products.
        #> Images #> S2B_MSIL2A_20200801T100559_N0214_R022_T32TNS_20200801T135302.SAFE are #> already on your system and will be skipped. Set "overwrite_safe" to -#> TRUE to re-download them.
        #> No L2A images are needed.
        #> [2020-10-11 08:38:04] Download of level-2A SAFE products terminated.
        #> [2020-10-11 08:38:04] Starting to download the required level-1C SAFE +#> TRUE to re-download them.
        #> No L2A images are needed.
        #> [2021-01-05 17:09:53] Download of level-2A SAFE products terminated.
        #> [2021-01-05 17:09:53] Starting to download the required level-1C SAFE #> products.
        #> Images #> S2B_MSIL1C_20200801T100559_N0209_R022_T32TNS_20200801T130136.SAFE are #> already on your system and will be skipped. Set "overwrite_safe" to -#> TRUE to re-download them.
        #> No L1C images are needed.
        #> [2020-10-11 08:38:04] Download of level-1C SAFE products terminated.
        #> [2020-10-11 08:38:04] Updating output names...
        #> [2020-10-11 08:38:05] Starting to translate SAFE products in custom -#> format.
        #> Using UTM zone 32N.
        #> 1 output files were correctly created.
        #> Using UTM zone 32N.
        #> 2 output files were correctly created.
        #> [2020-10-11 08:38:05] Starting to merge tiles by orbit.
        #> Using projection "EPSG:32632".
        #> [2020-10-11 08:38:05] Starting to edit geometry (clip, reproject, -#> rescale).
        #> [2020-10-11 08:38:06] Starting to apply cloud masks.
        #> [2020-10-11 08:38:06] Masking file -#> S2B1C_20200801_022_Barbellino_TOA_10.tif...
        #> [2020-10-11 08:38:15] Masking file -#> S2B2A_20200801_022_Barbellino_BOA_10.tif...
        #> [2020-10-11 08:38:26] Producing required RGB images.
        #> [2020-10-11 08:38:26] Generating image -#> S2B1C_20200801_022_Barbellino_RGB432T_10.tif...
        #> 1 output RGB files were correctly created.
        #> [2020-10-11 08:38:38] Generating image -#> S2B2A_20200801_022_Barbellino_RGB432B_10.tif...
        #> [2020-10-11 08:38:54] Generating image -#> S2B2A_20200801_022_Barbellino_RGB843B_10.tif...
        #> 2 output RGB files were correctly created.
        #> [2020-10-11 08:39:42] Computing required spectral indices.
        #> [2020-10-11 08:39:42] Computing index NDVI on date 2020-08-01...
        #> [2020-10-11 08:39:43] Computing index MSAVI2 on date 2020-08-01...
        #> [2020-10-11 08:39:45] Generating thumbnails.
        #> 8 output files were correctly created.
        #> ╔══════════════════════════════════════════════════════════════════════ +#> TRUE to re-download them.
        #> No L1C images are needed.
        #> [2021-01-05 17:09:53] Download of level-1C SAFE products terminated.
        #> [2021-01-05 17:09:53] Updating output names...
        #> [2021-01-05 17:09:54] Starting to translate SAFE products in custom +#> format.
        #> Using UTM zone 32N.
        #> 1 output files were correctly created.
        #> Using UTM zone 32N.
        #> 2 output files were correctly created.
        #> [2021-01-05 17:09:54] Starting to merge tiles by orbit.
        #> Using projection "EPSG:32632".
        #> [2021-01-05 17:09:55] Starting to edit geometry (clip, reproject, +#> rescale).
        #> [2021-01-05 17:09:55] Starting to apply cloud masks.
        #> [2021-01-05 17:09:55] Masking file +#> S2B1C_20200801_022_Barbellino_TOA_10.tif...
        #> [2021-01-05 17:10:01] Masking file +#> S2B2A_20200801_022_Barbellino_BOA_10.tif...
        #> [2021-01-05 17:10:07] Producing required RGB images.
        #> [2021-01-05 17:10:07] Generating image +#> S2B1C_20200801_022_Barbellino_RGB432T_10.tif...
        #> 1 output RGB files were correctly created.
        #> [2021-01-05 17:10:13] Generating image +#> S2B2A_20200801_022_Barbellino_RGB432B_10.tif...
        #> [2021-01-05 17:10:19] Generating image +#> S2B2A_20200801_022_Barbellino_RGB843B_10.tif...
        #> 2 output RGB files were correctly created.
        #> [2021-01-05 17:10:35] Computing required spectral indices.
        #> [2021-01-05 17:10:35] Computing index NDVI on date 2020-08-01...
        #> [2021-01-05 17:10:36] Computing index MSAVI2 on date 2020-08-01...
        #> [2021-01-05 17:10:36] Generating thumbnails.
        #> 8 output files were correctly created.
        #> ╔══════════════════════════════════════════════════════════════════════ #> ║ sen2r Processing Report -#> ╟──────────────────────────────────────────────────────────────────────
        #> ║ Dates to be processed based on processing parameters: 1
        #> ║ Processing completed for: all expected dates.
        #> ╚══════════════════════════════════════════════════════════════════════
        #> [2020-10-11 08:40:18] #### sen2r session terminated. ####
        #> The processing chain can be re-launched with the command: -#>   sen2r("/home/lranghetti/.sen2r/proc_par/s2proc_20201011_083758.json")
        +#> ╟──────────────────────────────────────────────────────────────────────
        #> ║ Dates to be processed based on processing parameters: 1
        #> ║ Processing completed for: all expected dates.
        #> ╚══════════════════════════════════════════════════════════════════════
        #> [2021-01-05 17:10:48] #### sen2r session terminated. ####
        #> The processing chain can be re-launched with the command: +#>   sen2r("/home/lranghetti/.sen2r/proc_par/s2proc_20210105_170949.json")
        # Launch a processing based on a JSON file, but changing some parameters # (e.g., the same processing on a different extent) out_dir_4 <- tempfile(pattern = "Scalve_") @@ -829,21 +829,21 @@

        Examp extent_name = "Scalve", path_out = out_dir_4 ) -

        #> [2020-10-11 08:40:18] #### Starting sen2r execution. ####
        #> [2020-10-11 08:40:19] Searching for available SAFE products on -#> SciHub...
        #> [2020-10-11 08:40:23] Computing output names...
        #> [2020-10-11 08:40:25] Starting to download the required level-2A SAFE +
        #> [2021-01-05 17:10:48] #### Starting sen2r execution. ####
        #> [2021-01-05 17:10:49] Searching for available SAFE products on +#> SciHub...
        #> [2021-01-05 17:10:52] Computing output names...
        #> [2021-01-05 17:10:52] Starting to download the required level-2A SAFE #> products.
        #> Images #> S2B_MSIL2A_20200801T100559_N0214_R022_T32TNR_20200801T135302.SAFE, #> S2B_MSIL2A_20200801T100559_N0214_R022_T32TNS_20200801T135302.SAFE are #> already on your system and will be skipped. Set "overwrite_safe" to -#> TRUE to re-download them.
        #> No L2A images are needed.
        #> [2020-10-11 08:40:25] Download of level-2A SAFE products terminated.
        #> [2020-10-11 08:40:25] Starting to download the required level-1C SAFE -#> products.
        #> No L1C images are needed.
        #> [2020-10-11 08:40:25] Download of level-1C SAFE products terminated.
        #> [2020-10-11 08:40:25] Updating output names...
        #> [2020-10-11 08:40:25] Starting to translate SAFE products in custom -#> format.
        #> Using UTM zone 32N.
        #> 2 output files were correctly created.
        #> Using UTM zone 32N.
        #> 2 output files were correctly created.
        #> [2020-10-11 08:40:25] Starting to merge tiles by orbit.
        #> Using projection "EPSG:32632".
        #> [2020-10-11 08:40:26] Starting to edit geometry (clip, reproject, -#> rescale).
        #> [2020-10-11 08:40:32] Producing required RGB images.
        #> [2020-10-11 08:40:32] Generating image -#> S2B2A_20200801_022_Scalve_RGB432B_10.tif...
        #> [2020-10-11 08:40:39] Generating image -#> S2B2A_20200801_022_Scalve_RGB843B_10.tif...
        #> 2 output RGB files were correctly created.
        #> [2020-10-11 08:40:47] Computing required spectral indices.
        #> [2020-10-11 08:40:47] Computing index MSAVI2 on date 2020-08-01...
        #> [2020-10-11 08:40:52] Computing index NDVI on date 2020-08-01...
        #> [2020-10-11 08:40:57] Generating thumbnails.
        #> 6 output files were correctly created.
        #> ╔══════════════════════════════════════════════════════════════════════ +#> TRUE to re-download them.
        #> No L2A images are needed.
        #> [2021-01-05 17:10:52] Download of level-2A SAFE products terminated.
        #> [2021-01-05 17:10:52] Starting to download the required level-1C SAFE +#> products.
        #> No L1C images are needed.
        #> [2021-01-05 17:10:52] Download of level-1C SAFE products terminated.
        #> [2021-01-05 17:10:52] Updating output names...
        #> [2021-01-05 17:10:53] Starting to translate SAFE products in custom +#> format.
        #> Using UTM zone 32N.
        #> 2 output files were correctly created.
        #> Using UTM zone 32N.
        #> 2 output files were correctly created.
        #> [2021-01-05 17:10:53] Starting to merge tiles by orbit.
        #> Using projection "EPSG:32632".
        #> [2021-01-05 17:10:53] Starting to edit geometry (clip, reproject, +#> rescale).
        #> [2021-01-05 17:11:00] Producing required RGB images.
        #> [2021-01-05 17:11:00] Generating image +#> S2B2A_20200801_022_Scalve_RGB432B_10.tif...
        #> [2021-01-05 17:11:03] Generating image +#> S2B2A_20200801_022_Scalve_RGB843B_10.tif...
        #> 2 output RGB files were correctly created.
        #> [2021-01-05 17:11:06] Computing required spectral indices.
        #> [2021-01-05 17:11:06] Computing index MSAVI2 on date 2020-08-01...
        #> [2021-01-05 17:11:08] Computing index NDVI on date 2020-08-01...
        #> [2021-01-05 17:11:10] Generating thumbnails.
        #> 6 output files were correctly created.
        #> ╔══════════════════════════════════════════════════════════════════════ #> ║ sen2r Processing Report -#> ╟──────────────────────────────────────────────────────────────────────
        #> ║ Dates to be processed based on processing parameters: 2
        #> ║ Processing completed for: all expected dates.
        #> ╚══════════════════════════════════════════════════════════════════════
        #> [2020-10-11 08:41:03] #### sen2r session terminated. ####
        #> The processing chain can be re-launched with the command: -#>   sen2r("/home/lranghetti/.sen2r/proc_par/s2proc_20201011_084018.json")
        +#> ╟──────────────────────────────────────────────────────────────────────
        #> ║ Dates to be processed based on processing parameters: 2
        #> ║ Processing completed for: all expected dates.
        #> ╚══════════════════════════════════════════════════════════════════════
        #> [2021-01-05 17:11:13] #### sen2r session terminated. ####
        #> The processing chain can be re-launched with the command: +#>   sen2r("/home/lranghetti/.sen2r/proc_par/s2proc_20210105_171048.json")
        # Show outputs (loading thumbnails) @@ -856,29 +856,29 @@

        Examp gsub("jpg$", "png", thumb_4[grep("SCL", thumb_4)]) oldpar <- par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(thumb_3[grep("BOA", thumb_3)]), rgb = 1:3) -

        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        image(stars::read_stars(thumb_3[grep("SCL", thumb_3)]), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        +image(stars::read_stars(thumb_3[grep("BOA", thumb_3)]), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(thumb_3[grep("SCL", thumb_3)]), rgb = 1:3, useRaster = TRUE) +
        par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(thumb_3[grep("MSAVI2", thumb_3)]), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        image(stars::read_stars(thumb_3[grep("NDVI", thumb_3)]), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        +image(stars::read_stars(thumb_3[grep("MSAVI2", thumb_3)]), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(thumb_3[grep("NDVI", thumb_3)]), rgb = 1:3, useRaster = TRUE) +
        par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(thumb_3[grep("RGB432B", thumb_3)]), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        image(stars::read_stars(thumb_3[grep("RGB843B", thumb_3)]), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        +image(stars::read_stars(thumb_3[grep("RGB432B", thumb_3)]), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(thumb_3[grep("RGB843B", thumb_3)]), rgb = 1:3, useRaster = TRUE) +
        par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(thumb_4[grep("BOA", thumb_4)]), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        image(stars::read_stars(thumb_4[grep("SCL", thumb_4)]), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        +image(stars::read_stars(thumb_4[grep("BOA", thumb_4)]), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(thumb_4[grep("SCL", thumb_4)]), rgb = 1:3, useRaster = TRUE) +
        par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(thumb_4[grep("MSAVI2", thumb_4)]), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        image(stars::read_stars(thumb_4[grep("NDVI", thumb_4)]), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        +image(stars::read_stars(thumb_4[grep("MSAVI2", thumb_4)]), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(thumb_4[grep("NDVI", thumb_4)]), rgb = 1:3, useRaster = TRUE) +
        par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(thumb_4[grep("RGB432B", thumb_4)]), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        image(stars::read_stars(thumb_4[grep("RGB843B", thumb_4)]), rgb = 1:3) -
        #> Error in if (!useRaster) stop("rgb plotting not supported on this device"): valore mancante dove è richiesto TRUE/FALSE
        +image(stars::read_stars(thumb_4[grep("RGB432B", thumb_4)]), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(thumb_4[grep("RGB843B", thumb_4)]), rgb = 1:3, useRaster = TRUE) +
        par(oldpar) # }
        diff --git a/docs/reference/sen2r_getElements.html b/docs/reference/sen2r_getElements.html index 1315cbfd..b5bf1831 100644 --- a/docs/reference/sen2r_getElements.html +++ b/docs/reference/sen2r_getElements.html @@ -74,7 +74,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -197,9 +197,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/sen2r_process_report.html b/docs/reference/sen2r_process_report.html index 7b91cd2d..6d8e406d 100644 --- a/docs/reference/sen2r_process_report.html +++ b/docs/reference/sen2r_process_report.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -260,12 +260,12 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        -

        Lorenzo Busetto, phD (2020) lbusett@gmail.com

        +

        Lorenzo Busetto, phD (2020)

        @@ -225,9 +225,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/st_as_text_2.html b/docs/reference/st_as_text_2.html index a14df508..fbd9dafd 100644 --- a/docs/reference/st_as_text_2.html +++ b/docs/reference/st_as_text_2.html @@ -78,7 +78,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -199,7 +199,7 @@

        AuthorExamples

        sen2r:::st_as_text_2(sf::st_crs(32632)) -
        #> [1] "PROJCRS[\"WGS 84 / UTM zone 32N\",\n BASEGEOGCRS[\"WGS 84\",\n DATUM[\"World Geodetic System 1984\",\n ELLIPSOID[\"WGS 84\",6378137,298.257223563,\n LENGTHUNIT[\"metre\",1]]],\n PRIMEM[\"Greenwich\",0,\n ANGLEUNIT[\"degree\",0.0174532925199433]],\n ID[\"EPSG\",4326]],\n CONVERSION[\"UTM zone 32N\",\n METHOD[\"Transverse Mercator\",\n ID[\"EPSG\",9807]],\n PARAMETER[\"Latitude of natural origin\",0,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8801]],\n PARAMETER[\"Longitude of natural origin\",9,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8802]],\n PARAMETER[\"Scale factor at natural origin\",0.9996,\n SCALEUNIT[\"unity\",1],\n ID[\"EPSG\",8805]],\n PARAMETER[\"False easting\",500000,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8806]],\n PARAMETER[\"False northing\",0,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8807]]],\n CS[Cartesian,2],\n AXIS[\"(E)\",east,\n ORDER[1],\n LENGTHUNIT[\"metre\",1]],\n AXIS[\"(N)\",north,\n ORDER[2],\n LENGTHUNIT[\"metre\",1]],\n USAGE[\n SCOPE[\"unknown\"],\n AREA[\"World - N hemisphere - 6°E to 12°E - by country\"],\n BBOX[0,6,84,12]],\n ID[\"EPSG\",32632]]"
        +
        #> [1] "PROJCS[\"WGS 84 / UTM zone 32N\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",9],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32632\"]]"
        @@ -212,9 +212,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/stack2rgb.html b/docs/reference/stack2rgb.html index a2809555..4134c84a 100644 --- a/docs/reference/stack2rgb.html +++ b/docs/reference/stack2rgb.html @@ -74,7 +74,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -258,9 +258,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/str_pad2.html b/docs/reference/str_pad2.html index cd0e2ce7..18dddfb9 100644 --- a/docs/reference/str_pad2.html +++ b/docs/reference/str_pad2.html @@ -76,7 +76,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -202,9 +202,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/suppress_warnings.html b/docs/reference/suppress_warnings.html index ed1bbe03..9caf74bc 100644 --- a/docs/reference/suppress_warnings.html +++ b/docs/reference/suppress_warnings.html @@ -72,7 +72,7 @@ sen2r - 1.3.9 + 1.4.0 diff --git a/docs/reference/tiles_intersects.html b/docs/reference/tiles_intersects.html index f5c25813..a7aca9f3 100644 --- a/docs/reference/tiles_intersects.html +++ b/docs/reference/tiles_intersects.html @@ -73,7 +73,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -205,9 +205,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/docs/reference/trace_function.html b/docs/reference/trace_function.html index efa776cd..ca70abd1 100644 --- a/docs/reference/trace_function.html +++ b/docs/reference/trace_function.html @@ -91,7 +91,7 @@ sen2r - 1.3.9 + 1.4.0 @@ -248,9 +248,9 @@

        R

        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: -10.1016/j.cageo.2020.104473, -URL: http://sen2r.ranghetti.info/.

        +Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. +doi: 10.1016/j.cageo.2020.104473 +, URL: http://sen2r.ranghetti.info/.

        Author

        Luigi Ranghetti, phD (2019) luigi@ranghetti.info

        diff --git a/index.Rmd b/index.Rmd index 77e700ac..79161437 100644 --- a/index.Rmd +++ b/index.Rmd @@ -74,7 +74,7 @@ was published on the ISI journal *Computers \& Geosciences*; the manuscript is a 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: 10.1016/j.cageo.2020.104473, +doi: 10.1016/j.cageo.2020.104473, URL: http://sen2r.ranghetti.info . @@ -142,8 +142,8 @@ This is a list of the principal processing functions to download Sentinel-2 products; * [`s2_order()`](reference/s2_order.md) to order products from the Long Term Archive; -* [`sen2cor()`](reference/sen2cor.html) - to correct level-1C products using [Sen2Cor](http://step.esa.int/main/third-party-plugins-2/sen2cor/); +* [`sen2cor()`](reference/sen2cor.md) + to correct level-1C products using [Sen2Cor](http://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) @@ -170,7 +170,7 @@ 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: 10.1016/j.cageo.2020.104473, +doi: 10.1016/j.cageo.2020.104473, URL: http://sen2r.ranghetti.info. ```bibtex diff --git a/index.md b/index.md index db2a0ff6..32f49938 100644 --- a/index.md +++ b/index.md @@ -1,6 +1,12 @@ - +- [sen2r: Find, Download and Process Sentinel-2 + Data](#sen2r-find-download-and-process-sentinel-2-data) + - [Installation](#installation) + - [Usage](#usage) + - [Credits](#credits) + - [Contributing](#contributing) + [![CRAN @@ -23,7 +29,10 @@ Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff6 # sen2r: Find, Download and Process Sentinel-2 Data -sen2r +sen2r 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 @@ -31,28 +40,32 @@ 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, -sen2r +In particular, sen2r allows to: - - retrieve the list of available products on a selected area (which +- 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 +- 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 +- 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 +- mask cloudy pixels (using the Surface Classification Map as masking layer); - - computing spectral indices and RGB images. +- computing spectral indices and RGB images. Setting the execution of this processing chain is particularly easy -using the -sen2r +using the sen2r 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. @@ -63,21 +76,22 @@ 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)). +(see [usage](#usage)). -sen2r +sen2r was published on the ISI journal *Computers & Geosciences*; the -manuscript is available -here: +manuscript is available here: 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: 10.1016/j.cageo.2020.104473, URL: +Geosciences, 139, 104473. doi: 10.1016/j.cageo.2020.104473, URL: http://sen2r.ranghetti.info . Users which processed Sentinel-2 data and used them for a scientific @@ -95,16 +109,20 @@ install.packages("sen2r") For detailed instructions about installing the package (including dependencies), see the [Installation](articles/installation.md) page. -A dockerised version of -sen2r +A dockerised version of sen2r 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 -sen2r +The simplest way to use sen2r is to execute it in interactive mode (see [this vignette](articles/sen2r_gui.md)): @@ -114,7 +132,6 @@ sen2r() ```

        - @@ -125,7 +142,6 @@ sen2r() -

        Alternatively, [`sen2r()`](reference/sen2r.md) can be launched with a @@ -137,20 +153,20 @@ 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 +- [`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 +- [`s2_download()`](reference/s2_download.md) to download Sentinel-2 products; - - [`s2_order()`](reference/s2_order.md) to order products from the +- [`s2_order()`](reference/s2_order.md) to order products from the Long Term Archive; - - [`sen2cor()`](reference/sen2cor.html) to correct level-1C products +- [`sen2cor()`](reference/sen2cor.md) to correct level-1C products using - [Sen2Cor](http://step.esa.int/main/third-party-plugins-2/sen2cor/); - - [`s2_mask()`](reference/s2_mask.md) to apply a cloud mask to + [Sen2Cor](http://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 +- [`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 +- [`s2_calcindices()`](reference/s2_calcindices.md) to compute maps of spectral indices from Sentinel-2 Surface Reflectance multiband raster files. @@ -161,14 +177,19 @@ Output products follow a specific naming convention (see -sen2r +sen2r 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). +General Public License version +3](https://www.gnu.org/licenses/gpl-3.0.html) (GPL‑3). -The -[sen2r +The [sen2r logo](https://github.com/ranghetti/sen2r/raw/master/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 @@ -179,7 +200,7 @@ 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: +satellite data”**. *Computers & Geosciences*, 139, 104473. doi: 10.1016/j.cageo.2020.104473, URL: http://sen2r.ranghetti.info. diff --git a/inst/CITATION b/inst/CITATION index cc782cc1..f8054fbf 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -18,6 +18,6 @@ citEntry( "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: 10.1016/j.cageo.2020.104473, URL: http://sen2r.ranghetti.info/." + "doi: 10.1016/j.cageo.2020.104473, URL: http://sen2r.ranghetti.info/." ) ) diff --git a/inst/extdata/settings/indices.json b/inst/extdata/settings/indices.json index 57bb6efd..288c724f 100644 --- a/inst/extdata/settings/indices.json +++ b/inst/extdata/settings/indices.json @@ -2091,6 +2091,6 @@ "s2_formula_mathml": "\n \n 2<\/mn>\n &InvisibleTimes;<\/mo>\n GREEN<\/mi>\n -<\/mo>\n (<\/mo>\n RED<\/mi>\n +<\/mo>\n BLUE<\/mi>\n )<\/mo>\n <\/mrow>\n<\/math>" } ], - "pkg_version": ["1.3.6.9002"], - "creation_date": ["2020-06-24 15:14:33"] + "pkg_version": ["1.4.0"], + "creation_date": ["2021-01-02 10:55:13"] } diff --git a/man/abs2rel.Rd b/man/abs2rel.Rd index 48debe98..02c591c7 100644 --- a/man/abs2rel.Rd +++ b/man/abs2rel.Rd @@ -57,9 +57,8 @@ suppressWarnings(abs2rel(ref_path, ref_path)) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2017) \email{luigi.ranghetti@gmail.com} diff --git a/man/add_rgb_image.Rd b/man/add_rgb_image.Rd index 2f7d5fb6..c61f7752 100644 --- a/man/add_rgb_image.Rd +++ b/man/add_rgb_image.Rd @@ -19,9 +19,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/add_tile_suffix.Rd b/man/add_tile_suffix.Rd index 2242252b..cdeb635c 100644 --- a/man/add_tile_suffix.Rd +++ b/man/add_tile_suffix.Rd @@ -65,9 +65,8 @@ sen2r:::remove_tile_suffix(prod_names_univoc) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2020) \email{luigi@ranghetti.info} diff --git a/man/build_example_param_file.Rd b/man/build_example_param_file.Rd index 3ee42c26..3f535881 100644 --- a/man/build_example_param_file.Rd +++ b/man/build_example_param_file.Rd @@ -33,9 +33,8 @@ build_example_param_file() \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/calcindex.Rd b/man/calcindex.Rd index 05952adc..f194a670 100644 --- a/man/calcindex.Rd +++ b/man/calcindex.Rd @@ -72,9 +72,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2020) \email{luigi@ranghetti.info} diff --git a/man/check_gdal.Rd b/man/check_gdal.Rd index 163d4984..80c8d51c 100644 --- a/man/check_gdal.Rd +++ b/man/check_gdal.Rd @@ -47,9 +47,8 @@ check_gdal() \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/check_gui_deps.Rd b/man/check_gui_deps.Rd index 002cb7fc..2a8b3b31 100644 --- a/man/check_gui_deps.Rd +++ b/man/check_gui_deps.Rd @@ -35,9 +35,8 @@ check_gui_deps() \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2020) \email{luigi@ranghetti.info} diff --git a/man/check_param_list.Rd b/man/check_param_list.Rd index ded885a0..bd7806c4 100644 --- a/man/check_param_list.Rd +++ b/man/check_param_list.Rd @@ -38,9 +38,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/check_sen2r_deps.Rd b/man/check_sen2r_deps.Rd index c23fef1f..8b0ad459 100644 --- a/man/check_sen2r_deps.Rd +++ b/man/check_sen2r_deps.Rd @@ -37,9 +37,8 @@ if (interactive()) { \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/compute_s2_paths.Rd b/man/compute_s2_paths.Rd index 0290f91c..46445674 100644 --- a/man/compute_s2_paths.Rd +++ b/man/compute_s2_paths.Rd @@ -260,9 +260,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/comsub.Rd b/man/comsub.Rd index 1948e20c..cd919d64 100644 --- a/man/comsub.Rd +++ b/man/comsub.Rd @@ -36,9 +36,8 @@ comsub(strings, sep="/") \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/create_indices_db.Rd b/man/create_indices_db.Rd index 5df94840..2662b14a 100644 --- a/man/create_indices_db.Rd +++ b/man/create_indices_db.Rd @@ -38,9 +38,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/create_s2_dop.Rd b/man/create_s2_dop.Rd index 180be2a2..4b731083 100644 --- a/man/create_s2_dop.Rd +++ b/man/create_s2_dop.Rd @@ -29,9 +29,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/expand_path.Rd b/man/expand_path.Rd index b9e1c733..f67d24b1 100644 --- a/man/expand_path.Rd +++ b/man/expand_path.Rd @@ -38,9 +38,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/expect_equal_crs.Rd b/man/expect_equal_crs.Rd index 68c3a94e..33081953 100644 --- a/man/expect_equal_crs.Rd +++ b/man/expect_equal_crs.Rd @@ -24,9 +24,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2020) \email{luigi@ranghetti.info} diff --git a/man/fix_envi_format.Rd b/man/fix_envi_format.Rd index 652c2657..f653bd46 100644 --- a/man/fix_envi_format.Rd +++ b/man/fix_envi_format.Rd @@ -31,9 +31,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/gdalUtil.Rd b/man/gdalUtil.Rd index e1f36e28..7e79e8d1 100644 --- a/man/gdalUtil.Rd +++ b/man/gdalUtil.Rd @@ -73,8 +73,8 @@ gdalUtil( options = c("-tr", "2", "2", "-r", "cubicspline", "-co", "COMPRESS=DEFLATE") ) oldpar <- par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(examplename), rgb = c(11,8,4)) -image(stars::read_stars(outname1), rgb = c(11,8,4)) +image(stars::read_stars(examplename), rgb = c(11,8,4), useRaster = TRUE) +image(stars::read_stars(outname1), rgb = c(11,8,4), useRaster = TRUE) ## gdalwarp outname2 <- tempfile(fileext = ".tif") @@ -84,8 +84,8 @@ gdalUtil( options = c("-t_srs", "EPSG:32633", "-co", "COMPRESS=DEFLATE") ) oldpar <- par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(examplename), rgb = c(11,8,4)) -image(stars::read_stars(outname2), rgb = c(11,8,4)) +image(stars::read_stars(examplename), rgb = c(11,8,4), useRaster = TRUE) +image(stars::read_stars(outname2), rgb = c(11,8,4), useRaster = TRUE) ## gdal_calc outname3 <- tempfile(fileext = ".tif") @@ -100,16 +100,15 @@ gdalUtil( options = c("--A_band", "8", "--B_band", "4", "--type", "Int16") ) oldpar <- par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(ndvirefname)) -image(stars::read_stars(outname3)) +image(stars::read_stars(ndvirefname), useRaster = TRUE) +image(stars::read_stars(outname3), useRaster = TRUE) } } \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2020) \email{luigi@ranghetti.info} diff --git a/man/gdal_abs2rel_rel2abs.Rd b/man/gdal_abs2rel_rel2abs.Rd index bd70b802..6adff7bf 100644 --- a/man/gdal_abs2rel_rel2abs.Rd +++ b/man/gdal_abs2rel_rel2abs.Rd @@ -57,9 +57,8 @@ rel_vrt_content[ex_vrt_content != rel_vrt_content] # No edits \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/gdal_warp.Rd b/man/gdal_warp.Rd index aad8fbdc..965f1a59 100644 --- a/man/gdal_warp.Rd +++ b/man/gdal_warp.Rd @@ -116,12 +116,12 @@ gdal_warp(ex_sel, test2, mask = crop_poly) # Show output crop_bbox <- sf::st_as_sfc(sf::st_bbox(crop_line)) oldpar <- par(mfrow = c(1,3), mar = rep(0,4)) -image(stars::read_stars(ex_sel), rgb = 1:3) +image(stars::read_stars(ex_sel), rgb = 1:3, useRaster = TRUE) plot(crop_line, add = TRUE, col = "blue", lwd = 2) plot(crop_bbox, add = TRUE, border = "red", lwd = 2) -image(stars::read_stars(test1), rgb = 1:3) +image(stars::read_stars(test1), rgb = 1:3, useRaster = TRUE) plot(crop_bbox, add = TRUE, border = "red", lwd = 2) -image(stars::read_stars(test2), rgb = 1:3) +image(stars::read_stars(test2), rgb = 1:3, useRaster = TRUE) plot(crop_line, add = TRUE, col = "blue", lwd = 2) # Warp on a reference raster @@ -130,9 +130,9 @@ gdal_warp(ex_sel, test3, ref = ex_ref) # Show output par(mfrow = c(1,3)) -par(mar = rep(0,4)); image(stars::read_stars(ex_sel), rgb = 1:3) -par(mar = rep(2/3,4)); image(stars::read_stars(ex_ref)) -par(mar = rep(0,4)); image(stars::read_stars(test3), rgb = 1:3) +par(mar = rep(0,4)); image(stars::read_stars(ex_sel), rgb = 1:3, useRaster = TRUE) +par(mar = rep(2/3,4)); image(stars::read_stars(ex_ref), useRaster = TRUE) +par(mar = rep(0,4)); image(stars::read_stars(test3), rgb = 1:3, useRaster = TRUE) # Reproject all the input file test4 <- tempfile(fileext = "_test4.tif") @@ -151,13 +151,13 @@ crop_line_31N <- sf::st_transform(crop_line, 32631) test1_bbox <- sf::st_as_sfc(sf::st_bbox(stars::read_stars(test1))) test1_bbox_31N <- sf::st_transform(test1_bbox, 32631) par(mfrow = c(1,4), mar = rep(0,4)) -image(stars::read_stars(ex_sel), rgb = 1:3) +image(stars::read_stars(ex_sel), rgb = 1:3, useRaster = TRUE) plot(crop_line, add = TRUE, col = "blue", lwd = 2) plot(test1_bbox, add = TRUE, border = "red", lwd = 2) -image(stars::read_stars(test4), rgb = 1:3) -image(stars::read_stars(test5), rgb = 1:3) +image(stars::read_stars(test4), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(test5), rgb = 1:3, useRaster = TRUE) plot(test1_bbox_31N, add = TRUE, border = "red", lwd = 2) -image(stars::read_stars(test6), rgb = 1:3) +image(stars::read_stars(test6), rgb = 1:3, useRaster = TRUE) plot(crop_line_31N, add = TRUE, col = "blue", lwd = 2) # Use a reference raster with a different projection @@ -175,13 +175,13 @@ gdal_warp(ex_sel, test9, mask = crop_poly, ref = test6) # Show output par(mfrow = c(1,4), mar = rep(0,4)) -image(stars::read_stars(ex_sel), rgb = 1:3) +image(stars::read_stars(ex_sel), rgb = 1:3, useRaster = TRUE) plot(crop_line, add = TRUE, col = "blue", lwd = 2) -image(stars::read_stars(test7), rgb = 1:3) +image(stars::read_stars(test7), rgb = 1:3, useRaster = TRUE) plot(crop_line_31N, add = TRUE, col = "blue", lwd = 2) -image(stars::read_stars(test8), rgb = 1:3) +image(stars::read_stars(test8), rgb = 1:3, useRaster = TRUE) plot(test1_bbox_31N, add = TRUE, border = "red", lwd = 2) -image(stars::read_stars(test9), rgb = 1:3) +image(stars::read_stars(test9), rgb = 1:3, useRaster = TRUE) plot(crop_line_31N, add = TRUE, col = "blue", lwd = 2) par(oldpar) @@ -190,9 +190,8 @@ par(oldpar) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/gdalwarp_grid.Rd b/man/gdalwarp_grid.Rd index df7d188a..70281df2 100644 --- a/man/gdalwarp_grid.Rd +++ b/man/gdalwarp_grid.Rd @@ -63,18 +63,19 @@ sen2r:::gdalwarp_grid(ex_sel, ex_out, ref = ex_ref) # Show output oldpar <- par(mfrow = c(1,3), mar = rep(0,4)) -image(stars::read_stars(ex_sel), rgb = 4:2, maxColorValue = 3500) -par(mar = rep(2/3,4)); image(stars::read_stars(ex_ref)) -par(mar = rep(0,4)); image(stars::read_stars(ex_out), rgb = 4:2, maxColorValue = 3500) +image(stars::read_stars(ex_sel), rgb = 4:2, maxColorValue = 3500, useRaster = TRUE) +par(mar = rep(2/3,4)) +image(stars::read_stars(ex_ref), useRaster = TRUE) +par(mar = rep(0,4)) +image(stars::read_stars(ex_out), rgb = 4:2, maxColorValue = 3500, useRaster = TRUE) par(oldpar) } } \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/gipp.Rd b/man/gipp.Rd index c2ce7046..8d4e6e2f 100644 --- a/man/gipp.Rd +++ b/man/gipp.Rd @@ -73,9 +73,8 @@ read_gipp(c("DEM_Directory", "DEM_Reference"), gipp_path = gipp_temp) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2020) \email{luigi@ranghetti.info} diff --git a/man/gipp_init.Rd b/man/gipp_init.Rd index ff2c2805..86fe6c4e 100644 --- a/man/gipp_init.Rd +++ b/man/gipp_init.Rd @@ -37,9 +37,8 @@ gipp_init() \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2020) \email{luigi@ranghetti.info} diff --git a/man/give_write_permission.Rd b/man/give_write_permission.Rd index 045b1a41..00eb284d 100644 --- a/man/give_write_permission.Rd +++ b/man/give_write_permission.Rd @@ -29,12 +29,11 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ -Lorenzo Busetto, phD (2019) \email{lbusett@gmail.com} +Lorenzo Busetto, phD (2019) Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} } diff --git a/man/ignorelist.Rd b/man/ignorelist.Rd index 93b4416c..584dc3e7 100644 --- a/man/ignorelist.Rd +++ b/man/ignorelist.Rd @@ -72,9 +72,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2020) \email{luigi@ranghetti.info} diff --git a/man/init_python.Rd b/man/init_python.Rd index d4356987..1f28c02f 100644 --- a/man/init_python.Rd +++ b/man/init_python.Rd @@ -19,9 +19,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2020) \email{luigi@ranghetti.info} diff --git a/man/install_aria2.Rd b/man/install_aria2.Rd index 89013714..08b35692 100644 --- a/man/install_aria2.Rd +++ b/man/install_aria2.Rd @@ -32,9 +32,8 @@ install_aria2(aria2_dir = tempdir()) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/install_sen2cor.Rd b/man/install_sen2cor.Rd index 8fe52e9a..9ddcabf1 100644 --- a/man/install_sen2cor.Rd +++ b/man/install_sen2cor.Rd @@ -24,10 +24,10 @@ NULL (the function is called for its side effects) } \description{ \code{\link[=install_sen2cor]{install_sen2cor()}} downloads and installs a standalone version of -\href{http://step.esa.int/main/third-party-plugins-2/sen2cor/}{Sen2Cor}. +\href{http://step.esa.int/main/snap-supported-plugins/sen2cor/}{Sen2Cor}. \code{link_sen2cor()} links an existing standalone version of -\href{http://step.esa.int/main/third-party-plugins-2/sen2cor/}{Sen2Cor} to sen2r. +\href{http://step.esa.int/main/snap-supported-plugins/sen2cor/}{Sen2Cor} to sen2r. } \note{ License: GPL 3.0 @@ -41,9 +41,8 @@ install_sen2cor(sen2cor_dir = tempdir()) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/list_indices.Rd b/man/list_indices.Rd index b88f7530..d62cf84f 100644 --- a/man/list_indices.Rd +++ b/man/list_indices.Rd @@ -55,9 +55,8 @@ list_indices("name", all = TRUE) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/load_binpaths.Rd b/man/load_binpaths.Rd index 373fc8a6..67e95287 100644 --- a/man/load_binpaths.Rd +++ b/man/load_binpaths.Rd @@ -38,9 +38,8 @@ binpaths \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/load_extent.Rd b/man/load_extent.Rd index 8f779431..ea235d65 100644 --- a/man/load_extent.Rd +++ b/man/load_extent.Rd @@ -25,9 +25,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/mountpoint.Rd b/man/mountpoint.Rd index ecf330e7..bde9bd45 100644 --- a/man/mountpoint.Rd +++ b/man/mountpoint.Rd @@ -30,9 +30,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/nn.Rd b/man/nn.Rd index 552bf7d9..31fdbccb 100644 --- a/man/nn.Rd +++ b/man/nn.Rd @@ -27,9 +27,8 @@ basename(sen2r:::nn(NULL)) # ok \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/normalize_path.Rd b/man/normalize_path.Rd index d6eb2c36..eec4b4f5 100644 --- a/man/normalize_path.Rd +++ b/man/normalize_path.Rd @@ -24,9 +24,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/path_check.Rd b/man/path_check.Rd index aadef6b3..04c4c5a6 100644 --- a/man/path_check.Rd +++ b/man/path_check.Rd @@ -21,5 +21,5 @@ the user have write permissions on it (to be used in a Shiny context) \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} -Lorenzo Busetto, PhD (2019) \email{lbusett@gmail.com} +Lorenzo Busetto, PhD (2019) } diff --git a/man/print_message.Rd b/man/print_message.Rd index d78816b0..99ac24f8 100644 --- a/man/print_message.Rd +++ b/man/print_message.Rd @@ -78,9 +78,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2020) \email{luigi@ranghetti.info} diff --git a/man/projpar.Rd b/man/projpar.Rd index 2cf34adf..0295e6b2 100644 --- a/man/projpar.Rd +++ b/man/projpar.Rd @@ -47,9 +47,8 @@ projname(4326) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2020) \email{luigi@ranghetti.info} diff --git a/man/raster2rgb.Rd b/man/raster2rgb.Rd index 5ff07f87..24741adb 100644 --- a/man/raster2rgb.Rd +++ b/man/raster2rgb.Rd @@ -55,9 +55,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/raster_metadata.Rd b/man/raster_metadata.Rd index 788691dd..e135e1b0 100644 --- a/man/raster_metadata.Rd +++ b/man/raster_metadata.Rd @@ -54,9 +54,8 @@ raster_metadata(examplenames, c("bbox", "proj")) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/s2_calcindices.Rd b/man/s2_calcindices.Rd index 0bd4b600..607578b7 100644 --- a/man/s2_calcindices.Rd +++ b/man/s2_calcindices.Rd @@ -149,16 +149,16 @@ ex_out # Show output oldpar <- par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(ex_in), rgb = 4:2, maxColorValue = 3500) -par(mar = rep(2/3,4)); image(stars::read_stars(ex_out)) +image(stars::read_stars(ex_in), rgb = 4:2, maxColorValue = 3500, useRaster = TRUE) +par(mar = rep(2/3,4)) +image(stars::read_stars(ex_out), useRaster = TRUE) par(oldpar) } \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2020) \email{luigi@ranghetti.info} diff --git a/man/s2_dop.Rd b/man/s2_dop.Rd index d6d338f4..574109cb 100644 --- a/man/s2_dop.Rd +++ b/man/s2_dop.Rd @@ -69,9 +69,8 @@ s2_dop(22, "2018-08-16", mission = "2A") \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/s2_download.Rd b/man/s2_download.Rd index 83a00309..30993f0a 100644 --- a/man/s2_download.Rd +++ b/man/s2_download.Rd @@ -84,12 +84,11 @@ s2_download(list_safe, outdir=tempdir()) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2020) \email{luigi@ranghetti.info} -Lorenzo Busetto, phD (2019) \email{lbusett@gmail.com} +Lorenzo Busetto, phD (2019) } diff --git a/man/s2_gui.Rd b/man/s2_gui.Rd index 169afb7d..b50f9f2f 100644 --- a/man/s2_gui.Rd +++ b/man/s2_gui.Rd @@ -26,9 +26,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/s2_list.Rd b/man/s2_list.Rd index b582f63a..bfe59e08 100644 --- a/man/s2_list.Rd +++ b/man/s2_list.Rd @@ -124,12 +124,11 @@ safe_getMetadata(example_s2_list, "sensing_datetime") \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ -Lorenzo Busetto, phD (2019) \email{lbusett@gmail.com} - Inspired by +Lorenzo Busetto, phD (2019) - Inspired by function \code{getSentinel_query} of package \href{https://github.com/16EAGLE/getSpatialData}{\code{getSpatialData}} by J. Schwalb-Willmann diff --git a/man/s2_mask.Rd b/man/s2_mask.Rd index 7f5b9f49..f443f950 100644 --- a/man/s2_mask.Rd +++ b/man/s2_mask.Rd @@ -207,18 +207,20 @@ ex_out # Show output oldpar <- par(mfrow = c(1,3)) -par(mar = rep(0,4)); image(stars::read_stars(ex_in), rgb = 1:3) -par(mar = rep(2/3,4)); image(stars::read_stars(ex_mask)) -par(mar = rep(0,4)); image(stars::read_stars(ex_out), rgb = 1:3) +par(mar = rep(0,4)) +image(stars::read_stars(ex_in), rgb = 1:3, useRaster = TRUE) +par(mar = rep(2/3,4)) +image(stars::read_stars(ex_mask), useRaster = TRUE) +par(mar = rep(0,4)) +image(stars::read_stars(ex_out), rgb = 1:3, useRaster = TRUE) par(oldpar) } } \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/s2_merge.Rd b/man/s2_merge.Rd index f05e8ac4..df7cb2ae 100644 --- a/man/s2_merge.Rd +++ b/man/s2_merge.Rd @@ -99,9 +99,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/s2_order.Rd b/man/s2_order.Rd index 5044cf65..8f35078f 100644 --- a/man/s2_order.Rd +++ b/man/s2_order.Rd @@ -87,12 +87,11 @@ safe_is_online(order_path) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} -Lorenzo Busetto, phD (2020) \email{lbusett@gmail.com} +Lorenzo Busetto, phD (2020) } diff --git a/man/s2_rgb.Rd b/man/s2_rgb.Rd index 6bf44060..030b87a8 100644 --- a/man/s2_rgb.Rd +++ b/man/s2_rgb.Rd @@ -129,18 +129,17 @@ ex_out # Show output oldpar <- par(mfrow = c(1,3), mar = rep(0,4)) -image(stars::read_stars(ex_in), rgb = 4:2, maxColorValue = 3500) -image(stars::read_stars(ex_out[1]), rgb = 1:3) -image(stars::read_stars(ex_out[2]), rgb = 1:3) +image(stars::read_stars(ex_in), rgb = 4:2, maxColorValue = 3500, useRaster = TRUE) +image(stars::read_stars(ex_out[1]), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(ex_out[2]), rgb = 1:3, useRaster = TRUE) par(oldpar) } } \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/s2_thumbnails.Rd b/man/s2_thumbnails.Rd index 53b89819..84733fbe 100644 --- a/man/s2_thumbnails.Rd +++ b/man/s2_thumbnails.Rd @@ -93,9 +93,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/s2_tiles.Rd b/man/s2_tiles.Rd index 3c9a7e7b..5cf4bdad 100644 --- a/man/s2_tiles.Rd +++ b/man/s2_tiles.Rd @@ -40,9 +40,8 @@ text(s2_coords[,1], s2_coords[,2], s2tiles_ch$tile_id, col = "blue", cex = .75) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/s2_translate.Rd b/man/s2_translate.Rd index a4c1473b..de536a8f 100644 --- a/man/s2_translate.Rd +++ b/man/s2_translate.Rd @@ -129,9 +129,8 @@ s2_translate( \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/safe_getMetadata.Rd b/man/safe_getMetadata.Rd index 4e8b353e..e712055a 100644 --- a/man/safe_getMetadata.Rd +++ b/man/safe_getMetadata.Rd @@ -201,9 +201,8 @@ rm_invalid_safe(s2_examplepath) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/safe_is_online.Rd b/man/safe_is_online.Rd index 650de24b..aa10da70 100644 --- a/man/safe_is_online.Rd +++ b/man/safe_is_online.Rd @@ -49,12 +49,11 @@ safe_is_online(list_safe) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} -Lorenzo Busetto, phD (2020) \email{lbusett@gmail.com} +Lorenzo Busetto, phD (2020) } diff --git a/man/safe_shortname.Rd b/man/safe_shortname.Rd index 6fcc6812..0f3070df 100644 --- a/man/safe_shortname.Rd +++ b/man/safe_shortname.Rd @@ -106,9 +106,8 @@ safe_shortname("S2A_MSIL1C_20170603T101031_N0205_R022_T32TQQ_20170603T101026.SAF \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/safelist-class.Rd b/man/safelist-class.Rd index 09ab9a81..5357c82e 100644 --- a/man/safelist-class.Rd +++ b/man/safelist-class.Rd @@ -57,9 +57,8 @@ as(s2_sf, "safelist") \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/scihub_login.Rd b/man/scihub_login.Rd index f78944d6..3822b85d 100644 --- a/man/scihub_login.Rd +++ b/man/scihub_login.Rd @@ -77,12 +77,11 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} -Lorenzo Busetto, phD (2019) \email{lbusett@gmail.com} +Lorenzo Busetto, phD (2019) } diff --git a/man/sen2cor.Rd b/man/sen2cor.Rd index 0e38b653..675205e6 100644 --- a/man/sen2cor.Rd +++ b/man/sen2cor.Rd @@ -64,8 +64,8 @@ both \code{"NONE"} and \code{NA} can be used, but not \code{NULL}, which has the to maintain the value specified in the XML file). For details about the GIPP parameters, refer to the Sen2Cor documentation -(v. \href{http://step.esa.int/main/third-party-plugins-2/sen2cor/sen2cor_v2-5-5/}{2.5.5} -or \href{http://step.esa.int/main/third-party-plugins-2/sen2cor/sen2cor_v2-8/}{2.8.0}: +(v. \href{http://step.esa.int/main/snap-supported-plugins/sen2cor/sen2cor_v2-5-5/}{2.5.5} +or \href{http://step.esa.int/main/snap-supported-plugins/sen2cor/sen2cor_v2-8/}{2.8.0}: see the "Schemas of the GIPP file" at the end of each page). \emph{Note}: this argument takes effect only in the current execution of \code{sen2cor()} function.} @@ -138,7 +138,7 @@ Vector character with the list ot the output products \description{ The function uses Sen2Cor to manually correct L1C products. Standalone version of -\href{http://step.esa.int/main/third-party-plugins-2/sen2cor/}{sen2cor} +\href{http://step.esa.int/main/snap-supported-plugins/sen2cor/}{sen2cor} (version 2.8.0 or 2.5.5) is used. } \note{ @@ -166,9 +166,8 @@ sen2cor( \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/sen2r.Rd b/man/sen2r.Rd index 4cb2e120..a633d4f4 100644 --- a/man/sen2r.Rd +++ b/man/sen2r.Rd @@ -522,28 +522,28 @@ thumb_4[grep("SCL", thumb_4)] <- gsub("jpg$", "png", thumb_4[grep("SCL", thumb_4)]) oldpar <- par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(thumb_3[grep("BOA", thumb_3)]), rgb = 1:3) -image(stars::read_stars(thumb_3[grep("SCL", thumb_3)]), rgb = 1:3) +image(stars::read_stars(thumb_3[grep("BOA", thumb_3)]), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(thumb_3[grep("SCL", thumb_3)]), rgb = 1:3, useRaster = TRUE) par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(thumb_3[grep("MSAVI2", thumb_3)]), rgb = 1:3) -image(stars::read_stars(thumb_3[grep("NDVI", thumb_3)]), rgb = 1:3) +image(stars::read_stars(thumb_3[grep("MSAVI2", thumb_3)]), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(thumb_3[grep("NDVI", thumb_3)]), rgb = 1:3, useRaster = TRUE) par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(thumb_3[grep("RGB432B", thumb_3)]), rgb = 1:3) -image(stars::read_stars(thumb_3[grep("RGB843B", thumb_3)]), rgb = 1:3) +image(stars::read_stars(thumb_3[grep("RGB432B", thumb_3)]), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(thumb_3[grep("RGB843B", thumb_3)]), rgb = 1:3, useRaster = TRUE) par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(thumb_4[grep("BOA", thumb_4)]), rgb = 1:3) -image(stars::read_stars(thumb_4[grep("SCL", thumb_4)]), rgb = 1:3) +image(stars::read_stars(thumb_4[grep("BOA", thumb_4)]), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(thumb_4[grep("SCL", thumb_4)]), rgb = 1:3, useRaster = TRUE) par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(thumb_4[grep("MSAVI2", thumb_4)]), rgb = 1:3) -image(stars::read_stars(thumb_4[grep("NDVI", thumb_4)]), rgb = 1:3) +image(stars::read_stars(thumb_4[grep("MSAVI2", thumb_4)]), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(thumb_4[grep("NDVI", thumb_4)]), rgb = 1:3, useRaster = TRUE) par(mfrow = c(1,2), mar = rep(0,4)) -image(stars::read_stars(thumb_4[grep("RGB432B", thumb_4)]), rgb = 1:3) -image(stars::read_stars(thumb_4[grep("RGB843B", thumb_4)]), rgb = 1:3) +image(stars::read_stars(thumb_4[grep("RGB432B", thumb_4)]), rgb = 1:3, useRaster = TRUE) +image(stars::read_stars(thumb_4[grep("RGB843B", thumb_4)]), rgb = 1:3, useRaster = TRUE) par(oldpar) } @@ -551,12 +551,11 @@ par(oldpar) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2020) \email{luigi@ranghetti.info} -Lorenzo Busetto, phD (2020) \email{lbusett@gmail.com} +Lorenzo Busetto, phD (2020) } diff --git a/man/sen2r_getElements.Rd b/man/sen2r_getElements.Rd index 7c95ded9..be102422 100644 --- a/man/sen2r_getElements.Rd +++ b/man/sen2r_getElements.Rd @@ -38,9 +38,8 @@ sen2r_getElements(fs2nc_examplename) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/sen2r_process_report.Rd b/man/sen2r_process_report.Rd index 5fa7a8c4..dde6a117 100644 --- a/man/sen2r_process_report.Rd +++ b/man/sen2r_process_report.Rd @@ -80,10 +80,9 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ -Lorenzo Busetto, phD (2020) \email{lbusett@gmail.com} +Lorenzo Busetto, phD (2020) } diff --git a/man/smooth_mask.Rd b/man/smooth_mask.Rd index 74a7f32b..88d70e9b 100644 --- a/man/smooth_mask.Rd +++ b/man/smooth_mask.Rd @@ -51,9 +51,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/st_crs2.Rd b/man/st_crs2.Rd index 4ad900d8..ec447422 100644 --- a/man/st_crs2.Rd +++ b/man/st_crs2.Rd @@ -88,9 +88,8 @@ st_crs2(raster::raster(raster_path)) # st_crs(raster) uses the PROJ.4 as input \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/stack2rgb.Rd b/man/stack2rgb.Rd index 1019a409..7af08a42 100644 --- a/man/stack2rgb.Rd +++ b/man/stack2rgb.Rd @@ -77,9 +77,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/str_pad2.Rd b/man/str_pad2.Rd index 687a11fa..dd81dc47 100644 --- a/man/str_pad2.Rd +++ b/man/str_pad2.Rd @@ -44,9 +44,8 @@ str_pad2("hadley", 3) \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/tiles_intersects.Rd b/man/tiles_intersects.Rd index 2850fe22..99baa954 100644 --- a/man/tiles_intersects.Rd +++ b/man/tiles_intersects.Rd @@ -58,9 +58,8 @@ plot(sf::st_geometry(sel_tiles)); plot(sf::st_geometry(ex_extent), add=TRUE, col \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/man/trace_function.Rd b/man/trace_function.Rd index ce9e1ce7..9ed5bf09 100644 --- a/man/trace_function.Rd +++ b/man/trace_function.Rd @@ -67,9 +67,8 @@ License: GPL 3.0 \references{ L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing -Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. DOI: -\href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -URL: \url{http://sen2r.ranghetti.info/}. +Sentinel-2 satellite data. \emph{Computers & Geosciences}, 139, 104473. +\doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. } \author{ Luigi Ranghetti, phD (2019) \email{luigi@ranghetti.info} diff --git a/tests/testthat/test-gdal_warp.R b/tests/testthat/test-gdal_warp.R index 321d4ecd..ad5b0a81 100644 --- a/tests/testthat/test-gdal_warp.R +++ b/tests/testthat/test-gdal_warp.R @@ -113,7 +113,7 @@ testthat::test_that( # test on raster metadata exp_meta_r <- raster_metadata(test4, format = "list")[[1]] testthat::expect_equal(exp_meta_r$size, c("x"=27, "y"=44)) - testthat::expect_equal(exp_meta_r$res, c("x"=10.07, "y"=9.97), tolerance = 1e-3) + testthat::expect_equal(exp_meta_r$res, c("x"=10.0357, "y"=10.0357), tolerance = 1e-3) testthat::expect_equal(exp_meta_r$nbands, 3) testthat::expect_equal( as.numeric(exp_meta_r$bbox), @@ -126,8 +126,8 @@ testthat::test_that( # test on raster values exp_stars <- stars::read_stars(test4) - testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 76.87846, tolerance = 1e-03) - testthat::expect_equal(sum(is.na(exp_stars[[1]][,,3])), 176, tolerance = 1e-3) + testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 77.11806, tolerance = 1e-03) + testthat::expect_equal(sum(is.na(exp_stars[[1]][,,3])), 180, tolerance = 1e-3) rm(exp_stars) } @@ -137,13 +137,18 @@ testthat::test_that( "Reproject in a projection without EPSG", { # this test is intended to test gdal_warp() passing a WKT to gdalwarp # instead then the EPSG code + # Moreover, it allows verifying the modification performed since GDAL 3.2.0 + # about computing the output resolution in gdalwarp if the extent is + # provided (see https://github.com/OSGeo/gdal/issues/3294). modis_wkt <- paste0( - 'PROJCS["Sinusoidal",GEOGCS["GCS_Undefined",DATUM["Undefined",SPHEROID[', - '"User_Defined_Spheroid",6371007.181,0.0]],PRIMEM["Greenwich",0.0],UNIT', - '["Degree",0.0174532925199433]],PROJECTION["Sinusoidal"],PARAMETER["Fal', - 'se_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Me', - 'ridian",0.0],UNIT["Meter",1.0]]' + 'PROJCS["MODIS Sinusoidal",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["W', + 'GS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG', + '","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree', + '",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326', + '"]],PROJECTION["Sinusoidal"],PARAMETER["false_easting",0.0],PARAMETER["', + 'false_northing",0.0],PARAMETER["central_meridian",0.0],PARAMETER["semi_', + 'major",6371007.181],PARAMETER["semi_minor",6371007.181],UNIT["m",1.0]]' ) test4b <- tempfile(fileext = "_test4b.tif") test4_out <- tryCatch( @@ -161,11 +166,11 @@ testthat::test_that( # test on raster metadata exp_meta_r <- raster_metadata(test4b, format = "list")[[1]] testthat::expect_equal(exp_meta_r$size, c("x"=27, "y"=40)) - testthat::expect_equal(exp_meta_r$res, c("x"=10.64168, "y"=10.58520), tolerance = 1e-3) + testthat::expect_equal(exp_meta_r$res, c("x"=10.58273, "y"=10.58273), tolerance = 1e-3) testthat::expect_equal(exp_meta_r$nbands, 3) testthat::expect_equal( as.numeric(exp_meta_r$bbox), - c(774691.9, 5122100.0, 774979.2, 5122523.4), + c(776908.7, 5103210.8, 777196.7, 5103634.0), tolerance = 1e-3 ) testthat::expect_equal(exp_meta_r$proj$epsg, as.integer(NA)) @@ -174,8 +179,8 @@ testthat::test_that( # test on raster values exp_stars <- stars::read_stars(test4b) - testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 76.77778, tolerance = 1e-03) - testthat::expect_equal(sum(is.na(exp_stars[[1]][,,3])), 180, tolerance = 1e-3) + testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 76.65969, tolerance = 1e-03) + testthat::expect_equal(sum(is.na(exp_stars[[1]][,,3])), 172, tolerance = 1e-3) rm(exp_stars) } @@ -193,8 +198,8 @@ testthat::test_that( # test on raster metadata exp_meta_r <- raster_metadata(test5, format = "list")[[1]] - testthat::expect_equal(exp_meta_r$size, c("x"=10, "y"=27)) - testthat::expect_equal(exp_meta_r$res, c("x"=9.98, "y"=9.86), tolerance = 1e-3) + testthat::expect_equal(exp_meta_r$size, c("x"=11, "y"=28)) + testthat::expect_equal(exp_meta_r$res, c("x"=10.0357, "y"=10.0357), tolerance = 1e-3) testthat::expect_equal(exp_meta_r$nbands, 3) testthat::expect_equal( as.numeric(exp_meta_r$bbox), @@ -207,8 +212,8 @@ testthat::test_that( # test on raster values exp_stars <- stars::read_stars(test5) - testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 97.21495, tolerance = 1e-03) - testthat::expect_equal(sum(is.na(exp_stars[[1]][,,3])), 56, tolerance = 1e-03) + testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 97.15385, tolerance = 1e-03) + testthat::expect_equal(sum(is.na(exp_stars[[1]][,,3])), 100, tolerance = 1e-03) rm(exp_stars) } @@ -226,8 +231,8 @@ testthat::test_that( # test on raster metadata exp_meta_r <- raster_metadata(test6, format = "list")[[1]] - testthat::expect_equal(exp_meta_r$size, c("x"=6, "y"=25)) - testthat::expect_equal(exp_meta_r$res, c("x"=10.7, "y"=10.2), tolerance = 1e-2) + testthat::expect_equal(exp_meta_r$size, c("x"=7, "y"=27)) + testthat::expect_equal(exp_meta_r$res, c("x"=10.0357, "y"=10.0357), tolerance = 1e-2) testthat::expect_equal(exp_meta_r$nbands, 3) testthat::expect_equal( as.numeric(exp_meta_r$bbox), @@ -240,8 +245,8 @@ testthat::test_that( # test on raster values exp_stars <- stars::read_stars(test6) - testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 110.5455, tolerance = 1e-03) - testthat::expect_equal(sum(is.na(exp_stars[[1]][,,3])), 73, tolerance = 1e-03) + testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 109.8916, tolerance = 1e-03) + testthat::expect_equal(sum(is.na(exp_stars[[1]][,,3])), 106, tolerance = 1e-03) rm(exp_stars) } @@ -255,9 +260,9 @@ testthat::test_that( # test on raster metadata exp_meta_r <- raster_metadata(test7, format = "list")[[1]] - testthat::expect_equal(exp_meta_r$size, c("x" = 6, "y" = 25)) + testthat::expect_equal(exp_meta_r$size, c("x" = 7, "y" = 27)) testthat::expect_equal( - exp_meta_r$res, c("x" = 10.67998, "y" = 10.21008), + exp_meta_r$res, c("x" = 10.0357, "y" = 10.0357), tolerance = 1e-3 ) testthat::expect_equal(exp_meta_r$nbands, 3) @@ -272,7 +277,7 @@ testthat::test_that( # test on raster values exp_stars <- stars::read_stars(test7) - testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 91.76, tolerance = 1e-03) + testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 95.07407, tolerance = 1e-03) testthat::expect_equal(sum(is.na(exp_stars[[1]][,,3])), 0) rm(exp_stars) @@ -287,8 +292,8 @@ testthat::test_that( # test on raster metadata exp_meta_r <- raster_metadata(test8, format = "list")[[1]] - testthat::expect_equal(exp_meta_r$size, c("x"=9, "y"=26)) - testthat::expect_equal(exp_meta_r$res, c("x"=10.67998, "y"=10.21008 ), tolerance = 1e-3) + testthat::expect_equal(exp_meta_r$size, c("x"=11, "y"=28)) + testthat::expect_equal(exp_meta_r$res, c("x"=10.0357, "y"=10.0357), tolerance = 1e-3) testthat::expect_equal(exp_meta_r$nbands, 3) testthat::expect_equal( as.numeric(exp_meta_r$bbox), @@ -301,8 +306,8 @@ testthat::test_that( # test on raster values exp_stars <- stars::read_stars(test8) - testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 94.52093, tolerance = 1e-03) - testthat::expect_equal(sum(is.na(exp_stars[[1]][,,3])), 19, tolerance = 1e-03) + testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 94.73444, tolerance = 1e-03) + testthat::expect_equal(sum(is.na(exp_stars[[1]][,,3])), 67, tolerance = 1e-03) rm(exp_stars) } @@ -316,8 +321,8 @@ testthat::test_that( # test on raster metadata exp_meta_r <- raster_metadata(test9, format = "list")[[1]] - testthat::expect_equal(exp_meta_r$size, c("x"=6, "y"=25)) - testthat::expect_equal(exp_meta_r$res, c("x"=10.67998, "y"=10.21008 ), tolerance = 1e-3) + testthat::expect_equal(exp_meta_r$size, c("x"=7, "y"=27)) + testthat::expect_equal(exp_meta_r$res, c("x"=10.0357, "y"=10.0357), tolerance = 1e-3) testthat::expect_equal(exp_meta_r$nbands, 3) testthat::expect_equal( as.numeric(exp_meta_r$bbox), @@ -330,8 +335,8 @@ testthat::test_that( # test on raster values exp_stars <- stars::read_stars(test9) - testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 100.1134, tolerance = 1e-03) - testthat::expect_equal(sum(is.na(exp_stars[[1]][,,3])), 53, tolerance = 1e-03) + testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 104.4956, tolerance = 1e-03) + testthat::expect_equal(sum(is.na(exp_stars[[1]][,,3])), 76, tolerance = 1e-03) rm(exp_stars) } @@ -345,8 +350,8 @@ testthat::test_that( # test on raster metadata exp_meta_r <- raster_metadata(test10, format = "list")[[1]] - testthat::expect_equal(exp_meta_r$size, c("x"=6, "y"=25)) - testthat::expect_equal(exp_meta_r$res, c("x"=10.68, "y"=10.21), tolerance = 1e-3) + testthat::expect_equal(exp_meta_r$size, c("x"=7, "y"=27)) + testthat::expect_equal(exp_meta_r$res, c("x"=10.0357, "y"=10.0357), tolerance = 1e-3) testthat::expect_equal(exp_meta_r$nbands, 3) testthat::expect_equal( as.numeric(exp_meta_r$bbox), @@ -359,8 +364,8 @@ testthat::test_that( # test on raster values exp_stars <- stars::read_stars(test10) - testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 110.5455, tolerance = 1e-03) - testthat::expect_equal(sum(is.na(exp_stars[[1]][,,3])), 73, tolerance = 1e-03) + testthat::expect_equal(mean(exp_stars[[1]][,,3], na.rm=TRUE), 109.8916, tolerance = 1e-03) + testthat::expect_equal(sum(is.na(exp_stars[[1]][,,3])), 106, tolerance = 1e-03) rm(exp_stars) } diff --git a/tests/testthat/test-sen2r-02_warp.R b/tests/testthat/test-sen2r-02_warp.R index fdad8437..b9f7c287 100644 --- a/tests/testthat/test-sen2r-02_warp.R +++ b/tests/testthat/test-sen2r-02_warp.R @@ -136,7 +136,7 @@ testthat::test_that( "path", "valid", "res.x", "res.y", "size.x", "size.y", "nbands", "xmin", "ymin", "xmax", "ymax", "proj", "unit", "outformat", "type" )) - testthat::expect_equal(exp_meta_r[,c("size.x", "size.y")], data.frame("size.x"=775, "size.y"=583)) + testthat::expect_equal(exp_meta_r[,c("size.x", "size.y")], data.frame("size.x"=776, "size.y"=584)) testthat::expect_equal(exp_meta_r[,c("res.x", "res.y")], data.frame("res.x"=25, "res.y"=25)) testthat::expect_equal(exp_meta_r$nbands, 12) testthat::expect_equal( @@ -231,7 +231,7 @@ testthat::test_that( testthat::expect_equal(names(exp_meta_r), c( "path", "valid", "res", "size", "nbands", "bbox", "proj", "unit", "outformat", "type" )) - testthat::expect_equal(exp_meta_r$size, c("x"=775, "y"=583)) + testthat::expect_equal(exp_meta_r$size, c("x"=776, "y"=584)) testthat::expect_equal(exp_meta_r$res, c("x"=25, "y"=25)) testthat::expect_equal(exp_meta_r$nbands, 1) testthat::expect_equal( diff --git a/utils/code/gdal_formats_db.R b/utils/code/gdal_formats_db.R index 2e2bbb81..eb73061f 100644 --- a/utils/code/gdal_formats_db.R +++ b/utils/code/gdal_formats_db.R @@ -22,9 +22,8 @@ #' @author Luigi Ranghetti, phD (2019) \email{luigi@@ranghetti.info} #' @references 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: -#' \href{https://doi.org/10.1016/j.cageo.2020.104473}{10.1016/j.cageo.2020.104473}, -#' URL: \url{http://sen2r.ranghetti.info/}. +#' Sentinel-2 satellite data. _Computers & Geosciences_, 139, 104473. +#' \doi{10.1016/j.cageo.2020.104473}, URL: \url{http://sen2r.ranghetti.info/}. #' @note License: GPL 3.0 #' @importFrom reticulate py_to_r #' @importFrom jsonlite toJSON fromJSON diff --git a/vignettes/installation.Rmd b/vignettes/installation.Rmd index 978bdae1..0b5b24fc 100644 --- a/vignettes/installation.Rmd +++ b/vignettes/installation.Rmd @@ -41,7 +41,7 @@ Before installing sen2r features: -* [**Sen2Cor**](http://step.esa.int/main/third-party-plugins-2/sen2cor/) +* [**Sen2Cor**](http://step.esa.int/main/snap-supported-plugins/sen2cor/) is used to perform atmospheric correction of Sentinel-2 Level-1C products: it is required by the package, unless you choose not to correct products locally (using only Level-1C – TOA products or downloading directly Level-2A products); @@ -227,7 +227,7 @@ containing all the functions necessary to preprocess data. ### Installing Sen2Cor -[**Sen2Cor**](http://step.esa.int/main/third-party-plugins-2/sen2cor/) +[**Sen2Cor**](http://step.esa.int/main/snap-supported-plugins/sen2cor/) is used to perform atmospheric correction of Sentinel-2 Level-1C products, so its installation can be skipped in case this function is not required by the user (using only Level-1C – TOA products diff --git a/vignettes/sen2r_cmd.Rmd b/vignettes/sen2r_cmd.Rmd index 905f259c..2ccd0f0c 100644 --- a/vignettes/sen2r_cmd.Rmd +++ b/vignettes/sen2r_cmd.Rmd @@ -52,7 +52,7 @@ For example, the following code chunk would perform the following operations: ```{r eval=FALSE} # Set paths out_dir_1 <- tempfile(pattern = "sen2r_out_1_") # output folder -safe_dir_1 <- tempfile(pattern = "sen2r_safe_") # folder to store downloaded SAFE +safe_dir <- tempfile(pattern = "sen2r_safe_") # folder to store downloaded SAFE myextent_1 <- system.file("extdata/vector/barbellino.geojson", package = "sen2r") @@ -62,7 +62,7 @@ out_paths_1 <- sen2r( step_atmcorr = "l2a", extent = myextent_1, extent_name = "Barbellino", - timewindow = c(as.Date("2019-07-13"), as.Date("2019-07-25")), + timewindow = c(as.Date("2020-11-13"), as.Date("2020-11-25")), list_prods = c("BOA","SCL"), list_indices = c("NDVI","MSAVI2"), list_rgb = c("RGB432B"), @@ -73,16 +73,16 @@ out_paths_1 <- sen2r( ) ``` ``` -[2020-02-05 10:53:53] #### Starting sen2r execution. #### -[2020-02-05 10:53:57] Searching for available SAFE products on SciHub... -[2020-02-05 10:54:02] Computing output names... -[2020-02-05 10:54:03] Processing group 1 of 5... -[2020-02-05 10:54:03] Starting to download the required level-2A SAFE products. -[2020-02-05 10:54:03] Check if products are available for download... -[2020-02-05 10:54:03] 1 Sentinel-2 images are already online. -[2020-02-05 10:54:03] Downloading Sentinel-2 image 1 of 1 - (S2A_MSIL2A_20190703T101031_N0212_R022_T32TNS_20190703T134349.SAFE)... -[2020-02-05 10:54:41] Download of level-2A SAFE products terminated. +[2020-11-27 16:59:58] #### Starting sen2r execution. #### +[2020-11-27 16:59:59] Searching for available SAFE products on SciHub... +[2020-11-27 17:00:10] Computing output names... +Linking to GEOS 3.7.1, GDAL 2.2.3, PROJ 4.9.3 +[2020-11-27 17:00:11] Processing group 1 of 5... +[2020-11-27 17:00:11] Starting to download the required level-2A SAFE products. +[2020-11-27 17:00:11] Check if products are available for download... +[2020-11-27 17:00:11] Downloading Sentinel-2 image 1 of 1 + (S2A_MSIL2A_20201114T101301_N0214_R022_T32TNS_20201114T120346.SAFE)... +[2020-11-27 17:00:59] Download of level-2A SAFE products terminated. # (skipping most processing messages here) ``` @@ -94,19 +94,17 @@ a report summarising the conducted processing is issued at the end: ╟────────────────────────────────────────────────────────────────────────────── ║ Dates to be processed based on processing parameters: 5 ║ Processing completed for: all expected dates. -║ Outputs for: 2 out of 5 expected dates not created because cloudiness over -║ the spatial extent is above 10%. ╚══════════════════════════════════════════════════════════════════════════════ -[2020-02-05 11:02:53] #### Execution of sen2r session terminated. #### +[2020-11-27 17:10:30] #### sen2r session terminated. #### The processing chain can be re-launched with the command: - sen2r("/home/lb/.sen2r/proc_par/s2proc_20200205_105355.json") + sen2r("/home/lranghetti/.sen2r/proc_par/s2proc_20201127_165959.json") ``` In this case, it shows that all the 5 S2 images satisfying the spatial-temporal query were downloaded and properly processed. -However, outputs for two of those dates were not created because cloudiness -over the spatial extent was above the specified threshold. + S2 original SAFE images are stored in the folder specified by `safe_dir`, and are not deleted after processing (unless the user sets also the argument @@ -116,11 +114,11 @@ and are not deleted after processing (unless the user sets also the argument list.files(safe_dir) ``` ``` -[1] "S2A_MSIL2A_20190703T101031_N0212_R022_T32TNS_20190703T134349.SAFE" -[2] "S2A_MSIL2A_20190706T102031_N0212_R065_T32TNS_20190706T134618.SAFE" -[3] "S2A_MSIL2A_20190713T101031_N0213_R022_T32TNS_20190713T135651.SAFE" -[4] "S2B_MSIL2A_20190708T101039_N0213_R022_T32TNS_20190708T133715.SAFE" -[5] "S2B_MSIL2A_20190711T102029_N0213_R065_T32TNS_20190711T135545.SAFE" +[1] "S2A_MSIL2A_20201114T101301_N0214_R022_T32TNS_20201114T120346.SAFE" +[2] "S2A_MSIL2A_20201117T102321_N0214_R065_T32TNS_20201117T130408.SAFE" +[3] "S2A_MSIL2A_20201124T101341_N0214_R022_T32TNS_20201124T115339.SAFE" +[4] "S2B_MSIL2A_20201119T101319_N0214_R022_T32TNS_20201119T120649.SAFE" +[5] "S2B_MSIL2A_20201122T102339_N0214_R065_T32TNS_20201122T122607.SAFE" ``` Outputs are automatically subsetted and masked over the study area, @@ -136,9 +134,12 @@ list.files(out_dir_1) list.files(file.path(out_dir_1, "NDVI")) ``` ``` -[1] "S2A2A_20190703_022_Barbellino_NDVI_10.tif" -[2] "S2A2A_20190706_065_Barbellino_NDVI_10.tif" -[3] "S2B2A_20190708_022_Barbellino_NDVI_10.tif" "thumbnails" +[1] "S2A2A_20201114_022_Barbellino_NDVI_10.tif" +[2] "S2A2A_20201117_065_Barbellino_NDVI_10.tif" +[3] "S2A2A_20201124_022_Barbellino_NDVI_10.tif" +[4] "S2B2A_20201119_022_Barbellino_NDVI_10.tif" +[5] "S2B2A_20201122_065_Barbellino_NDVI_10.tif" +[6] "thumbnails" ``` _See [this vignette](outstructure.html) for more info about folder structure_ @@ -162,30 +163,28 @@ json_path_2 <- build_example_param_file() json_path_2 ``` ``` -[1] "/tmp/RtmpDLx7qh/file30ac6089ea3_sen2r_params.json" +[1] "/tmp/RtmpHUtF1k/file9a625065871c_sen2r_params.json" ``` ```{r eval=FALSE} out_paths_2 <- sen2r(param_list = json_path_2) ``` ``` -[2020-02-05 11:58:09] #### Starting sen2r execution. #### -[2020-02-05 11:58:09] Searching for available SAFE products on SciHub... -[2020-02-05 11:58:12] Computing output names... -[2020-02-05 11:58:13] Starting to download the required level-2A SAFE products. -Images S2A_MSIL2A_20170703T101021_N0205_R022_T32TNS_20170703T101041.SAFE are -already on your system and will be skipped. Set "overwrite_safe" to TRUE to -re-download them. +[2020-11-27 17:25:23] #### Starting sen2r execution. #### +[2020-11-27 17:25:23] Searching for available SAFE products on SciHub... +[2020-11-27 17:25:26] Computing output names... +[2020-11-27 17:25:28] Starting to download the required level-2A SAFE products. # (skipping most processing messages here) + ╔══════════════════════════════════════════════════════════════════════════════ ║ sen2r Processing Report ╟────────────────────────────────────────────────────────────────────────────── ║ Dates to be processed based on processing parameters: 1 ║ Processing completed for: all expected dates. ╚══════════════════════════════════════════════════════════════════════════════ -[2020-02-05 11:58:20] #### Execution of sen2r session terminated. #### +[2020-11-27 17:26:43] #### sen2r session terminated. #### The processing chain can be re-launched with the command: - sen2r("/home/lb/.sen2r/proc_par/s2proc_20200205_115809.json") + sen2r("/home/lranghetti/.sen2r/proc_par/s2proc_20201127_172523.json") ``` This is for example particularly useful if a `sen2r()` processing requires @@ -228,7 +227,7 @@ out_paths_3 <- sen2r( param_list = json_path_2, extent = myextent_3, extent_name = "newxtent", - timewindow = c(as.Date("2019-01-01"), as.Date("2019-01-30")), + timewindow = c(as.Date("2020-10-01"), as.Date("2020-10-30")), path_out = out_dir_3 ) ```