Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update DEAustralia GeoMedian products to version 4 #1193

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/sits_cube.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@
#' # --- Access to Digital Earth Australia
#' cube_deaustralia <- sits_cube(
#' source = "DEAUSTRALIA",
#' collection = "GA_LS8C_NBART_GM_CYEAR_3",
#' bands = c("BLUE", "GREEN", "RED", "NIR", "SWIR1"),
#' collection = "GA_LS8CLS9C_GM_CYEAR_3",
#' bands = c("RED", "GREEN", "BLUE"),
#' roi = c(
#' lon_min = 137.15991,
#' lon_max = 138.18467,
Expand Down
68 changes: 34 additions & 34 deletions inst/extdata/sources/config_source_deaustralia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ sources:
ext_tolerance: 0
grid_system : "MGRS"

GA_LS5T_NBART_GM_CYEAR_3 :
GA_LS5T_GM_CYEAR_3 :
bands :
BLUE : &deaustralia_ls5_geomedian_band_30m
missing_value : -999
Expand All @@ -413,23 +413,23 @@ sources:
offset_value : 0
resampling : "bilinear"
resolution : 30
band_name : "blue"
band_name : "nbart_blue"
data_type : "INT2S"
GREEN :
<<: *deaustralia_ls5_geomedian_band_30m
band_name: "green"
band_name: "nbart_green"
RED :
<<: *deaustralia_ls5_geomedian_band_30m
band_name: "red"
band_name: "nbart_red"
NIR :
<<: *deaustralia_ls5_geomedian_band_30m
band_name: "nir"
band_name: "nbart_nir"
SWIR1 :
<<: *deaustralia_ls5_geomedian_band_30m
band_name: "swir1"
band_name: "nbart_swir_1"
SWIR2 :
<<: *deaustralia_ls5_geomedian_band_30m
band_name: "swir2"
band_name: "nbart_swir_2"
EDEV : &deaustralia_ls5_geomedian_product_30m
missing_value : -3.402823466385288e+37
minimum_value : -3.402823466385288e+37
Expand All @@ -448,7 +448,7 @@ sources:
band_name: "bcdev"
satellite : "LANDSAT-5"
sensor : "TM-GEOMEDIAN"
collection_name : "ga_ls5t_nbart_gm_cyear_3"
collection_name : "ga_ls5t_gm_cyear_3"
access_vars :
AWS_DEFAULT_REGION : "ap-southeast-2"
AWS_S3_ENDPOINT : "s3.ap-southeast-2.amazonaws.com"
Expand All @@ -458,7 +458,7 @@ sources:
metadata_search : "tile"
ext_tolerance : 0
grid_system : "WRS-2"
GA_LS7E_NBART_GM_CYEAR_3 :
GA_LS7E_GM_CYEAR_3 :
bands :
BLUE : &deaustralia_ls7_geomedian_band_30m
missing_value : -999
Expand All @@ -468,23 +468,23 @@ sources:
offset_value : 0
resampling : "bilinear"
resolution : 30
band_name : "blue"
band_name : "nbart_blue"
data_type : "INT2S"
GREEN :
<<: *deaustralia_ls7_geomedian_band_30m
band_name: "green"
band_name: "nbart_green"
RED :
<<: *deaustralia_ls7_geomedian_band_30m
band_name: "red"
band_name: "nbart_red"
NIR :
<<: *deaustralia_ls7_geomedian_band_30m
band_name: "nir"
band_name: "nbart_nir"
SWIR1 :
<<: *deaustralia_ls7_geomedian_band_30m
band_name: "swir1"
band_name: "nbart_swir_1"
SWIR2 :
<<: *deaustralia_ls7_geomedian_band_30m
band_name: "swir2"
band_name: "nbart_swir_2"
EDEV : &deaustralia_ls7_geomedian_product_30m
missing_value : -3.402823466385288e+37
minimum_value : -3.402823466385288e+37
Expand All @@ -503,7 +503,7 @@ sources:
band_name: "bcdev"
satellite : "LANDSAT-7"
sensor : "ETM-GEOMEDIAN"
collection_name : "ga_ls7e_nbart_gm_cyear_3"
collection_name : "ga_ls7e_gm_cyear_3"
access_vars :
AWS_DEFAULT_REGION : "ap-southeast-2"
AWS_S3_ENDPOINT : "s3.ap-southeast-2.amazonaws.com"
Expand All @@ -513,34 +513,34 @@ sources:
metadata_search : "tile"
ext_tolerance : 0
grid_system : "WRS-2"
GA_LS8C_NBART_GM_CYEAR_3 :
GA_LS8CLS9C_GM_CYEAR_3 :
bands :
BLUE : &deaustralia_ls8_geomedian_band_30m
BLUE : &deaustralia_ls89_geomedian_band_30m
missing_value : -999
minimum_value : 0
maximum_value : 65536
scale_factor : 0.0001
offset_value : 0
resampling : "bilinear"
resolution : 30
band_name : "blue"
band_name : "nbart_blue"
data_type : "INT2S"
GREEN :
<<: *deaustralia_ls8_geomedian_band_30m
band_name: "green"
<<: *deaustralia_ls89_geomedian_band_30m
band_name: "nbart_green"
RED :
<<: *deaustralia_ls8_geomedian_band_30m
band_name: "red"
<<: *deaustralia_ls89_geomedian_band_30m
band_name: "nbart_red"
NIR :
<<: *deaustralia_ls8_geomedian_band_30m
band_name: "nir"
<<: *deaustralia_ls89_geomedian_band_30m
band_name: "nbart_nir"
SWIR1 :
<<: *deaustralia_ls8_geomedian_band_30m
band_name: "swir1"
<<: *deaustralia_ls89_geomedian_band_30m
band_name: "nbart_swir_1"
SWIR2 :
<<: *deaustralia_ls8_geomedian_band_30m
band_name: "swir2"
EDEV : &deaustralia_ls8_geomedian_product_30m
<<: *deaustralia_ls89_geomedian_band_30m
band_name: "nbart_swir_2"
EDEV : &deaustralia_ls89_geomedian_product_30m
missing_value : -3.402823466385288e+37
minimum_value : -3.402823466385288e+37
maximum_value : 1.7014118346015974e+37
Expand All @@ -551,14 +551,14 @@ sources:
band_name : "edev"
data_type : "FLT4S"
SDEV :
<<: *deaustralia_ls8_geomedian_product_30m
<<: *deaustralia_ls89_geomedian_product_30m
band_name: "sdev"
BCDEV :
<<: *deaustralia_ls8_geomedian_product_30m
<<: *deaustralia_ls89_geomedian_product_30m
band_name: "bcdev"
satellite : "LANDSAT-8"
satellite : "LANDSAT-8-9"
sensor : "OLI-TIRS-GEOMEDIAN"
collection_name : "ga_ls8c_nbart_gm_cyear_3"
collection_name : "ga_ls8cls9c_gm_cyear_3"
access_vars :
AWS_DEFAULT_REGION : "ap-southeast-2"
AWS_S3_ENDPOINT : "s3.ap-southeast-2.amazonaws.com"
Expand Down
4 changes: 2 additions & 2 deletions man/sits_cube.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 19 additions & 18 deletions tests/testthat/test-cube-deaustralia.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ test_that("Creating GA_LS5T_ARD_3 cubes from DEAustralia", {
cube_nrows <- .tile_nrows(landsat_cube)
expect_true(.raster_nrows(r_obj) == cube_nrows)
})
test_that("Creating GA_LS5T_NBART_GM_CYEAR_3 cubes from DEAustralia", {
test_that("Creating GA_LS5T_GM_CYEAR_3 cubes from DEAustralia", {
landsat_cube <- .try(
{
sits_cube(
source = "DEAUSTRALIA",
collection = "GA_LS5T_NBART_GM_CYEAR_3",
collection = "GA_LS5T_GM_CYEAR_3",
bands = c("SWIR1"),
roi = c(
lon_min = 137.15991,
Expand Down Expand Up @@ -104,12 +104,12 @@ test_that("Creating GA_LS7E_ARD_3 cubes from DEAustralia", {
cube_nrows <- .tile_nrows(landsat_cube)
expect_true(.raster_nrows(r_obj) == cube_nrows)
})
test_that("Creating GA_LS7E_NBART_GM_CYEAR_3 cubes from DEAustralia", {
test_that("Creating GA_LS7E_GM_CYEAR_3 cubes from DEAustralia", {
landsat_cube <- .try(
{
sits_cube(
source = "DEAUSTRALIA",
collection = "GA_LS7E_NBART_GM_CYEAR_3",
collection = "GA_LS7E_GM_CYEAR_3",
bands = c("SWIR1"),
roi = c(
lon_min = 137.15991,
Expand Down Expand Up @@ -175,21 +175,22 @@ test_that("Creating GA_LS8C_ARD_3 cubes from DEAustralia", {
cube_nrows <- .tile_nrows(landsat_cube)
expect_true(.raster_nrows(r_obj) == cube_nrows)
})
test_that("Creating GA_LS8C_NBART_GM_CYEAR_3 cubes from DEAustralia", {

test_that("Creating GA_LS9C_ARD_3 cubes from DEAustralia", {
landsat_cube <- .try(
{
sits_cube(
source = "DEAUSTRALIA",
collection = "GA_LS8C_NBART_GM_CYEAR_3",
bands = c("SWIR1"),
collection = "GA_LS9C_ARD_3",
bands = c("NIR", "CLOUD"),
roi = c(
lon_min = 137.15991,
lon_max = 138.18467,
lat_min = -33.85777,
lat_max = -32.56690
),
start_date = "2016-01-01",
end_date = "2017-01-01",
start_date = "2023-01-01",
end_date = "2024-01-01",
progress = FALSE
)
},
Expand All @@ -200,8 +201,8 @@ test_that("Creating GA_LS8C_NBART_GM_CYEAR_3 cubes from DEAustralia", {
message = "DEAustralia is not accessible"
)

expect_true(all(sits_bands(landsat_cube) %in% c("SWIR1")))
expect_equal(nrow(landsat_cube), 5)
expect_true(all(sits_bands(landsat_cube) %in% c("NIR", "CLOUD")))
expect_equal(nrow(landsat_cube), 8)
bbox_cube <- sits_bbox(landsat_cube, as_crs = "EPSG:4326")
bbox_cube_1 <- sits_bbox(.tile(landsat_cube), as_crs = "EPSG:4326")
expect_true(bbox_cube["xmax"] >= bbox_cube_1["xmax"])
Expand All @@ -211,21 +212,21 @@ test_that("Creating GA_LS8C_NBART_GM_CYEAR_3 cubes from DEAustralia", {
expect_true(.raster_nrows(r_obj) == cube_nrows)
})

test_that("Creating GA_LS9C_ARD_3 cubes from DEAustralia", {
test_that("Creating GA_LS8CLS9C_GM_CYEAR_3 cubes from DEAustralia", {
landsat_cube <- .try(
{
sits_cube(
source = "DEAUSTRALIA",
collection = "GA_LS9C_ARD_3",
bands = c("NIR", "CLOUD"),
collection = "GA_LS8CLS9C_GM_CYEAR_3",
bands = c("SWIR1"),
roi = c(
lon_min = 137.15991,
lon_max = 138.18467,
lat_min = -33.85777,
lat_max = -32.56690
),
start_date = "2023-01-01",
end_date = "2024-01-01",
start_date = "2016-01-01",
end_date = "2017-01-01",
progress = FALSE
)
},
Expand All @@ -236,8 +237,8 @@ test_that("Creating GA_LS9C_ARD_3 cubes from DEAustralia", {
message = "DEAustralia is not accessible"
)

expect_true(all(sits_bands(landsat_cube) %in% c("NIR", "CLOUD")))
expect_equal(nrow(landsat_cube), 8)
expect_true(all(sits_bands(landsat_cube) %in% c("SWIR1")))
expect_equal(nrow(landsat_cube), 5)
bbox_cube <- sits_bbox(landsat_cube, as_crs = "EPSG:4326")
bbox_cube_1 <- sits_bbox(.tile(landsat_cube), as_crs = "EPSG:4326")
expect_true(bbox_cube["xmax"] >= bbox_cube_1["xmax"])
Expand Down
Loading