-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* tests and examples for geomarker functions * implemented conditional patterns for MERRA URLs during certain months in certain years * everything is download.file now (except basic auth for merra)
- Loading branch information
1 parent
731fca6
commit 514667a
Showing
14 changed files
with
110 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
if (file.exists(".env")) dotenv::load_dot_env() | ||
earthdata_secrets <- Sys.getenv(c("EARTHDATA_USERNAME", "EARTHDATA_PASSWORD"), unset = NA) | ||
skip_if(any(is.na(earthdata_secrets)), message = "no earthdata credentials found") | ||
|
||
test_that("getting daily merra from GES DISC works", { | ||
# "normal" pattern | ||
# merra site uses 401 instead of 400 for september 2020 dates | ||
# merra site uses 401 instead of 400 for jun, jul, aug, sep 2021 dates | ||
out <- | ||
list( | ||
create_daily_merra_data("2023-05-23"), | ||
create_daily_merra_data(merra_date = "2020-09-02"), | ||
create_daily_merra_data(merra_date = "2021-06-16") | ||
) | ||
expect_equal(sapply(out, nrow), c(4800, 4800, 4800)) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
test_that("get_merra_data works", { | ||
d <- list( | ||
"8841b39a7c46e25f" = as.Date(c("2023-05-18", "2023-11-06")), | ||
"8841a45555555555" = as.Date(c("2023-06-22", "2023-08-15")) | ||
) | ||
out <- get_merra_data(x = s2::as_s2_cell(names(d)), dates = d) | ||
expect_equal(length(out), 2) | ||
expect_equal(lapply(out, nrow), list("8841b39a7c46e25f" = 2, "8841a45555555555" = 2)) | ||
expect_equal(out$`8841b39a7c46e25f`$merra_dust, c(1.77165780194481, 0.841950516250467)) | ||
}) |