From 1de55c23af9f4c43880b1e2d2a8a1426e771e96f Mon Sep 17 00:00:00 2001
From: Paul Taconet
Date: Tue, 14 May 2024 16:52:26 +0200
Subject: [PATCH] update website
---
DESCRIPTION | 50 +-
NAMESPACE | 12 +-
R/mf_get_url.R | 3 +-
R/mf_import_data.R | 35 +-
README.Rmd | 370 +--
README.md | 1986 +----------------
dev_history.R | 2 +-
docs/LICENSE.html | 10 +-
docs/articles/advanced_workflow.html | 22 +-
docs/articles/get_started.html | 22 +-
docs/articles/index.html | 10 +-
docs/articles/opendapr1.html | 56 +-
docs/articles/opendapr2.html | 70 +-
docs/authors.html | 8 +-
docs/docsearch.css | 0
docs/docsearch.js | 0
docs/index.html | 94 +-
docs/link.svg | 0
docs/logo.png | Bin
docs/pkgdown.css | 0
docs/pkgdown.js | 0
docs/pkgdown.yml | 0
man/figures/README-plot_roi-1.png | Bin
man/figures/logo.png | Bin
...r_download_data.Rd => mf_download_data.Rd} | 24 +-
...r_get_opt_param.Rd => mf_get_opt_param.Rd} | 26 +-
man/{odr_get_url.Rd => mf_get_url.Rd} | 54 +-
man/mf_import_data.Rd | 61 +
..._collections.Rd => mf_list_collections.Rd} | 10 +-
...list_variables.Rd => mf_list_variables.Rd} | 16 +-
man/{odr_login.Rd => mf_login.Rd} | 12 +-
man/modisfast-package.Rd | 25 +
man/odr_import_data.Rd | 75 -
man/opendapr-package.Rd | 25 -
34 files changed, 394 insertions(+), 2684 deletions(-)
mode change 100755 => 100644 NAMESPACE
mode change 100644 => 100755 docs/LICENSE.html
mode change 100644 => 100755 docs/articles/advanced_workflow.html
mode change 100644 => 100755 docs/articles/get_started.html
mode change 100644 => 100755 docs/articles/index.html
mode change 100644 => 100755 docs/articles/opendapr1.html
mode change 100644 => 100755 docs/articles/opendapr2.html
mode change 100644 => 100755 docs/authors.html
mode change 100644 => 100755 docs/docsearch.css
mode change 100644 => 100755 docs/docsearch.js
mode change 100644 => 100755 docs/index.html
mode change 100644 => 100755 docs/link.svg
mode change 100644 => 100755 docs/logo.png
mode change 100644 => 100755 docs/pkgdown.css
mode change 100644 => 100755 docs/pkgdown.js
mode change 100644 => 100755 docs/pkgdown.yml
mode change 100644 => 100755 man/figures/README-plot_roi-1.png
mode change 100644 => 100755 man/figures/logo.png
rename man/{odr_download_data.Rd => mf_download_data.Rd} (68%)
rename man/{odr_get_opt_param.Rd => mf_get_opt_param.Rd} (68%)
rename man/{odr_get_url.Rd => mf_get_url.Rd} (74%)
create mode 100644 man/mf_import_data.Rd
rename man/{odr_list_collections.Rd => mf_list_collections.Rd} (78%)
rename man/{odr_list_variables.Rd => mf_list_variables.Rd} (66%)
rename man/{odr_login.Rd => mf_login.Rd} (75%)
create mode 100644 man/modisfast-package.Rd
delete mode 100644 man/odr_import_data.Rd
delete mode 100644 man/opendapr-package.Rd
diff --git a/DESCRIPTION b/DESCRIPTION
index 649ad2d..08ad1f5 100755
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,37 +1,43 @@
Package: modisfast
-Title: Fast and efficient access to MODIS (and MODIS-like) data in R using the OPeNDAP Capacities
+Title: Fast and efficient access to MODIS (and MODIS-like) data in R using
+ the OPeNDAP Capacities
Version: 0.1.0
Authors@R:
- person(given = "Paul",
- family = "Taconet",
- role = c("aut", "cre"),
- email = "paul.taconet@ird.fr",
+ person("Paul", "Taconet", , "paul.taconet@ird.fr", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-7429-7204"))
-Description: Provides functions to download MODIS and MODIS-like Earth science datacubes in a time-saving and efficient way : by sampling it at the very downloading phase (spatially, temporally and dimensionally) using the OPeNDAP framework.
+Description: Provides functions to download MODIS and MODIS-like Earth
+ science datacubes in a time-saving and efficient way : by sampling it
+ at the very downloading phase (spatially, temporally and
+ dimensionally) using the OPeNDAP framework.
License: GPL-3
URL: https://github.com/ptaconet/modisfast
BugReports: https://github.com/ptaconet/modisfast/issues
-Encoding: UTF-8
-LazyData: true
-RoxygenNote: 6.1.1
-VignetteBuilder: knitr
-Depends: R (>= 2.10)
+Depends:
+ R (>= 2.10)
Imports:
- magrittr,
+ curl,
dplyr,
httr,
- curl,
- sf,
- purrr,
lubridate,
- xml2,
- stringr,
- rvest,
- utils,
+ magrittr,
+ ncdf4,
parallel,
- terra
+ purrr,
+ raster,
+ rvest,
+ sf,
+ stats,
+ stringr,
+ terra,
+ xml2
Suggests:
- testthat,
+ emo,
knitr,
mapview,
- rmarkdown
+ rmarkdown,
+ testthat
+VignetteBuilder:
+ knitr
+Encoding: UTF-8
+LazyData: true
+RoxygenNote: 7.3.1
diff --git a/NAMESPACE b/NAMESPACE
old mode 100755
new mode 100644
index 90f1dab..1dfee6e
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -20,17 +20,13 @@ importFrom(lubridate,second)
importFrom(lubridate,yday)
importFrom(lubridate,year)
importFrom(magrittr,"%>%")
-importFrom(ncdf4,nc_open)
-importFrom(ncdf4,ncvar_get)
-importFrom(raster,brick)
-importFrom(raster,flip)
-importFrom(raster,merge)
-importFrom(raster,raster)
-importFrom(raster,t)
importFrom(rvest,html_table)
-importFrom(stars,read_stars)
importFrom(stats,ave)
importFrom(stringr,str_match)
importFrom(stringr,str_replace)
importFrom(stringr,word)
+importFrom(terra,flip)
+importFrom(terra,merge)
+importFrom(terra,rast)
+importFrom(terra,t)
importFrom(xml2,read_html)
diff --git a/R/mf_get_url.R b/R/mf_get_url.R
index 3d8d309..fafb6f2 100755
--- a/R/mf_get_url.R
+++ b/R/mf_get_url.R
@@ -49,8 +49,7 @@
#'
#' require(sf)
#' require(magrittr)
-#' require(raster)
-#' require(stars)
+#' require(terra)
#'
#' ### First mf_login to EOSDIS Earthdata with username and password.
#' # To create an account go to : https://urs.earthdata.nasa.gov/.
diff --git a/R/mf_import_data.R b/R/mf_import_data.R
index e689402..e5c3546 100755
--- a/R/mf_import_data.R
+++ b/R/mf_import_data.R
@@ -1,20 +1,15 @@
#' @name mf_import_data
#' @aliases mf_import_data
-#' @title Import the time series in R as a \code{SpatRaster} or a \code{stars} object
-#' @description Import a time series as a \code{SpatRaster} or a \code{stars} object
+#' @title Import the time series in R as a \code{SpatRaster} object
+#' @description Import a time series as a \code{SpatRaster}object
#'
#' @param dir_path string character vector. mandatory. The path to the local directory where the data are stored.
#' @param collection_source character string. mandatory. The collection source (one of "MODIS", "VIIRS", "GPM")
-#' @param output_class character string. Output object class. "SpatRaster" or "stars". See Details.
+#' @param output_class character string. Output object class. Currently only "SpatRaster" implemented.
#' @param proj_epsg character string. EPSG of the desired projection for the output raster (default : 4326)
#'
-#' @details
-#' \code{output} : Currently "SpatRaster" implemented for all the collections and "stars" only for MODIS and VIIRS collections
-#'
#' @import purrr
#' @importFrom terra rast t merge flip
-#' @importFrom stars read_stars
-#' @importFrom ncdf4 nc_open ncvar_get
#' @importFrom magrittr %>%
#' @export
#'
@@ -25,45 +20,33 @@
#' require(sf)
#' require(magrittr)
#' require(terra)
-#' require(stars)
#'
#' username <- Sys.getenv("earthdata_un")
#' password <- Sys.getenv("earthdata_pw")
-#' log <- mf_login(credentials = c(username,password), source = "earthdata")
+#' log <- mf_login(credentials = c(username,password))
#'
-#' roi_name <- "korhogo
+#' roi_id <- "korhogo"
#' roi = st_as_sf(data.frame(
#' geom="POLYGON ((-5.82 9.54, -5.42 9.55, -5.41 8.84, -5.81 8.84, -5.82 9.54))"),
#' wkt="geom",crs = 4326)
#'
#' time_range = as.Date(c("2017-01-01","2017-01-30"))
#'
-#' urls_mod11a1 <- mf_get_url(collection = "MOD11A1.006",
+#' urls_mod11a1 <- mf_get_url(collection = "MOD11A1.061",
#' variables = c("LST_Day_1km","LST_Night_1km"),
#' roi = roi,
-#' roi_name = roi_name,
+#' roi_id = roi_id,
#' time_range = time_range
#' )
#'
#' res_dl <- mf_download_data(urls_mod11a1)
#'
-#' ## import as RasterBrick
-#' # here we import only the band LST_Day_1km
-#' (mod11a1_rast <- mf_import_data(df_data_to_import = urls_mod11a1,
-#' collection = "MOD11A1.006",
-#' variable = "LST_Day_1km",
-#' output_class = "RasterBrick"))
+#' ## import as terra::SpatRast
#'
-#' ## import os stars
-#' # in a stars object, all the bands are imported, so no need to specify a variable
-#' (mod11a1_stars <- mf_import_data(df_data_to_import = urls_mod11a1,
-#' collection = "MOD11A1.006",
-#' output = "stars"))
+#' modis_ts <- mf_import_data(file.path(roi_id,"MOD11A1.061"), collection_source = "MODIS")
#'
#' plot(mod11a1_rast)
#'
-#' plot(mod11a1_stars)
-#'
#' }
mf_import_data <- function(dir_path,
diff --git a/README.Rmd b/README.Rmd
index a627e24..96c2238 100755
--- a/README.Rmd
+++ b/README.Rmd
@@ -1,6 +1,5 @@
---
-output: github_document
-always_allow_html: yes
+output: github_document
---
@@ -12,380 +11,45 @@ knitr::opts_chunk$set(
fig.path = "man/figures/README-",
out.width = "100%"
)
-library(magrittr)
-library(modisfast)
-library(dplyr)
-library(emo)
```
-# modisfast
-
+
+# modisfast
-[![licence](https://img.shields.io/badge/Licence-GPL--3-blue.svg)](https://www.r-project.org/Licenses/GPL-3)
-[![Travis build status](https://travis-ci.org/ptaconet/modisfast.svg?branch=master)](https://travis-ci.org/ptaconet/modisfast)
-[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/modisfast)](https://cran.r-project.org/package=modisfast)
-[![Github_Status_Badge](https://img.shields.io/badge/Github-0.1.0-blue.svg)](https://github.com/ptaconet/modisfast)
-
-
-
-
-
-**`modisfast`** is an R package that provides functions to **speed-up** the **download** of time-series data products derived from [**MODIS**](https://lpdaac.usgs.gov/data/get-started-data/collection-overview/missions/modis-overview/) and [**VIIRS**](https://lpdaac.usgs.gov/data/get-started-data/collection-overview/missions/s-npp-nasa-viirs-overview/) observations, as well as other widely-used satellite-derived environmental data (e.g. Global Precipitation Measurement Mission).
-
-**`modisfast`** uses the abilities offered by the [OPeNDAP framework](https://www.opendap.org/about) (*Open-source Project for a Network Data Access Protocol*) to download a subset of data cube, along spatial, temporal or any other data dimension (depth, ...). This way, it reduces downloading time and disk usage to their minimum : no more 1° x 1° MODIS tiles when your region of interest is only 100 km x 100 km wide ! Moreover, modisfast supports parallelized downloads.
-
-`modisfast` is hence particularly suited for retrieving MODIS or VIIRS data **over long time series** and **over areas**, rather than short time series and points.
-
-Below is a comparison of modisfast with other packages available for downloading chunks of remote sensing data :
-
-
-| Package | Data | Spatial subsetting* | Dimensional subsetting*
-| :-------------------------------------------------- | :-------------: | :-------------: | :-------------: |
-| [`modisfast`](https://github.com/ptaconet/modisfast) | MODIS, VIIRS, GPM | `r emo::ji("white heavy check mark")` | `r emo::ji("white heavy check mark")`
-| [`MODIS`](https://github.com/MatMatt/MODIS) | MODIS | `r emo::ji("cross mark")` | `r emo::ji("cross mark")`
-| [`MODIStsp`](https://github.com/ropensci/MODIStsp) | MODIS | `r emo::ji("cross mark")` | `r emo::ji("white heavy check mark")`
-| [`MODISTools`](https://github.com/ropensci/MODISTools) | MODIS | `r emo::ji("white heavy check mark")` | `r emo::ji("white heavy check mark")`
-
-\* at the downloading phase
+The goal of modisfast is to ...
## Installation
-
-The package can be installed with:
+You can install the development version of modisfast from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("ptaconet/modisfast")
```
-Work is ongoing to publish the package on the CRAN.
-
-## Get Started
-Accessing and opening MODIS data with `modisfast` is a simple workflow, as shown in the example below.
+## Example
-First, define the variables of interest :
+This is a basic example which shows you how to solve a common problem:
-```{r , eval = F, message=F}
-# Load the packages
+```{r example}
library(modisfast)
-library(sf)
-
-# MODIS collections and variables (bands) of interest
-collection <- "MOD11A1.061" # run mf_list_collections() for an exhaustive list of collections available
-variables <- c("LST_Day_1km","LST_Night_1km","QC_Day","QC_Night") # run mf_list_variables("MOD11A1.061") for an exhaustive list of variables available for the collection "MOD11A1.061"
-
-# ROI and time range of interest
-roi <- st_as_sf(data.frame(geom = "POLYGON ((-5.82 9.54, -5.42 9.55, -5.41 8.84, -5.81 8.84, -5.82 9.54))"), wkt="geom", crs = 4326) # a ROI of interest, format sf polygon
-roi_id <- "korhogo" # a name for the area of interest
-time_range <- as.Date(c("2017-01-01","2017-01-30")) # a time range of interest
-
+## basic example code
```
-Then, download the data with `modisfast`:
-
-```{r , eval = F, message=F}
-## Login to Earthdata servers with your EOSDIS credentials.
-# To create an account go to : https://urs.earthdata.nasa.gov/.
-log <- mf_login(credentials = c("username","password"))
-
-## Get the URLs of the data
-urls <- mf_get_url(
- collection = collection,
- variables = variables,
- roi = roi,
- roi_id = roi_id,
- time_range = time_range
- )
-
-## Download the data. By default the data is downloaded in a file named 'roi/collection'
-res_dl <- mf_download_data(urls)
+What is special about using `README.Rmd` instead of just `README.md`? You can include R chunks like so:
+```{r cars}
+summary(cars)
```
-And finally, open the data in R as a `terra::SpatRaster` object :
+You'll still need to render `README.Rmd` regularly, to keep `README.md` up-to-date. `devtools::build_readme()` is handy for this.
-```{r , eval = F, message=F}
-r <- mf_import_data(
- dir_path = file.path(roi_id,collection),
- collection_source = "MODIS"
- )
+You can also embed plots, for example:
+```{r pressure, echo = FALSE}
+plot(pressure)
```
-et voilà !
-
-Want more examples of use of `modisfast` ? **Have a look at the [`vignette("get_started")`](https://ptaconet.github.io/modisfast/articles/get_started.html) to get started with a simple example, and see the [`vignette("advanced_use")`](https://ptaconet.github.io/modisfast/articles/advanced_use.html) for a more advanced workflow !**
-
-
-
-
-
-
-
-## Collections available in modisfast {#coll-available}
-
-Currently `modisfast` supports download of `r nrow(mf_list_collections())` data collections, extracted from the following meta-collections :
-
-* [MODIS land products](https://lpdaac.usgs.gov/data/get-started-data/collection-overview/missions/modis-overview/) made available by the [NASA / USGS LP DAAC](https://lpdaac.usgs.gov/) (`r emo::ji("right arrow")` [source OPeNDAP server](https://opendap.cr.usgs.gov/opendap/hyrax/)) ;
-* [VIIRS land products](https://lpdaac.usgs.gov/data/get-started-data/collection-overview/missions/s-npp-nasa-viirs-overview/) made available by the [NASA / USGS LP DAAC](https://lpdaac.usgs.gov/) (`r emo::ji("right arrow")` [source OPeNDAP server](https://opendap.cr.usgs.gov/opendap/hyrax/))
-
-In addition, `modisfast` supports download of the following satellite-derived environmental data :
-
-* [Global Precipitation Measurement](https://pmm.nasa.gov/GPM) (GPM) made available by the [NASA / JAXA GES DISC](https://disc.gsfc.nasa.gov/) (`r emo::ji("right arrow")` [source OPeNDAP server](https://gpm1.gesdisc.eosdis.nasa.gov/opendap/GPM_L3)).
-
-Details of each product available for download are provided in the tables above or through the function `mf_list_collections()`. Want more details on a specific collection ? Click on the "DOI" column !
-
-MODIS and VIIRS data collections accessible with modisfast (click to expand)
-
-
-
-## Similar packages
-
-`modisfast` is particularly suited for retrieving MODIS or VIIRS data **over long time series** and **over areas**, rather than short time series and points.
-
-There are other R packages available for accessing MODIS data, which may be more suitable if your requirements differ. These include :
-
-* [`MODIS`](https://github.com/MatMatt/MODIS)
-* [`MODIStsp`](https://github.com/ropensci/MODIStsp)
-* [`MODIStools`](https://github.com/ropensci/MODIStools)
-* [`appeears`](https://github.com/bluegreen-labs/appeears)
-
-## Next steps
-
-Next developments may involve including access to more collections from other OPeNDAP servers.
-
-Any contribution is welcome !
-
-## Acknowledgments
-
-We thank NASA and its partners for making all their Earth science data freely available, and implementing open data access protocols such as OPeNDAP. `modisfast` heavily builds on top of the OPeNDAP, so we thank the non-profit [OPeNDAP, Inc.](https://www.opendap.org/about) for developing the eponym tool in an open and collaborative way.
-
-We also thank the contributors that have tested the package, reviewed the documentation and brought valuable feedbacks to improve the package : [Florian de Boissieu](https://github.com/floriandeboissieu), Julien Taconet, [Nicolas Moiroux](https://github.com/Nmoiroux)
-
-The initial development and first release of this package were financed by the [MIVEGEC](https://www.mivegec.ird.fr/en/) unit of the [French Research Institute for Sustainable Development](https://en.ird.fr/), as part of the REACT project.
-
-By enabling to download subsets of data cubes, `modisfast` facilites the access to Earth science data for R users in places where internet connection is slow or expensive and promotes digital sobriety for our research work.
-
-The OPeNDAP, over which the package builds, is a project developed by the non-profit [OPeNDAP, Inc.](https://www.opendap.org/about) and advanced openly and collaboratively. By using this data access protocol, `modisfast` support the open-source-software movement.
+In that case, don't forget to commit and push the resulting figure files, so they display on GitHub and CRAN.
diff --git a/README.md b/README.md
index 31dbd2c..5994b63 100755
--- a/README.md
+++ b/README.md
@@ -3,1992 +3,50 @@
# modisfast
-
-
-[![licence](https://img.shields.io/badge/Licence-GPL--3-blue.svg)](https://www.r-project.org/Licenses/GPL-3)
-[![Travis build
-status](https://travis-ci.org/ptaconet/modisfast.svg?branch=master)](https://travis-ci.org/ptaconet/modisfast)
-[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/modisfast)](https://cran.r-project.org/package=modisfast)
-[![Github_Status_Badge](https://img.shields.io/badge/Github-0.1.0-blue.svg)](https://github.com/ptaconet/modisfast)
-
-
-
-
-
-
-**`modisfast`** is an R package that provides functions to **speed-up**
-the **download** of time-series data products derived from
-[**MODIS**](https://lpdaac.usgs.gov/data/get-started-data/collection-overview/missions/modis-overview/)
-and
-[**VIIRS**](https://lpdaac.usgs.gov/data/get-started-data/collection-overview/missions/s-npp-nasa-viirs-overview/)
-observations, as well as other widely-used satellite-derived
-environmental data (e.g. Global Precipitation Measurement Mission).
-
-**`modisfast`** uses the abilities offered by the [OPeNDAP
-framework](https://www.opendap.org/about) (*Open-source Project for a
-Network Data Access Protocol*) to download a subset of data cube, along
-spatial, temporal or any other data dimension (depth, …). This way, it
-reduces downloading time and disk usage to their minimum : no more 1° x
-1° MODIS tiles when your region of interest is only 100 km x 100 km wide
-! Moreover, modisfast supports parallelized downloads.
-
-`modisfast` is hence particularly suited for retrieving MODIS or VIIRS
-data **over long time series** and **over areas**, rather than short
-time series and points.
-
-Below is a comparison of modisfast with other packages available for
-downloading chunks of remote sensing data :
-
-| Package | Data | Spatial subsetting\* | Dimensional subsetting\* |
-|:-------------------------------------------------------|:-----------------:|:--------------------:|:------------------------:|
-| [`modisfast`](https://github.com/ptaconet/modisfast) | MODIS, VIIRS, GPM | ✅ | ✅ |
-| [`MODIS`](https://github.com/MatMatt/MODIS) | MODIS | ❌ | ❌ |
-| [`MODIStsp`](https://github.com/ropensci/MODIStsp) | MODIS | ❌ | ✅ |
-| [`MODISTools`](https://github.com/ropensci/MODISTools) | MODIS | ✅ | ✅ |
-
-\* at the downloading phase
+The goal of modisfast is to …
## Installation
-
-
-The package can be installed with:
+You can install the development version of modisfast from
+[GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("ptaconet/modisfast")
```
-Work is ongoing to publish the package on the CRAN.
+## Example
-## Get Started
-
-Accessing and opening MODIS data with `modisfast` is a simple workflow,
-as shown in the example below.
-
-First, define the variables of interest :
+This is a basic example which shows you how to solve a common problem:
``` r
-# Load the packages
library(modisfast)
-library(sf)
-
-# MODIS collections and variables (bands) of interest
-collection <- "MOD11A1.061" # run mf_list_collections() for an exhaustive list of collections available
-variables <- c("LST_Day_1km","LST_Night_1km","QC_Day","QC_Night") # run mf_list_variables("MOD11A1.061") for an exhaustive list of variables available for the collection "MOD11A1.061"
-
-# ROI and time range of interest
-roi <- st_as_sf(data.frame(geom = "POLYGON ((-5.82 9.54, -5.42 9.55, -5.41 8.84, -5.81 8.84, -5.82 9.54))"), wkt="geom", crs = 4326) # a ROI of interest, format sf polygon
-roi_id <- "korhogo" # a name for the area of interest
-time_range <- as.Date(c("2017-01-01","2017-01-30")) # a time range of interest
+## basic example code
```
-Then, download the data with `modisfast`:
+What is special about using `README.Rmd` instead of just `README.md`?
+You can include R chunks like so:
``` r
-## Login to Earthdata servers with your EOSDIS credentials.
-# To create an account go to : https://urs.earthdata.nasa.gov/.
-log <- mf_login(credentials = c("username","password"))
-
-## Get the URLs of the data
-urls <- mf_get_url(
- collection = collection,
- variables = variables,
- roi = roi,
- roi_id = roi_id,
- time_range = time_range
- )
-
-## Download the data. By default the data is downloaded in a file named 'roi/collection'
-res_dl <- mf_download_data(urls)
-```
-
-And finally, open the data in R as a `terra::SpatRaster` object :
-
-``` r
-r <- mf_import_data(
- dir_path = file.path(roi_id,collection),
- collection_source = "MODIS"
- )
-```
-
-et voilà !
-
-Want more examples of use of `modisfast` ? **Have a look at the
-[`vignette("get_started")`](https://ptaconet.github.io/modisfast/articles/get_started.html)
-to get started with a simple example, and see the
-[`vignette("advanced_use")`](https://ptaconet.github.io/modisfast/articles/advanced_use.html)
-for a more advanced workflow !**
-
-
-
-
-
-## Collections available in modisfast
-
-Currently `modisfast` supports download of 78 data collections,
-extracted from the following meta-collections :
-
-- [MODIS land
- products](https://lpdaac.usgs.gov/data/get-started-data/collection-overview/missions/modis-overview/)
- made available by the [NASA / USGS LP DAAC](https://lpdaac.usgs.gov/)
- (➡️ [source OPeNDAP
- server](https://opendap.cr.usgs.gov/opendap/hyrax/)) ;
-- [VIIRS land
- products](https://lpdaac.usgs.gov/data/get-started-data/collection-overview/missions/s-npp-nasa-viirs-overview/)
- made available by the [NASA / USGS LP DAAC](https://lpdaac.usgs.gov/)
- (➡️ [source OPeNDAP
- server](https://opendap.cr.usgs.gov/opendap/hyrax/))
-
-In addition, `modisfast` supports download of the following
-satellite-derived environmental data :
-
-- [Global Precipitation Measurement](https://pmm.nasa.gov/GPM) (GPM)
- made available by the [NASA / JAXA GES
- DISC](https://disc.gsfc.nasa.gov/) (➡️ [source OPeNDAP
- server](https://gpm1.gesdisc.eosdis.nasa.gov/opendap/GPM_L3)).
-
-Details of each product available for download are provided in the
-tables above or through the function `mf_list_collections()`. Want more
-details on a specific collection ? Click on the “DOI” column !
-
-
-
-MODIS and VIIRS data collections accessible with modisfast (click to
-expand)
-
-
-
-
-
-
-Collection
-
-
-Name
-
-
-Source
-
-
-Nature
-
-
-DOI
-
-
-Opendap_server
-
-
-
-
-
-
-MCD12Q1.061
-
-
-MODIS/Terra+Aqua Land Cover Type Yearly L3 Global 500 m SIN Grid
-
-
-MODIS
-
-
-Land cover
-
-
-
-
-
-
-
-
-
-
-MCD15A2H.061
-
-
-MODIS/Terra+Aqua Leaf Area Index/FPAR 8-Day L4 Global 500 m SIN Grid
-
-
-MODIS
-
-
-Leaf area index
-
-
-
-
-
-
-
-
-
-
-MCD15A3H.061
-
-
-MODIS/Terra+Aqua Leaf Area Index/FPAR 4-Day L4 Global 500 m SIN Grid
-
-
-MODIS
-
-
-Leaf area index
-
-
-
-
-
-
-
-
-
-
-MCD43A1.061
-
-
-MODIS/Terra and Aqua BRDF/Albedo Model Parameters Daily L3 Global 500 m
-SIN Grid
-
-
-MODIS
-
-
-Albedo
-
-
-
-
-
-
-
-
-
-
-MCD43A2.061
-
-
-MODIS/Terra and Aqua BRDF/Albedo Quality Daily L3 Global 500 m SIN Grid
-
-
-MODIS
-
-
-Albedo
-
-
-
-
-
-
-
-
-
-
-MCD43A3.061
-
-
-MODIS/Terra and Aqua Albedo Daily L3 Global 500 m SIN Grid
-
-
-MODIS
-
-
-Albedo
-
-
-
-
-
-
-
-
-
-
-MCD43A4.061
-
-
-MODIS/Terra and Aqua Nadir BRDF-Adjusted Reflectance Daily L3 Global 500
-m SIN Grid
-
-
-MODIS
-
-
-Surface reflectance
-
-
-
-
-
-
-
-
-
-
-MCD64A1.061
-
-
-MODIS/Terra+Aqua Burned Area Monthly L3 Global 500 m SIN Grid
-
-
-MODIS
-
-
-Burned areas
-
-
-
-
-
-
-
-
-
-
-MOD09A1.061
-
-
-MODIS/Terra Surface Reflectance 8-Day L3 Global 500 m SIN Grid
-
-
-MODIS
-
-
-Surface reflectance
-
-
-
-
-
-
-
-
-
-
-MOD09GA.061
-
-
-MODIS/Terra Surface Reflectance Daily L2G Global 1 km and 500 m SIN Grid
-
-
-MODIS
-
-
-Surface reflectance
-
-
-
-
-
-
-
-
-
-
-MOD09GQ.061
-
-
-MODIS/Terra Surface Reflectance Daily L2G Global 250 m SIN Grid
-
-
-MODIS
-
-
-Surface reflectance
-
-
-
-
-
-
-
-
-
-
-MOD09Q1.061
-
-
-MODIS/Terra Surface Reflectance 8-Day L3 Global 250 m SIN Grid
-
-
-MODIS
-
-
-Surface reflectance
-
-
-
-
-
-
-
-
-
-
-MOD11A1.061
-
-
-MODIS/Terra Land Surface Temperature/Emissivity Daily L3 Global 1km SIN
-Grid v061
-
-
-MODIS
-
-
-Land surface temperature
-
-
-
-
-
-
-
-
-
-
-MOD11A2.061
-
-
-MODIS/Terra Land Surface Temperature/Emissivity 8-Day L3 Global 1 km SIN
-Grid v061
-
-
-MODIS
-
-
-Land surface temperature
-
-
-
-
-
-
-
-
-
-
-MOD11B2.061
-
-
-MODIS/Terra Land Surface Temperature/Emissivity 8-Day L3 Global 6 km SIN
-Grid
-
-
-MODIS
-
-
-Land surface temperature
-
-
-
-
-
-
-
-
-
-
-MOD11B3.061
-
-
-MODIS/Terra Land Surface Temperature/Emissivity Monthly L3 Global 6 km
-SIN Grid
-
-
-MODIS
-
-
-Land surface temperature
-
-
-
-
-
-
-
-
-
-
-MOD13A1.061
-
-
-MODIS/Terra Vegetation Indices 16-Day L3 Global 500 m SIN Grid
-
-
-MODIS
-
-
-Vegetation indices
-
-
-
-
-
-
-
-
-
-
-MOD13A2.061
-
-
-MODIS/Terra Vegetation Indices 16-Day L3 Global 1 km SIN Grid
-
-
-MODIS
-
-
-Vegetation indices
-
-
-
-
-
-
-
-
-
-
-MOD13A3.061
-
-
-MODIS/Terra Vegetation Indices Monthly L3 Global 1 km SIN Grid
-
-
-MODIS
-
-
-Vegetation indices
-
-
-
-
-
-
-
-
-
-
-MOD13Q1.061
-
-
-MODIS/Terra Vegetation Indices 16-Day L3 Global 250m SIN Grid v061
-
-
-MODIS
-
-
-Vegetation indices
-
-
-
-
-
-
-
-
-
-
-MOD15A2H.061
-
-
-MODIS/Terra Leaf Area Index/FPAR 8-Day L4 Global 500 m SIN Grid
-
-
-MODIS
-
-
-Leaf area index
-
-
-
-
-
-
-
-
-
-
-MOD16A2.061
-
-
-MODIS/Terra Net Evapotranspiration 8-Day L4 Global 500m SIN Grid v061
-
-
-MODIS
-
-
-Evapotranspiration
-
-
-
-
-
-
-
-
-
-
-MOD16A2GF.061
-
-
-MODIS/Terra Net Evapotranspiration Gap-Filled 8-Day L4 Global 500 m SIN
-Grid
-
-
-MODIS
-
-
-Evapotranspiration
-
-
-
-
-
-
-
-
-
-
-MOD16A3GF.061
-
-
-MODIS/Terra Net Evapotranspiration Gap-Filled Yearly L4 Global 500 m SIN
-Grid
-
-
-MODIS
-
-
-Evapotranspiration
-
-
-
-
-
-
-
-
-
-
-MOD17A2H.061
-
-
-MODIS/Aqua Gross Primary Productivity 8-Day L4 Global 500 m SIN Grid
-
-
-MODIS
-
-
-Primary Productivity
-
-
-
-
-
-
-
-
-
-
-MOD17A2HGF.061
-
-
-MODIS/Terra Gross Primary Productivity Gap-Filled 8-Day L4 Global 500 m
-SIN Grid
-
-
-MODIS
-
-
-Primary Productivity
-
-
-
-
-
-
-
-
-
-
-MOD17A3.055
-
-
-MODIS/Terra Net Primary Production Yearly L4 Global 1 km SIN Grid
-
-
-MODIS
-
-
-Primary Productivity
-
-
-
-
-
-
-
-
-
-MOD17A3HGF.061
-
-
-MODIS/Terra Net Primary Production Gap-Filled Yearly L4 Global 500 m SIN
-Grid
-
-
-MODIS
-
-
-Primary Productivity
-
-
-
-
-
-
-
-
-
-
-MODOCGA.061
-
-
-MODIS/Terra Ocean Reflectance Daily L2G-Lite Global 1 km SIN Grid
-
-
-MODIS
-
-
-Ocean Reflectance
-
-
-
-
-
-
-
-
-
-
-MODTBGA.061
-
-
-MODIS/Terra Thermal Bands Daily L2G-Lite Global 1 km SIN Grid
-
-
-MODIS
-
-
-Thermal Bands
-
-
-
-
-
-
-
-
-
-
-MYD09A1.061
-
-
-MODIS/Aqua Surface Reflectance 8-Day L3 Global 500 m SIN Grid
-
-
-MODIS
-
-
-Surface reflectance
-
-
-
-
-
-
-
-
-
-
-MYD09GA.061
-
-
-MODIS/Aqua Surface Reflectance Daily L2G Global 1 km and 500 m SIN Grid
-
-
-MODIS
-
-
-Surface reflectance
-
-
-
-
-
-
-
-
-
-
-MYD09GQ.061
-
-
-MODIS/Aqua Surface Reflectance Daily L2G Global 250 m SIN Grid
-
-
-MODIS
-
-
-Surface reflectance
-
-
-
-
-
-
-
-
-
-
-MYD09Q1.061
-
-
-MODIS/Aqua Surface Reflectance 8-Day L3 Global 250 m SIN Grid
-
-
-MODIS
-
-
-Surface reflectance
-
-
-
-
-
-
-
-
-
-
-MYD11A1.061
-
-
-MODIS/Aqua Land Surface Temperature/Emissivity Daily L3 Global 1km SIN
-Grid v061
-
-
-MODIS
-
-
-Land surface temperature
-
-
-
-
-
-
-
-
-
-
-MYD11A2.061
-
-
-MODIS/Aqua Land Surface Temperature/Emissivity 8-Day L3 Global 1 km SIN
-Grid v061
-
-
-MODIS
-
-
-Land surface temperature
-
-
-
-
-
-
-
-
-
-
-MYD11B2.061
-
-
-MODIS/Aqua Land Surface Temperature/Emissivity 8-Day L3 Global 6 km SIN
-Grid
-
-
-MODIS
-
-
-Land surface temperature
-
-
-
-
-
-
-
-
-
-
-MYD11B3.061
-
-
-MODIS/Aqua Land Surface Temperature/Emissivity Monthly L3 Global 6 km
-SIN Grid
-
-
-MODIS
-
-
-Land surface temperature
-
-
-
-
-
-
-
-
-
-
-MYD13A1.061
-
-
-MODIS/Aqua Vegetation Indices 16-Day L3 Global 500 m SIN Grid
-
-
-MODIS
-
-
-Vegetation indices
-
-
-
-
-
-
-
-
-
-
-MYD13A2.061
-
-
-MODIS/Aqua Vegetation Indices 16-Day L3 Global 1 km SIN Grid
-
-
-MODIS
-
-
-Vegetation indices
-
-
-
-
-
-
-
-
-
-
-MYD13A3.061
-
-
-MODIS/Aqua Vegetation Indices Monthly L3 Global 1 km SIN Grid
-
-
-MODIS
-
-
-Vegetation indices
-
-
-
-
-
-
-
-
-
-
-MYD13Q1.061
-
-
-MODIS/Aqua Vegetation Indices 16-Day L3 Global 250m SIN Grid v061
-
-
-MODIS
-
-
-Vegetation indices
-
-
-
-
-
-
-
-
-
-
-MYD15A2H.061
-
-
-MODIS/Aqua Leaf Area Index/FPAR 8-Day L4 Global 500 m SIN Grid
-
-
-MODIS
-
-
-Leaf area index
-
-
-
-
-
-
-
-
-
-
-MYD16A2.061
-
-
-MODIS/Aqua Net Evapotranspiration 8-Day L4 Global 500m SIN Grid v061
-
-
-MODIS
-
-
-Evapotranspiration
-
-
-
-
-
-
-
-
-
-
-MYD16A2GF.061
-
-
-MODIS/Aqua Net Evapotranspiration Gap-Filled 8-Day L4 Global 500 m SIN
-Grid
-
-
-MODIS
-
-
-Evapotranspiration
-
-
-
-
-
-
-
-
-
-
-MYD16A3GF.061
-
-
-MODIS/Aqua Net Evapotranspiration Gap-Filled Yearly L4 Global 500 m SIN
-Grid
-
-
-MODIS
-
-
-Evapotranspiration
-
-
-
-
-
-
-
-
-
-
-MYD17A2H.061
-
-
-MODIS/Terra Gross Primary Productivity 8-Day L4 Global 500 m SIN Grid
-
-
-MODIS
-
-
-Primary Productivity
-
-
-
-
-
-
-
-
-
-
-MYD17A2HGF.061
-
-
-MODIS/Aqua Gross Primary Productivity Gap-Filled 8-Day L4 Global 500 m
-SIN Grid
-
-
-MODIS
-
-
-Primary Productivity
-
-
-
-
-
-
-
-
-
-
-MYD17A3HGF.061
-
-
-MODIS/Aqua Net Primary Production Gap-Filled Yearly L4 Global 500 m SIN
-Grid
-
-
-MODIS
-
-
-Primary Productivity
-
-
-
-
-
-
-
-
-
-
-MYDOCGA.061
-
-
-MODIS/Aqua Ocean Reflectance Daily L2G-Lite Global 1 km SIN Grid
-
-
-MODIS
-
-
-Ocean Reflectance
-
-
-
-
-
-
-
-
-
-
-MYDTBGA.061
-
-
-MODIS/Aqua Thermal Bands Daily L2G-Lite Global 1 km SIN Grid
-
-
-MODIS
-
-
-Thermal Bands
-
-
-
-
-
-
-
-
-
-
-VNP09A1.001
-
-
-VIIRS/NPP Surface Reflectance 8-Day L3 Global 1 km SIN Grid
-
-
-VIIRS
-
-
-Surface reflectance
-
-
-
-
-
-
-
-
-
-
-VNP09H1.001
-
-
-VIIRS/NPP Surface Reflectance 8-Day L3 Global 500 m SIN Grid
-
-
-VIIRS
-
-
-Surface reflectance
-
-
-
-
-
-
-
-
-
-
-VNP13A1.001
-
-
-VIIRS/NPP Vegetation Indices 16-Day L3 Global 500 m SIN Grid
-
-
-VIIRS
-
-
-Vegetation indices
-
-
-
-
-
-
-
-
-
-
-VNP13A2.001
-
-
-VIIRS/NPP Vegetation Indices 16-Day L3 Global 1 km SIN Grid
-
-
-VIIRS
-
-
-Vegetation indices
-
-
-
-
-
-
-
-
-
-
-VNP13A3.001
-
-
-VIIRS/NPP Vegetation Indices Monthly L3 Global 1 km SIN Grid
-
-
-VIIRS
-
-
-Vegetation indices
-
-
-
-
-
-
-
-
-
-
-VNP14A1.001
-
-
-VIIRS/NPP Thermal Anomalies/Fire Daily L3 Global 1 km SIN Grid
-
-
-VIIRS
-
-
-Thermal Anomalies/Fire
-
-
-
-
-
-
-
-
-
-
-VNP15A2H.001
-
-
-VIIRS/NPP Leaf Area Index/FPAR 8-Day L4 Global 500 m SIN Grid
-
-
-VIIRS
-
-
-Leaf area index
-
-
-
-
-
-
-
-
-
-
-VNP21A1D.001
-
-
-VIIRS/NPP Land Surface Temperature and Emissivity Daily L3 Global 1 km
-SIN Grid Day
-
-
-VIIRS
-
-
-Land surface temperature
-
-
-
-
-
-
-
-
-
-
-VNP21A1N.001
-
-
-VIIRS/NPP Land Surface Temperature and Emissivity Daily L3 Global 1 km
-SIN Grid Night
-
-
-VIIRS
-
-
-Land surface temperature
-
-
-
-
-
-
-
-
-
-
-VNP21A2.001
-
-
-VIIRS/NPP Land Surface Temperature and Emissivity 8-Day L3 Global 1 km
-SIN Grid
-
-
-VIIRS
-
-
-Land surface temperature
-
-
-
-
-
-
-
-
-
-
-VNP43IA2.001
-
-
-VIIRS/NPP BRDF/Albedo Quality Daily L3 Global 500 m SIN Grid
-
-
-VIIRS
-
-
-Albedo
-
-
-
-
-
-
-
-
-
-
-VNP43IA3.001
-
-
-VIIRS/NPP Albedo Daily L3 Global 500 m SIN Grid
-
-
-VIIRS
-
-
-Albedo
-
-
-
-
-
-
-
-
-
-
-VNP43IA4.001
-
-
-VIIRS/NPP Nadir BRDF-Adjusted Reflectance Daily L3 Global 500 m SIN Grid
-
-
-VIIRS
-
-
-Surface reflectance
-
-
-
-
-
-
-
-
-
-
-VNP43MA1.001
-
-
-VIIRS/NPP BRDF/Albedo Model Parameters Daily L3 Global 1 km SIN
-
-
-VIIRS
-
-
-Albedo
-
-
-
-
-
-
-
-
-
-
-VNP43MA2.001
-
-
-VIIRS/NPP BRDF/Albedo Quality Daily L3 Global 1 km SIN Grid
-
-
-VIIRS
-
-
-Albedo
-
-
-
-
-
-
-
-
-
-
-VNP43MA3.001
-
-
-VIIRS/NPP Albedo Daily L3 Global 1 km SIN Grid
-
-
-VIIRS
-
-
-Albedo
-
-
-
-
-
-
-
-
-
-
-VNP43MA4.001
-
-
-VIIRS/NPP Nadir BRDF-Adjusted Reflectance Daily L3 Global 1 km SIN
-
-
-VIIRS
-
-
-Surface reflectance
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Other (non-MODIS or VIIRS) data collections accessible with modisfast
-(click to expand)
-
-
-
-
-
-
-Collection
-
-
-Name
-
-
-Source
-
-
-Nature
-
-
-DOI
-
-
-Opendap_server
-
-
-
-
-
-
-GPM_3IMERGDE.06
-
-
-GPM IMERG Early Precipitation L3 1 day 0.1 degree x 0.1 degree V06
-
-
-GPM
-
-
-Rainfall
-
-
-
-
-
-
-
-
-
-
-GPM_3IMERGDF.06
-
-
-GPM IMERG Final Precipitation L3 1 day 0.1 degree x 0.1 degree V06
-
-
-GPM
-
-
-Rainfall
-
-
-
-
-
-
-
-
-
-
-GPM_3IMERGDF.07
-
-
-GPM IMERG Final Precipitation L3 1 day 0.1 degree x 0.1 degree V07
-
-
-GPM
-
-
-Rainfall
-
-
-
-
-
-
-
-
-
-
-GPM_3IMERGDL.06
-
-
-GPM IMERG Late Precipitation L3 1 day 0.1 degree x 0.1 degree V06
-
-
-GPM
-
-
-Rainfall
-
-
-
-
-
-
-
-
-
-
-GPM_3IMERGHH.06
-
-
-GPM IMERG Final Precipitation L3 Half Hourly 0.1 degree x 0.1 degree V06
-
-
-GPM
-
-
-Rainfall
-
-
-
-
-
-
-
-
-
-
-GPM_3IMERGHH.07
-
-
-GPM IMERG Final Precipitation L3 Half Hourly 0.1 degree x 0.1 degree V07
-
-
-GPM
-
-
-Rainfall
-
-
-
-
-
-
-
-
-
-
-GPM_3IMERGHHE.06
-
-
-GPM IMERG Early Precipitation L3 Half Hourly 0.1 degree x 0.1 degree V06
-
-
-GPM
-
-
-Rainfall
-
-
-
-
-
-
-
-
-
-
-GPM_3IMERGHHL.06
-
-
-GPM IMERG Late Precipitation L3 Half Hourly 0.1 degree x 0.1 degree V06
-
-
-GPM
-
-
-Rainfall
-
-
-
-
-
-
-
-
-
-
-GPM_3IMERGM.06
-
-
-GPM IMERG Final Precipitation L3 1 month 0.1 degree x 0.1 degree V06
-
-
-GPM
-
-
-Rainfall
-
-
-
-
-
-
-
-
-
-
-GPM_3IMERGM.07
-
-
-GPM IMERG Final Precipitation L3 1 month 0.1 degree x 0.1 degree V07
-
-
-GPM
-
-
-Rainfall
-
-
-
-
-
-
-
-
-
-
-
-
-
-## Similar packages
-
-`modisfast` is particularly suited for retrieving MODIS or VIIRS data
-**over long time series** and **over areas**, rather than short time
-series and points.
-
-There are other R packages available for accessing MODIS data, which may
-be more suitable if your requirements differ. These include :
-
-- [`MODIS`](https://github.com/MatMatt/MODIS)
-- [`MODIStsp`](https://github.com/ropensci/MODIStsp)
-- [`MODIStools`](https://github.com/ropensci/MODIStools)
-- [`appeears`](https://github.com/bluegreen-labs/appeears)
-
-## Next steps
-
-Next developments may involve including access to more collections from
-other OPeNDAP servers.
-
-Any contribution is welcome !
-
-## Acknowledgments
-
-We thank NASA and its partners for making all their Earth science data
-freely available, and implementing open data access protocols such as
-OPeNDAP. `modisfast` heavily builds on top of the OPeNDAP, so we thank
-the non-profit [OPeNDAP, Inc.](https://www.opendap.org/about) for
-developing the eponym tool in an open and collaborative way.
-We also thank the contributors that have tested the package, reviewed
-the documentation and brought valuable feedbacks to improve the package
-: [Florian de Boissieu](https://github.com/floriandeboissieu), Julien
-Taconet, [Nicolas Moiroux](https://github.com/Nmoiroux)
+You’ll still need to render `README.Rmd` regularly, to keep `README.md`
+up-to-date. `devtools::build_readme()` is handy for this.
-The initial development and first release of this package were financed
-by the [MIVEGEC](https://www.mivegec.ird.fr/en/) unit of the [French
-Research Institute for Sustainable Development](https://en.ird.fr/), as
-part of the REACT project.
+You can also embed plots, for example:
-By enabling to download subsets of data cubes, `modisfast` facilites the
-access to Earth science data for R users in places where internet
-connection is slow or expensive and promotes digital sobriety for our
-research work.
+
-The OPeNDAP, over which the package builds, is a project developed by
-the non-profit [OPeNDAP, Inc.](https://www.opendap.org/about) and
-advanced openly and collaboratively. By using this data access protocol,
-`modisfast` support the open-source-software movement.
+In that case, don’t forget to commit and push the resulting figure
+files, so they display on GitHub and CRAN.
diff --git a/dev_history.R b/dev_history.R
index 2742856..7b8ebcb 100755
--- a/dev_history.R
+++ b/dev_history.R
@@ -41,7 +41,7 @@ usethis::use_travis()
## Manual step : Commit and push
## Document functions and dependencies
-attachment::att_to_description()
+attachment::att_amend_desc()
## Check the package
devtools::check()
diff --git a/docs/LICENSE.html b/docs/LICENSE.html
old mode 100644
new mode 100755
index c5a019e..955cf58
--- a/docs/LICENSE.html
+++ b/docs/LICENSE.html
@@ -6,7 +6,7 @@
-GNU General Public License • opendapr
+GNU General Public License • modisfast
@@ -62,7 +62,7 @@
- opendapr
+ modisfast0.1.0
@@ -89,7 +89,7 @@
1. Get started
stars or ncdf4 object are best adapted for these kind of spatiotemporal data. However, in this example we will show how to import them as lists of RasterLayer objects : one list for each time range.
Before starting, let’s identify our collections of interest among the collections that are available for download, using the function odr_list_collections() :
Before starting, let’s identify our collections of interest among the collections that are available for download, using the function mf_list_collections() :
With the function odr_get_url(), we get the https URLs for our collections of interest (MOD11A1.006, GPM_3IMERGDF.06 and SPL3SMP_E.003) given our ROI and time frame.
-
Note on the use of the parameter variables of the function odr_get_url() :
-
The collections generally contain several variables (sometimes called “dimensions”, or “bands”). As an example, MODIS LST products contain one band for the day temperature (“LST_Day_1km”), one band for the night temperature (“LST_Night_1km”), etc. To get all the variables available for a given collection along with information for each of them (description, etc.), use the function odr_list_variables(). e.g. :
With the function mf_get_url(), we get the https URLs for our collections of interest (MOD11A1.006, GPM_3IMERGDF.06 and SPL3SMP_E.003) given our ROI and time frame.
+
Note on the use of the parameter variables of the function mf_get_url() :
+
The collections generally contain several variables (sometimes called “dimensions”, or “bands”). As an example, MODIS LST products contain one band for the day temperature (“LST_Day_1km”), one band for the night temperature (“LST_Night_1km”), etc. To get all the variables available for a given collection along with information for each of them (description, etc.), use the function mf_list_variables(). e.g. :
In odr_get_url(), the parameter variables enables to restrict the data to download to only specific variables. By default it is set to NULL, which means that all the available variables for the specified collection are downloaded. Specifying variables will make the data to download lighter.
+
In mf_get_url(), the parameter variables enables to restrict the data to download to only specific variables. By default it is set to NULL, which means that all the available variables for the specified collection are downloaded. Specifying variables will make the data to download lighter.
End Note
In our example, we specify some variables for each collection.
#> OK## Get the URLs of SMAP 3-days
-urls_smap <-odr_get_url(
+urls_smap <-mf_get_url(collection ="SPL3SMP_E.003",
-variables =c("Soil_Moisture_Retrieval_Data_AM_soil_moisture","Soil_Moisture_Retrieval_Data_AM_retrieval_qual_flag","Soil_Moisture_Retrieval_Data_PM_soil_moisture_pm","Soil_Moisture_Retrieval_Data_PM_retrieval_qual_flag_pm"), # get the variables available with : odr_list_variables("SMAP/SPL3SMP_E.003")
+variables =c("Soil_Moisture_Retrieval_Data_AM_soil_moisture","Soil_Moisture_Retrieval_Data_AM_retrieval_qual_flag","Soil_Moisture_Retrieval_Data_PM_soil_moisture_pm","Soil_Moisture_Retrieval_Data_PM_retrieval_qual_flag_pm"), # get the variables available with : mf_list_variables("SMAP/SPL3SMP_E.003")roi = roi,time_range = time_range )
@@ -287,11 +287,11 @@
Destination file for each dataset is specified in the column destfile of the dataframes urls_mod11a1, urls_gpm and urls_smap. The destination file is specified by default but it can of course be modified.
Setting the argument parallel to TRUE will parallelize - therefore fasten - the download in case their are numerous datasets to download
Importing the data in R goes beyond the scope of this package. However, here we provide some tips and tricks to do the job for further data analysis in R !
-
Various packages and related classes can be used to read the datacubes downloaded through OPeNDAP (in NetCDF, ascii or json format). If raster is surely the most famous class for raster objects, many packages facilitate the use of spatiotemporal data cubes in formats such as those proposed through opendapr (e.g. NetCDF). For instance, MODIS or VIIRS products can be imported as a stars object from the excellent stars package for data cubes manipulation. All the data can also be imported as ncdf4 objects using e.g. the ncdf4 package, or RasterLayer of the raster package.
+
Various packages and related classes can be used to read the datacubes downloaded through OPeNDAP (in NetCDF, ascii or json format). If raster is surely the most famous class for raster objects, many packages facilitate the use of spatiotemporal data cubes in formats such as those proposed through modisfast (e.g. NetCDF). For instance, MODIS or VIIRS products can be imported as a stars object from the excellent stars package for data cubes manipulation. All the data can also be imported as ncdf4 objects using e.g. the ncdf4 package, or RasterLayer of the raster package.
Important note regarding the import of the data in R
-
In any case, care must be taken when importing data that was downloaded through the OPeNDAP data providers servers. Depending on the collection, some “issues” were raised. These issues are independant from opendapr : they result most of time of a kind of lack of full implementation of the OPeNDAP framework by the data providers. These issues are :
+
In any case, care must be taken when importing data that was downloaded through the OPeNDAP data providers servers. Depending on the collection, some “issues” were raised. These issues are independant from modisfast : they result most of time of a kind of lack of full implementation of the OPeNDAP framework by the data providers. These issues are :
for MODIS and VIIRS collections : CRS has to be provided
for GPM collections : CRS has to be provided + data have to be flipped
for SMAP collections : CRS + bounding coordinates of the data have to be provided
-
These issues can easily be dealt at the import phase in R. Below we propose some functions that include the processings that have to be done at the data import phase in order to open the data as raster objects. (argument destfiles is the path to a dataset downloaded with opendapr - output of odr_get_url()$destfile - and variable is the name of a variable to import).
+
These issues can easily be dealt at the import phase in R. Below we propose some functions that include the processings that have to be done at the data import phase in order to open the data as raster objects. (argument destfiles is the path to a dataset downloaded with modisfast - output of mf_get_url()$destfile - and variable is the name of a variable to import).
@@ -375,13 +375,13 @@
Import SMAP
As a RasterLayer object :
-
We set-up the missing bounding coordinates. For this we use the function odr_get_opt_param().
+
We set-up the missing bounding coordinates. For this we use the function mf_get_opt_param().
First we call the useful packages and we the script : define ROI and time frames (here, for the example, the month of january for each year from 2016 to 2019)
-
+
diff --git a/docs/docsearch.css b/docs/docsearch.css
old mode 100644
new mode 100755
diff --git a/docs/docsearch.js b/docs/docsearch.js
old mode 100644
new mode 100755
diff --git a/docs/index.html b/docs/index.html
old mode 100644
new mode 100755
index c38269e..00aec59
--- a/docs/index.html
+++ b/docs/index.html
@@ -5,7 +5,7 @@
-Fast Download of many Earth Observation Data in R using the OPeNDAP Capacities • opendapr
+Fast Download of many Earth Observation Data in R using the OPeNDAP Capacities • modisfast
@@ -30,7 +30,7 @@
- opendapr
+ modisfast0.1.0
opendapr is an R package that provides functions to harmonize and speed-up the download of some well-known and widely-used spatiotemporal Earth science datacubes (e.g. MODIS, VIIRS, GPM or SMAP) using the OPeNDAP framework (Open-source Project for a Network Data Access Protocol)
+
modisfast is an R package that provides functions to harmonize and speed-up the download of some well-known and widely-used spatiotemporal Earth science datacubes (e.g. MODIS, VIIRS, GPM or SMAP) using the OPeNDAP framework (Open-source Project for a Network Data Access Protocol)
Harmonize ?
-
opendapr proposes a single function to query the various data servers, and another single function to download the data.
+
modisfast proposes a single function to query the various data servers, and another single function to download the data.
Speed-up ?
-
opendapr uses the abilities offered by the OPeNDAP to download a subset of data cube, along spatial, temporal or any other data dimension (depth, …). This way, it reduces downloading time and disk usage to their minimum : no more 1° x 1° MODIS tiles when your region of interest is only 100 km x 100 km wide ! Moreover, opendapr supports parallelized downloads.
-
Below is a comparison of opendapr with other packages available for downloading chunks of remote sensing data :
+
modisfast uses the abilities offered by the OPeNDAP to download a subset of data cube, along spatial, temporal or any other data dimension (depth, …). This way, it reduces downloading time and disk usage to their minimum : no more 1° x 1° MODIS tiles when your region of interest is only 100 km x 100 km wide ! Moreover, modisfast supports parallelized downloads.
+
Below is a comparison of modisfast with other packages available for downloading chunks of remote sensing data :
By enabling to download subsets of data cubes, opendapr facilites the access to Earth science data for R users in places where internet connection is slow or expensive and promotes digital sobriety for our research work.
-
The OPeNDAP, over which the package builds, is a project developed by the non-profit OPeNDAP, Inc. and advanced openly and collaboratively. By using this data access protocol, opendapr support the open-source-software movement.
+
By enabling to download subsets of data cubes, modisfast facilites the access to Earth science data for R users in places where internet connection is slow or expensive and promotes digital sobriety for our research work.
+
The OPeNDAP, over which the package builds, is a project developed by the non-profit OPeNDAP, Inc. and advanced openly and collaboratively. By using this data access protocol, modisfast support the open-source-software movement.
Details of each product available for download are provided in the table above or through the function odr_list_collections(). Want more details on a specific collection ? Click on the “DOI” column !
-Data collections available for download with opendapr (click to expand)
+
Details of each product available for download are provided in the table above or through the function mf_list_collections(). Want more details on a specific collection ? Click on the “DOI” column !
+Data collections available for download with modisfast (click to expand)
@@ -1741,22 +1741,22 @@
Get Started
-
Downloading the data with opendapr is a simple two-steps workflow :
+
Downloading the data with modisfast is a simple two-steps workflow :
-
With the function odr_get_url(), get the URL(s) of the data for :
+
With the function mf_get_url(), get the URL(s) of the data for :
Next, with the function odr_download_data() : download the data to your computer.
+
Next, with the function mf_download_data() : download the data to your computer.
-
Additional functions include : list collection available for download ( odr_list_collections() ), list variables available for each collection ( odr_list_variables() ), login to EOSDIS Earthdata before querying the servers and downloading the data (odr_login()).
Additional functions include : list collection available for download ( mf_list_collections() ), list variables available for each collection ( mf_list_variables() ), login to EOSDIS Earthdata before querying the servers and downloading the data (mf_login()).
We thank NASA and its partners for making all their Earth science data freely available, and implementing open data access protocols such as OPeNDAP. opendapr heavily builds on top of the OPeNDAP, so we thank the non-profit OPeNDAP, Inc. for developing the eponym tool in an open and collaborative way.
+
We thank NASA and its partners for making all their Earth science data freely available, and implementing open data access protocols such as OPeNDAP. modisfast heavily builds on top of the OPeNDAP, so we thank the non-profit OPeNDAP, Inc. for developing the eponym tool in an open and collaborative way.
We also thank the contributors that have tested the package, reviewed the documentation and brought valuable feedbacks to improve the package : Florian de Boissieu, Julien Taconet, Nicolas Moiroux
diff --git a/docs/link.svg b/docs/link.svg
old mode 100644
new mode 100755
diff --git a/docs/logo.png b/docs/logo.png
old mode 100644
new mode 100755
diff --git a/docs/pkgdown.css b/docs/pkgdown.css
old mode 100644
new mode 100755
diff --git a/docs/pkgdown.js b/docs/pkgdown.js
old mode 100644
new mode 100755
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
old mode 100644
new mode 100755
diff --git a/man/figures/README-plot_roi-1.png b/man/figures/README-plot_roi-1.png
old mode 100644
new mode 100755
diff --git a/man/figures/logo.png b/man/figures/logo.png
old mode 100644
new mode 100755
diff --git a/man/odr_download_data.Rd b/man/mf_download_data.Rd
similarity index 68%
rename from man/odr_download_data.Rd
rename to man/mf_download_data.Rd
index 9a00862..b5a438a 100644
--- a/man/odr_download_data.Rd
+++ b/man/mf_download_data.Rd
@@ -1,14 +1,20 @@
% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/odr_download_data.R
-\name{odr_download_data}
-\alias{odr_download_data}
+% Please edit documentation in R/mf_download_data.R
+\name{mf_download_data}
+\alias{mf_download_data}
\title{Download several datasets given their URLs and destination path}
\usage{
-odr_download_data(df_to_dl, parallel = FALSE, credentials = NULL,
- source = NULL, verbose = TRUE, min_filesize = 5000)
+mf_download_data(
+ df_to_dl,
+ parallel = TRUE,
+ credentials = NULL,
+ source = "earthdata",
+ verbose = TRUE,
+ min_filesize = 5000
+)
}
\arguments{
-\item{df_to_dl}{data.frame. Urls and destination files of dataset to download. Typically output of \link{odr_get_url}. See Details for the structure}
+\item{df_to_dl}{data.frame. Urls and destination files of dataset to download. Typically output of \link{mf_get_url}. See Details for the structure}
\item{parallel}{boolean. Parallelize the download ? Default to FALSE}
@@ -29,7 +35,7 @@ a data.frame with the same structure of the input data.frame \code{df_to_dl} + c
}
}
\description{
-This function enables to download datasets. In a data import workflow, this function is typically used after a call to the \link{odr_get_url} function. The output value of \link{odr_get_url} can be used as input of parameter \code{df_to_dl} of \link{odr_download_data}.
+This function enables to download datasets. In a data import workflow, this function is typically used after a call to the \link{mf_get_url} function. The output value of \link{mf_get_url} can be used as input of parameter \code{df_to_dl} of \link{mf_download_data}.
The download can the parallelized.
}
@@ -42,7 +48,7 @@ Parameter \code{df_to_dl} must a data.frame with the following minimal structure
Parameter \code{source} takes NULL as default value. Options are :
\itemize{
-\item{ \code{NULL} : } {when no odr_login is required to download the data. }
-\item{ \code{"earthdata"} : } {to download data requiring a odr_login to EOSDIS Earthdata. To create an account go to : https://urs.earthdata.nasa.gov/ }
+\item{ \code{NULL} : } {when no mf_login is required to download the data. }
+\item{ \code{"earthdata"} : } {to download data requiring a mf_login to EOSDIS Earthdata. To create an account go to : https://urs.earthdata.nasa.gov/ }
}
}
diff --git a/man/odr_get_opt_param.Rd b/man/mf_get_opt_param.Rd
similarity index 68%
rename from man/odr_get_opt_param.Rd
rename to man/mf_get_opt_param.Rd
index 674ded6..925a4e4 100644
--- a/man/odr_get_opt_param.Rd
+++ b/man/mf_get_opt_param.Rd
@@ -1,15 +1,15 @@
% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/odr_get_opt_param.R
-\name{odr_get_opt_param}
-\alias{odr_get_opt_param}
-\title{Precompute the parameter \code{opt_param} of the function \link{odr_get_url}}
+% Please edit documentation in R/mf_get_opt_param.R
+\name{mf_get_opt_param}
+\alias{mf_get_opt_param}
+\title{Precompute the parameter \code{opt_param} of the function \link{mf_get_url}}
\usage{
-odr_get_opt_param(collection, roi, credentials = NULL, verbose = TRUE)
+mf_get_opt_param(collection, roi, credentials = NULL, verbose = TRUE)
}
\arguments{
-\item{collection}{string. mandatory. Collection of interest (see details of \link{odr_get_url}).}
+\item{collection}{string. mandatory. Collection of interest (see details of \link{mf_get_url}).}
-\item{roi}{object of class \code{sf}. mandatory. Region of interest. Must be POLYGON-type geometry composed of one single feature.}
+\item{roi}{object of class \code{sf}. mandatory. Area of region of interest. Must be POLYGON-type geometry composed of one single feature.}
\item{credentials}{vector string of length 2 with username and password. optional.}
@@ -28,10 +28,10 @@ a list with the following named objects :
}
}
\description{
-Precompute the parameter \code{opt_param} to further provide as input of the \link{odr_get_url} function. Useful to speed-up the overall processing time.
+Precompute the parameter \code{opt_param} to further provide as input of the \link{mf_get_url} function. Useful to speed-up the overall processing time.
}
\details{
-When it is needed to loop the function \link{odr_get_url} over several time frames, it is advised to previously run the function \code{odr_get_opt_param} and provide the output as input \code{opt_param} parameter of the \link{odr_get_url} function.
+When it is needed to loop the function \link{mf_get_url} over several time frames, it is advised to previously run the function \code{mf_get_opt_param} and provide the output as input \code{opt_param} parameter of the \link{mf_get_url} function.
This will save much time, as internal parameters will be calculated only once.
}
\examples{
@@ -41,24 +41,24 @@ require(sf)
require(purrr)
# Login to Earthdata
-log <- odr_login(c(Sys.getenv("earthdata_un"),Sys.getenv("earthdata_pw")),source="earthdata")
+log <- mf_login(c(Sys.getenv("earthdata_un"),Sys.getenv("earthdata_pw")),source="earthdata")
# Get the optional parameters for the collection MOD11A1.006 and the roi :
roi <- st_as_sf(data.frame(
geom="POLYGON ((-5.82 9.54, -5.42 9.55, -5.41 8.84, -5.81 8.84, -5.82 9.54))"),
wkt="geom",crs = 4326)
-opt_param_mod11a1 <- odr_get_opt_param("MOD11A1.006",roi)
+opt_param_mod11a1 <- mf_get_opt_param("MOD11A1.006",roi)
str(opt_param_mod11a1)
-# Now we can provide opt_param_mod11a1 as input parameter of the function odr_get_url().
+# Now we can provide opt_param_mod11a1 as input parameter of the function mf_get_url().
time_ranges <- list(as.Date(c("2016-01-01","2016-01-31")),
as.Date(c("2017-01-01","2017-01-31")),
as.Date(c("2018-01-01","2018-01-31")),
as.Date(c("2019-01-01","2019-01-31")))
-(urls_mod11a1 <- map(.x = time_ranges, ~odr_get_url(
+(urls_mod11a1 <- map(.x = time_ranges, ~mf_get_url(
collection = "MOD11A1.006",
variables = c("LST_Day_1km","LST_Night_1km","QC_Day","QC_Night"),
roi = roi,
diff --git a/man/odr_get_url.Rd b/man/mf_get_url.Rd
similarity index 74%
rename from man/odr_get_url.Rd
rename to man/mf_get_url.Rd
index 1475210..7b7f743 100644
--- a/man/odr_get_url.Rd
+++ b/man/mf_get_url.Rd
@@ -1,19 +1,30 @@
% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/odr_get_url.R
-\name{odr_get_url}
-\alias{odr_get_url}
+% Please edit documentation in R/mf_get_url.R
+\name{mf_get_url}
+\alias{mf_get_url}
\title{Build the URL(s) of the data to download}
\usage{
-odr_get_url(collection, variables = NULL, roi, time_range,
- output_format = "nc4", single_netcdf = TRUE, opt_param = NULL,
- credentials = NULL, verbose = TRUE)
+mf_get_url(
+ collection,
+ variables = NULL,
+ roi,
+ roi_id,
+ time_range,
+ output_format = "nc4",
+ single_netcdf = TRUE,
+ opt_param = NULL,
+ credentials = NULL,
+ verbose = TRUE
+)
}
\arguments{
-\item{collection}{string. mandatory. Collection of interest (see details of \link{odr_get_url}).}
+\item{collection}{string. mandatory. Collection of interest (see details of \link{mf_get_url}).}
-\item{variables}{string vector. optional. Variables to retrieve for the collection of interest. If not specified (default) all available variables will be extracted (see details of \link{odr_get_url}).}
+\item{variables}{string vector. optional. Variables to retrieve for the collection of interest. If not specified (default) all available variables will be extracted (see details of \link{mf_get_url}).}
-\item{roi}{object of class \code{sf}. mandatory. Region of interest. Must be POLYGON-type geometry composed of one single feature.}
+\item{roi}{object of class \code{sf}. mandatory. Area of region of interest. Must be POLYGON-type geometry composed of one single feature.}
+
+\item{roi_id}{string. mandatory. An identifier for the region of interest.}
\item{time_range}{date(s) / POSIXlt of interest . mandatory. Single date/datetime or time frame : vector with start and end dates/times (see details).}
@@ -40,18 +51,18 @@ a data.frame with one row for each dataset to download and 4 columns :
This is the main function of the package. It enables to build the URL(s) of the spatiotemporal datacube to download, given a collection, variables, region and time range of interest.
}
\details{
-Argument \code{collection} : Collections available can be retrieved with the function \link{odr_list_collections}
+Argument \code{collection} : Collections available can be retrieved with the function \link{mf_list_collections}
-Argument \code{variables} : For each collection, variables available can be retrieved with the function \link{odr_list_variables}
+Argument \code{variables} : For each collection, variables available can be retrieved with the function \link{mf_list_variables}
Argument \code{time_range} : Can be provided either as i) a single date (e.g. \code{as.Date("2017-01-01"))} or ii) a time frame provided as two bounding dates (starting and ending time) ( e.g. \code{as.Date(c("2010-01-01","2010-01-30"))}) or iii) a POSIXlt single time (e.g. \code{as.POSIXlt("2010-01-01 18:00:00")}) or iv) a POSIXlt time range (e.g. \code{as.POSIXlt(c("2010-01-01 18:00:00","2010-01-02 09:00:00"))}) for the half-hourly collection (GPM_3IMERGHH.06). If POSIXlt, times must be in UTC.
Argument \code{single_netcdf} : for MODIS and VIIRS products from LP DAAC: download the data as a single file encompassing the whole time frame (TRUE) or as multiple files : one for each date, which is the behavious for the other collections - GPM and SMAP) (FALSE) ?
-Argument \code{opt_param} : list of parameters related to the queried OPeNDAP server and the roi. See \link{odr_get_opt_param} for additional details. The list can be retrieved outside the function with the function \link{odr_get_opt_param}. If not provided, it will be automatically calculated within the \link{odr_get_url} function. However, providing it fastens the processing time.
+Argument \code{opt_param} : list of parameters related to the queried OPeNDAP server and the roi. See \link{mf_get_opt_param} for additional details. The list can be retrieved outside the function with the function \link{mf_get_opt_param}. If not provided, it will be automatically calculated within the \link{mf_get_url} function. However, providing it fastens the processing time.
It might be particularly useful to precompute and provide it in case the function is used within a loop for the same ROI.
-Argument \code{credentials} : Login to the OPeNDAP servers is required to use the function. odr_login can be done either within the function or outside with the function \link{odr_login}
+Argument \code{credentials} : Login to the OPeNDAP servers is required to use the function. mf_login can be done either within the function or outside with the function \link{mf_login}
}
\examples{
@@ -59,14 +70,13 @@ Argument \code{credentials} : Login to the OPeNDAP servers is required to use th
require(sf)
require(magrittr)
-require(raster)
-require(stars)
+require(terra)
-### First odr_login to EOSDIS Earthdata with username and password.
+### First mf_login to EOSDIS Earthdata with username and password.
# To create an account go to : https://urs.earthdata.nasa.gov/.
username <- Sys.getenv("earthdata_un")
password <- Sys.getenv("earthdata_pw")
-log <- odr_login(credentials = c(username,password), source = "earthdata")
+log <- mf_login(credentials = c(username,password), source = "earthdata")
### Retrieve the URLs (OPeNDAP) to download the following datasets :
# MODIS Terra LST Daily (MOD11A1.006) (collection)
@@ -74,6 +84,7 @@ log <- odr_login(credentials = c(username,password), source = "earthdata")
# over a 50km x 70km region of interest (roi)
# for the time frame 2017-01-01 to 2017-01-30 (30 days) (time_range)
+roi_id = "korhogo"
roi = st_as_sf(data.frame(
geom="POLYGON ((-5.82 9.54, -5.42 9.55, -5.41 8.84, -5.81 8.84, -5.82 9.54))"),
wkt="geom",crs = 4326)
@@ -81,20 +92,21 @@ wkt="geom",crs = 4326)
time_range = as.Date(c("2017-01-01","2017-01-30"))
############################################################
-(opendap_urls_mod11a1 <- odr_get_url(collection = "MOD11A1.006",
+(opendap_urls_mod11a1 <- mf_get_url(collection = "MOD11A1.006",
variables = c("LST_Day_1km","LST_Night_1km"),
-roi = roi,
+roi_id = roi_id,
+roi_sf = roi_sf,
time_range = time_range
))
############################################################
### Download the data :
-res_dl <- odr_download_data(opendap_urls_mod11a1)
+res_dl <- mf_download_data(opendap_urls_mod11a1)
### Import the data :
## Have a look at vignette("opendapr1) for important details regarding the data import in R.
-## \\url{https://ptaconet.github.io/opendapr/articles/opendapr1.html#data_import_note}
+## \url{https://ptaconet.github.io/modisfast/articles/opendapr1.html#data_import_note}
modis_crs <- "+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs"
## open as a stars object (deals with multiple dimensions and time)
diff --git a/man/mf_import_data.Rd b/man/mf_import_data.Rd
new file mode 100644
index 0000000..8332657
--- /dev/null
+++ b/man/mf_import_data.Rd
@@ -0,0 +1,61 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/mf_import_data.R
+\name{mf_import_data}
+\alias{mf_import_data}
+\title{Import the time series in R as a \code{SpatRaster} object}
+\usage{
+mf_import_data(
+ dir_path,
+ collection_source,
+ output_class = "SpatRaster",
+ proj_epsg = "4326"
+)
+}
+\arguments{
+\item{dir_path}{string character vector. mandatory. The path to the local directory where the data are stored.}
+
+\item{collection_source}{character string. mandatory. The collection source (one of "MODIS", "VIIRS", "GPM")}
+
+\item{output_class}{character string. Output object class. Currently only "SpatRaster" implemented.}
+
+\item{proj_epsg}{character string. EPSG of the desired projection for the output raster (default : 4326)}
+}
+\description{
+Import a time series as a \code{SpatRaster}object
+}
+\examples{
+
+\donttest{
+
+require(sf)
+require(magrittr)
+require(terra)
+
+username <- Sys.getenv("earthdata_un")
+password <- Sys.getenv("earthdata_pw")
+log <- mf_login(credentials = c(username,password))
+
+roi_id <- "korhogo"
+roi = st_as_sf(data.frame(
+geom="POLYGON ((-5.82 9.54, -5.42 9.55, -5.41 8.84, -5.81 8.84, -5.82 9.54))"),
+wkt="geom",crs = 4326)
+
+time_range = as.Date(c("2017-01-01","2017-01-30"))
+
+urls_mod11a1 <- mf_get_url(collection = "MOD11A1.061",
+variables = c("LST_Day_1km","LST_Night_1km"),
+roi = roi,
+roi_id = roi_id,
+time_range = time_range
+)
+
+res_dl <- mf_download_data(urls_mod11a1)
+
+## import as terra::SpatRast
+
+modis_ts <- mf_import_data(file.path(roi_id,"MOD11A1.061"), collection_source = "MODIS")
+
+plot(mod11a1_rast)
+
+}
+}
diff --git a/man/odr_list_collections.Rd b/man/mf_list_collections.Rd
similarity index 78%
rename from man/odr_list_collections.Rd
rename to man/mf_list_collections.Rd
index 154c253..d0e3acd 100644
--- a/man/odr_list_collections.Rd
+++ b/man/mf_list_collections.Rd
@@ -1,10 +1,10 @@
% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/odr_list_collections.R
-\name{odr_list_collections}
-\alias{odr_list_collections}
+% Please edit documentation in R/mf_list_collections.R
+\name{mf_list_collections}
+\alias{mf_list_collections}
\title{Get the collections implemented in the package}
\usage{
-odr_list_collections()
+mf_list_collections()
}
\value{
A data.frame with the available collections, and a set of related information. Main columns are :
@@ -22,7 +22,7 @@ Get the collections implemented in the package and a set of related information
}
\examples{
-(head(odr_list_collections()))
+(head(mf_list_collections()))
}
diff --git a/man/odr_list_variables.Rd b/man/mf_list_variables.Rd
similarity index 66%
rename from man/odr_list_variables.Rd
rename to man/mf_list_variables.Rd
index 8d19c84..17354a9 100644
--- a/man/odr_list_variables.Rd
+++ b/man/mf_list_variables.Rd
@@ -1,19 +1,19 @@
% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/odr_list_variables.R
-\name{odr_list_variables}
-\alias{odr_list_variables}
+% Please edit documentation in R/mf_list_variables.R
+\name{mf_list_variables}
+\alias{mf_list_variables}
\title{Get informations related to the variables available for a given collection}
\usage{
-odr_list_variables(collection, credentials = NULL)
+mf_list_variables(collection, credentials = NULL)
}
\arguments{
-\item{collection}{string. mandatory. Collection of interest (see details of \link{odr_get_url}).}
+\item{collection}{string. mandatory. Collection of interest (see details of \link{mf_get_url}).}
\item{credentials}{vector string of length 2 with username and password. optional.}
}
\value{
A data.frame with the available variables for the collection, and a set of related information for each variable.
-The variables marked as "extractable" in the column "extractable_w_opendapr" can be provided as input parameter \code{variables} of the function \link{odr_get_url}
+The variables marked as "extractable" in the column "extractable_w_opendapr" can be provided as input parameter \code{variables} of the function \link{mf_get_url}
}
\description{
Get the variables available for a given collection
@@ -22,10 +22,10 @@ Get the variables available for a given collection
\donttest{
# login to Earthdata
-log <- odr_login(c(Sys.getenv("earthdata_un"),Sys.getenv("earthdata_pw")),source="earthdata")
+log <- mf_login(c(Sys.getenv("earthdata_un"),Sys.getenv("earthdata_pw")),source="earthdata")
# Get the variables available for the collection MOD11A1.006
-(df_varinfo <- odr_list_variables("MOD11A1.006"))
+(df_varinfo <- mf_list_variables("MOD11A1.006"))
}
}
diff --git a/man/odr_login.Rd b/man/mf_login.Rd
similarity index 75%
rename from man/odr_login.Rd
rename to man/mf_login.Rd
index bc890a3..2165617 100644
--- a/man/odr_login.Rd
+++ b/man/mf_login.Rd
@@ -1,10 +1,10 @@
% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/odr_login.R
-\name{odr_login}
-\alias{odr_login}
+% Please edit documentation in R/mf_login.R
+\name{mf_login}
+\alias{mf_login}
\title{Login to query servers and download data}
\usage{
-odr_login(credentials, source, verbose = TRUE)
+mf_login(credentials, source = "earthdata", verbose = TRUE)
}
\arguments{
\item{credentials}{vector string of length 2 with username and password. optional.}
@@ -27,11 +27,11 @@ Current options for parameter \code{"source"} are :
Create an account to Earthdata here : \url{https://urs.earthdata.nasa.gov/}.
}
\examples{
-# odr_login to Earthdata
+# mf_login to Earthdata
\donttest{
username <- Sys.getenv("earthdata_un")
password <- Sys.getenv("earthdata_pw")
-odr_login(credentials = c(username,password),source = "earthdata")
+mf_login(credentials = c(username,password),source = "earthdata")
}
}
diff --git a/man/modisfast-package.Rd b/man/modisfast-package.Rd
new file mode 100644
index 0000000..1283eb6
--- /dev/null
+++ b/man/modisfast-package.Rd
@@ -0,0 +1,25 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/modisfast-package.R
+\docType{package}
+\name{modisfast-package}
+\alias{modisfast}
+\alias{modisfast-package}
+\title{modisfast: Fast and efficient access to MODIS (and MODIS-like) data in R using the OPeNDAP Capacities}
+\description{
+\if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}}
+
+Provides functions to download MODIS and MODIS-like Earth science datacubes in a time-saving and efficient way : by sampling it at the very downloading phase (spatially, temporally and dimensionally) using the OPeNDAP framework.
+}
+\seealso{
+Useful links:
+\itemize{
+ \item \url{https://github.com/ptaconet/modisfast}
+ \item Report bugs at \url{https://github.com/ptaconet/modisfast/issues}
+}
+
+}
+\author{
+\strong{Maintainer}: Paul Taconet \email{paul.taconet@ird.fr} (\href{https://orcid.org/0000-0001-7429-7204}{ORCID})
+
+}
+\keyword{internal}
diff --git a/man/odr_import_data.Rd b/man/odr_import_data.Rd
deleted file mode 100644
index ac76552..0000000
--- a/man/odr_import_data.Rd
+++ /dev/null
@@ -1,75 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/odr_import_data.R
-\name{odr_import_data}
-\alias{odr_import_data}
-\title{Import the time series in R as a \code{RasterBrick} or a \code{stars} object}
-\usage{
-odr_import_data(paths, collection, variable = NULL, roi = NULL,
- output = "RasterBrick", opt_param = NULL)
-}
-\arguments{
-\item{paths}{string character vector. mandatory.}
-
-\item{collection}{character string. mandatory. The name of a collection}
-
-\item{variable}{character string. The variable to import. If output="stars", all variables will be imported}
-
-\item{roi}{sf the ROI. Mandatory for SMAP collection, else, not necessary}
-
-\item{output}{character string. Output object class. "RasterBrick" or "stars". See Details.}
-
-\item{opt_param}{list of optional arguments. optional. (see details).}
-}
-\description{
-Import a time series as a \code{RasterBrick} or a \code{stars} object
-}
-\details{
-\code{output} : Currently "RasterBrick" implemented for all the collections and "stars" only for MODIS and VIIRS collections
-\code{opt_param} : for SMAP products only. See sections Details of \link{odr_get_url}
-}
-\examples{
-
-\donttest{
-
-require(sf)
-require(magrittr)
-require(raster)
-require(stars)
-
-username <- Sys.getenv("earthdata_un")
-password <- Sys.getenv("earthdata_pw")
-log <- odr_login(credentials = c(username,password), source = "earthdata")
-
-roi = st_as_sf(data.frame(
-geom="POLYGON ((-5.82 9.54, -5.42 9.55, -5.41 8.84, -5.81 8.84, -5.82 9.54))"),
-wkt="geom",crs = 4326)
-
-time_range = as.Date(c("2017-01-01","2017-01-30"))
-
-urls_mod11a1 <- odr_get_url(collection = "MOD11A1.006",
-variables = c("LST_Day_1km","LST_Night_1km"),
-roi = roi,
-time_range = time_range
-)
-
-res_dl <- odr_download_data(urls_mod11a1)
-
-## import as RasterBrick
-# here we import only the band LST_Day_1km
-(mod11a1_rast <- odr_import_data(df_data_to_import = urls_mod11a1,
-collection = "MOD11A1.006",
-variable = "LST_Day_1km",
-output = "RasterBrick"))
-
-## import os stars
-# in a stars object, all the bands are imported, so no need to specify a variable
-(mod11a1_stars <- odr_import_data(df_data_to_import = urls_mod11a1,
-collection = "MOD11A1.006",
-output = "stars"))
-
-plot(mod11a1_rast)
-
-plot(mod11a1_stars)
-
-}
-}
diff --git a/man/opendapr-package.Rd b/man/opendapr-package.Rd
deleted file mode 100644
index d7f7420..0000000
--- a/man/opendapr-package.Rd
+++ /dev/null
@@ -1,25 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/opendapr-package.R
-\docType{package}
-\name{opendapr-package}
-\alias{opendapr}
-\alias{opendapr-package}
-\title{opendapr: Fast Download of many Earth Observation Data in R using the OPeNDAP Capacities}
-\description{
-\if{html}{\figure{logo.png}{options: align='right'}}
-
-Provides functions to download various kinds of spatial-temporal Earth science datacubes in a time-saving and efficient way : by sampling it at the very downloading phase (spatially, temporally and dimensionally) using the OPeNDAP framework.
-}
-\seealso{
-Useful links:
-\itemize{
- \item \url{https://github.com/ptaconet/opendapr}
- \item Report bugs at \url{https://github.com/ptaconet/opendapr/issues}
-}
-
-}
-\author{
-\strong{Maintainer}: Paul Taconet \email{paul.taconet@ird.fr} (0000-0001-7429-7204)
-
-}
-\keyword{internal}