Skip to content

Commit 1dbf395

Browse files
committed
fixed little errors
1 parent 0b5e00f commit 1dbf395

16 files changed

+54
-36
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rsat
22
Type: Package
33
Title: Dealing with Multiplatform Satellite Images
4-
Version: 0.1.19
4+
Version: 0.1.21
55
Authors@R:
66
c(person(given = "Unai",
77
family = "Pérez - Goya",

NEWS.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
rsat 0.1.20 (2024-01-30)
2+
=========================
3+
### NEW FEATURES
4+
* The package accept parallel downloads from 3 different sources
5+
* API change for Sentinel images from scihub to dataspace
6+
* API change for Modis images from nasa inventory to lpdaac
7+
8+
### IMPROVEMENTS
9+
* Updated API connection code
10+
11+
### MINOR IMPROVEMENTS
12+
* Fixed minor bugs in the code
13+
* Code revision and cleaned
14+
* Fixed subset incompatibility with terra package
15+
116
rsat 0.1.17 (2021-12-13)
217
=========================
318
### NEW FEATURES

R/rsat.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
#' of NASA's earth observation data-sets. More information about
2424
#' EarthData can be found
2525
#' \href{https://www.earthdata.nasa.gov/learn}{here}.
26-
#' \item \href{https://scihub.copernicus.eu/dhus/#/self-registration}{SciHub},
26+
#' \item \href{https://dataspace.copernicus.eu/}{dataspace},
2727
#' a web service giving access to Copernicus' scientific data hub.
28-
#' Please go \href{https://scihub.copernicus.eu}{here} to find more
28+
#' Please go \href{https://dataspace.copernicus.eu/}{here} to find more
2929
#' details about the data hub.
3030
#' }
3131
#' For convenience, try to use the same username and password for all of them.

R/rsat_derive.R

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
#' return a single element. For instance, the Normalized Difference Snow
1212
#' Index would be;
1313
#'
14-
#' NDSI = function(green, swir1){
15-
#' ndsi <- (green - swir1)/(green + swir1)
16-
#' return(ndsi)
17-
#' }
14+
#' NDSI = function(green, swir1)\{
15+
#' ndsi <- (green - swir1)/(green + swir1)
16+
#' return(ndsi)
17+
#' \}
1818
#'
1919
#' @param x an \code{rtoi} as the source of images.
2020
#' @param product the name of the product from which the index is computed.
@@ -54,8 +54,8 @@
5454
#'
5555
#' # ad-hoc variable
5656
#' NDSI = function(green, swir1){
57-
#' ndsi <- (green - swir1)/(green + swir1)
58-
#' return(ndsi)
57+
#' ndsi <- (green - swir1)/(green + swir1)
58+
#' return(ndsi)
5959
#' }
6060
#' rsat_derive(pamplona, "NDSI", product = "mod09ga",fun=NDSI)
6161
#' # now NDVI is processed

R/rsat_download.R

+7-6
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,15 @@ setGeneric("rsat_download", function(x, ...) {
4343
setMethod(
4444
f = "rsat_download",
4545
signature = c("rtoi"),
46-
function(x, db_path, verbose = FALSE, ...) {
46+
function(x, db_path, verbose = FALSE, parallel=FALSE, ...) {
4747
if (missing(db_path)){
4848
db_path <- get_database(x)
4949
}
5050

5151
rsat_download(x = records(x),
5252
db_path = db_path,
5353
verbose = verbose,
54+
parallel = parallel,
5455
...)
5556
}
5657
)
@@ -61,7 +62,7 @@ setMethod(
6162
setMethod(
6263
f = "rsat_download",
6364
signature = c("records"),
64-
function(x, db_path, verbose = FALSE,parallel=FALSE, ...) {
65+
function(x, db_path, verbose = FALSE, parallel=FALSE, ...) {
6566
args <- list(...)
6667

6768
if (missing(db_path)){
@@ -87,21 +88,21 @@ setMethod(
8788
list(func = connection$getApi("usgs")$espa_order_and_download,
8889
args = list(usgs=usgs,db_path=db_path,verbose=verbose,...))
8990
)
90-
mclapply(functions_list, function(entry) {
91+
null.list <-mclapply(functions_list, function(entry) {
9192
do.call(entry$func, entry$args)
9293
}, mc.cores = 3)
9394
}else{
9495
functions_list <- list(
9596
list(func = connection$getApi("usgs")$order_usgs_records,
96-
args = list(lpdaac_records=usgs,db_path=db_path,verbose=verbose,...)),
97+
args = list(espa_orders=usgs,db_path=db_path,verbose=verbose,...)),
9798
list(func = connection$getApi("lpdaac")$download_lpdaac_records,
9899
args = list(lpdaac_records=lpdaac,db_path=db_path,verbose=verbose,...)),
99100
list(func = connection$getApi("dataspace")$dataspace_download_records,
100101
args = list(records=dataspace,db_path=db_path,verbose=verbose,...)),
101102
list(func = connection$getApi("usgs")$download_espa_orders,
102-
args = list(usgs=usgs,db_path=db_path,verbose=verbose,...))
103+
args = list(espa.orders=usgs,db_path=db_path,verbose=verbose,...))
103104
)
104-
lapply(functions_list, function(entry) {
105+
null.list <- lapply(functions_list, function(entry) {
105106
do.call(entry$func, entry$args)
106107
})
107108
# if(length(usgs)>0){

R/rsat_search.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#' function returns nothing and the records are added to the \code{rtoi}.
77
#'
88
#' MODIS images are found through the
9-
#' \href{https://lpdaacsvc.cr.usgs.gov/services/inventory}{NASA Common
9+
#' \href{https://lpdaac.usgs.gov/}{NASA Common
1010
#' Metadata Repository}
1111
#' (CMR). The inventory of MODIS products can be found
1212
#' \href{https://modis.gsfc.nasa.gov/data/dataprod/}{here}.

README.Rmd

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ In Linux, you need to install additional libraries before starting with `rsat`.
7272
The registration in the following online portals is required to get a full access to satellite images with `rsat`;
7373
- [USGS](https://ers.cr.usgs.gov/register/) USGS is the sole science agency for the Department of the Interior of United States. Provide access to Modis Images. More information about USGS can be found [Here](https://www.usgs.gov/).
7474
- [EarthData](https://urs.earthdata.nasa.gov): A repository of NASA's earth observation data-sets. More information about EarthData can be found [here](https://www.earthdata.nasa.gov/learn).
75-
- [SciHub](https://scihub.copernicus.eu/dhus/#/self-registration), a web service giving access to Copernicus' scientific data hub. Please go [here](https://scihub.copernicus.eu/) to find more details about the data hub.
75+
- [Dataspace](https://dataspace.copernicus.eu/), a web service giving access to Copernicus' scientific data hub. Please go [here](https://dataspace.copernicus.eu/) to find more details about the data hub.
7676

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

@@ -162,7 +162,7 @@ help you in organizing the image products.
162162

163163
- [rLandsat](https://github.com/atlanhq/rLandsat)
164164

165-
- [getLandsat](https://github.com/ropensci/getlandsat)
165+
- [getLandsat](https://github.com/ropensci-archive/getlandsat)
166166

167167
- [sen2r](https://github.com/ranghetti/sen2r)
168168

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ In Linux, you need to install additional libraries before starting with `rsat`.
6262
The registration in the following online portals is required to get a full access to satellite images with `rsat`;
6363
- [USGS](https://ers.cr.usgs.gov/register/) USGS is the sole science agency for the Department of the Interior of United States. Provide access to Modis Images. More information about USGS can be found [Here](https://www.usgs.gov/).
6464
- [EarthData](https://urs.earthdata.nasa.gov): A repository of NASA's earth observation data-sets. More information about EarthData can be found [here](https://www.earthdata.nasa.gov/learn).
65-
- [DataSpace](https://identity.dataspace.copernicus.eu/), a web service giving access to Copernicus' scientific data hub. Please go [here](https://identity.dataspace.copernicus.eu/) to find more details about the data hub.
65+
- [DataSpace](https://dataspace.copernicus.eu/), a web service giving access to Copernicus' scientific data hub. Please go [here](https://dataspace.copernicus.eu/) to find more details about the data hub.
6666

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

@@ -131,7 +131,7 @@ The last package dedicated to image downloading is `luna`.Searching and download
131131

132132
- [rLandsat](https://github.com/atlanhq/rLandsat)
133133

134-
- [getLandsat](https://github.com/ropensci/getlandsat)
134+
- [getLandsat](https://github.com/ropensci-archive/getlandsat)
135135

136136
- [sen2r](https://github.com/ranghetti/sen2r)
137137

inst/CITATION

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ bibentry(bibtype = "Manual",
44
person("M Montesino-SanMartin"),
55
person("A F Militino"),
66
person("M D Ugarte")),
7-
year = "2022",
8-
note = "R package version 0.1.19",
7+
year = "2024",
8+
note = "R package version 0.1.21",
99
url = "https://CRAN.R-project.org/package=rsat",
1010
textVersion =
11-
paste("U Pérez-Goya, M Montesino-SanMartin, A F Militino, M D Ugarte (2022).",
12-
"rsat: Dealing with Multiplatform Satellite Images from Landsat, MODIS, and Sentinel. R package version 0.1.18.",
11+
paste("U Pérez-Goya, M Montesino-SanMartin, A F Militino, M D Ugarte (2024).",
12+
"rsat: Dealing with Multiplatform Satellite Images from Landsat, MODIS, and Sentinel. R package version 0.1.21.",
1313
"https://CRAN.R-project.org/package=rsat."),
1414
header = "To cite the package:"
1515
)

man/rsat.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/rsat_derive.Rd

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/rsat_download.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/rsat_search.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/Rplots.pdf

19.8 KB
Binary file not shown.

tests/testthat/test-rtoi.R

+2
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ test_that("records test", {
9898
# rsat_preview(navarre,dates(navarre)[2])
9999
# }, error = function(e) {
100100
# print(e)
101+
},error = function(e) {
102+
print("Offline services...")
101103
})
102104
#unlink(file.path(rtoi.path,"Navarre_rtoi"),recursive = T)
103105
})

vignettes/rsat1_search.Rmd

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ In `rsat`, **searching** means locating the satellite images of a desired data p
3030

3131
- [USGS](https://ers.cr.usgs.gov/register/) USGS is the sole science agency for the Department of the Interior of United States. Provide access to Modis Images. More information about USGS can be found [Here](https://www.usgs.gov/).
3232
- [EarthData](https://urs.earthdata.nasa.gov): A repository of NASA's earth observation data-sets. More information about EarthData can be found [here](https://www.earthdata.nasa.gov/learn).
33-
- [SciHub](https://scihub.copernicus.eu/dhus/#/self-registration), a web service giving access to Copernicus' scientific data hub. Please go [here](https://scihub.copernicus.eu/) to find more details about the data hub.
33+
- [Dataspace](https://dataspace.copernicus.eu/), a web service giving access to Copernicus' scientific data hub. Please go [here](https://dataspace.copernicus.eu/) to find more details about the data hub.
3434

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

@@ -198,7 +198,7 @@ Sometimes, regions are located at the intersection of images or they are too lar
198198
4. `rtoi_path`: the path to a dataset, i.e. a folder for customized/processed.
199199
5. `records`: a vector of satellite records relevant for the study.
200200

201-
As a showcase, we'll assess the effects of the [Storm Filomena](https://en.wikipedia.org/wiki/2020%E2%80%9321_European_windstorm_season#Storm_Filomena) over the Iberian peninsula in terms of snow coverage. The storm was an extreme meteorological event (largest since 1971, according to [*AEMET*](http://www.aemet.es/en/portada)). The storm swept the peninsula from January $6^{th}$ and $11^{th}$, $2021$. The code below generates a bounding box around the peninsula (`ip`) and limits the study period (`toi`) to the immediate dates after the storm:
201+
As a showcase, we'll assess the effects of the [Storm Filomena](https://en.wikipedia.org/wiki/2020%E2%80%9321_European_windstorm_season#Storm_Filomena) over the Iberian peninsula in terms of snow coverage. The storm was an extreme meteorological event (largest since 1971, according to [*AEMET*](https://www.aemet.es/en/portada)). The storm swept the peninsula from January $6^{th}$ and $11^{th}$, $2021$. The code below generates a bounding box around the peninsula (`ip`) and limits the study period (`toi`) to the immediate dates after the storm:
202202

203203
```{r roi_toi}
204204
ip <- st_sf(st_as_sfc(st_bbox(c(

0 commit comments

Comments
 (0)