Skip to content

Commit a4c6584

Browse files
committed
fix deaustralia products bands
1 parent d0d5de0 commit a4c6584

File tree

2 files changed

+37
-39
lines changed

2 files changed

+37
-39
lines changed

inst/extdata/sources/config_source_deaustralia.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ sources:
2929
NIR :
3030
<<: *deaustralia_ls5_tm_30m
3131
band_name: "nbart_nir"
32-
SWIR_1 :
32+
SWIR-1 :
3333
<<: *deaustralia_ls5_tm_30m
3434
band_name: "nbart_swir_1"
35-
SWIR_2 :
35+
SWIR-2 :
3636
<<: *deaustralia_ls5_tm_30m
3737
band_name: "nbart_swir_2"
3838
CLOUD :
@@ -82,10 +82,10 @@ sources:
8282
NIR :
8383
<<: *deaustralia_ls7_etm_30m
8484
band_name: "nbart_nir"
85-
SWIR_1 :
85+
SWIR-1 :
8686
<<: *deaustralia_ls7_etm_30m
8787
band_name: "nbart_swir_1"
88-
SWIR_2 :
88+
SWIR-2 :
8989
<<: *deaustralia_ls7_etm_30m
9090
band_name: "nbart_swir_2"
9191
PANCHROMATIC :
@@ -275,10 +275,10 @@ sources:
275275
resolution : 20
276276
band_name : "nbart_red_edge_1"
277277
data_type : "INT2S"
278-
RED_EDGE_2 :
278+
RED-EDGE-2 :
279279
<<: *deaustralia_s2a_msi_20m
280280
band_name : "nbart_red_edge_2"
281-
RED_EDGE_3 :
281+
RED-EDGE-3 :
282282
<<: *deaustralia_s2a_msi_20m
283283
band_name : "nbart_red_edge_3"
284284
NIR-1 :

tests/testthat/test-cube-deaustralia.R

+31-33
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ test_that("Creating GA_LS5T_ARD_3 cubes from DEAustralia", {
44
sits_cube(
55
source = "DEAUSTRALIA",
66
collection = "GA_LS5T_ARD_3",
7-
bands = c("NBART_SWIR_1", "CLOUD"),
7+
bands = c("SWIR-1", "CLOUD"),
88
roi = c(
99
lon_min = 137.15991,
1010
lon_max = 138.18467,
@@ -23,7 +23,7 @@ test_that("Creating GA_LS5T_ARD_3 cubes from DEAustralia", {
2323
message = "DEAustralia is not accessible"
2424
)
2525

26-
expect_true(all(sits_bands(landsat_cube) %in% c("NBART_SWIR_1", "CLOUD")))
26+
expect_true(all(sits_bands(landsat_cube) %in% c("SWIR-1", "CLOUD")))
2727
expect_equal(nrow(landsat_cube), 8)
2828
bbox_cube <- sits_bbox(landsat_cube, as_crs = "EPSG:4326")
2929
bbox_cube_1 <- sits_bbox(.tile(landsat_cube), as_crs = "EPSG:4326")
@@ -75,7 +75,7 @@ test_that("Creating GA_LS7E_ARD_3 cubes from DEAustralia", {
7575
sits_cube(
7676
source = "DEAUSTRALIA",
7777
collection = "GA_LS7E_ARD_3",
78-
bands = c("NBART_SWIR_1", "CLOUD"),
78+
bands = c("SWIR-1", "CLOUD"),
7979
roi = c(
8080
lon_min = 137.15991,
8181
lon_max = 138.18467,
@@ -94,7 +94,7 @@ test_that("Creating GA_LS7E_ARD_3 cubes from DEAustralia", {
9494
message = "DEAustralia is not accessible"
9595
)
9696

97-
expect_true(all(sits_bands(landsat_cube) %in% c("NBART_SWIR_1", "CLOUD")))
97+
expect_true(all(sits_bands(landsat_cube) %in% c("SWIR-1", "CLOUD")))
9898
expect_equal(nrow(landsat_cube), 8)
9999
bbox_cube <- sits_bbox(landsat_cube, as_crs = "EPSG:4326")
100100
bbox_cube_1 <- sits_bbox(.tile(landsat_cube), as_crs = "EPSG:4326")
@@ -146,7 +146,7 @@ test_that("Creating GA_LS8C_ARD_3 cubes from DEAustralia", {
146146
sits_cube(
147147
source = "DEAUSTRALIA",
148148
collection = "GA_LS8C_ARD_3",
149-
bands = c("nbart_nir", "CLOUD"),
149+
bands = c("NIR", "CLOUD"),
150150
roi = c(
151151
lon_min = 137.15991,
152152
lon_max = 138.18467,
@@ -165,7 +165,7 @@ test_that("Creating GA_LS8C_ARD_3 cubes from DEAustralia", {
165165
message = "DEAustralia is not accessible"
166166
)
167167

168-
expect_true(all(sits_bands(landsat_cube) %in% c("NBART_NIR", "CLOUD")))
168+
expect_true(all(sits_bands(landsat_cube) %in% c("NIR", "CLOUD")))
169169
expect_equal(nrow(landsat_cube), 8)
170170
bbox_cube <- sits_bbox(landsat_cube, as_crs = "EPSG:4326")
171171
bbox_cube_1 <- sits_bbox(.tile(landsat_cube), as_crs = "EPSG:4326")
@@ -217,7 +217,7 @@ test_that("Creating GA_LS9C_ARD_3 cubes from DEAustralia", {
217217
sits_cube(
218218
source = "DEAUSTRALIA",
219219
collection = "GA_LS9C_ARD_3",
220-
bands = c("nbart_nir", "CLOUD"),
220+
bands = c("NIR", "CLOUD"),
221221
roi = c(
222222
lon_min = 137.15991,
223223
lon_max = 138.18467,
@@ -236,7 +236,7 @@ test_that("Creating GA_LS9C_ARD_3 cubes from DEAustralia", {
236236
message = "DEAustralia is not accessible"
237237
)
238238

239-
expect_true(all(sits_bands(landsat_cube) %in% c("NBART_NIR", "CLOUD")))
239+
expect_true(all(sits_bands(landsat_cube) %in% c("NIR", "CLOUD")))
240240
expect_equal(nrow(landsat_cube), 8)
241241
bbox_cube <- sits_bbox(landsat_cube, as_crs = "EPSG:4326")
242242
bbox_cube_1 <- sits_bbox(.tile(landsat_cube), as_crs = "EPSG:4326")
@@ -255,9 +255,9 @@ test_that("Creating GA_S2AM_ARD_3 cubes from DEAustralia using ROI", {
255255
source = "DEAUSTRALIA",
256256
collection = "GA_S2AM_ARD_3",
257257
bands = c(
258-
"nbart_coastal_aerosol",
259-
"NBART_RED",
260-
"nbart_red_edge_1"
258+
"COASTAL-AEROSOL",
259+
"RED",
260+
"RED-EDGE-1"
261261
),
262262
roi = c(
263263
lon_min = 137.15991,
@@ -278,9 +278,9 @@ test_that("Creating GA_S2AM_ARD_3 cubes from DEAustralia using ROI", {
278278
)
279279

280280
expect_true(all(sits_bands(sentinel_cube) %in% c(
281-
"NBART_COASTAL_AEROSOL",
282-
"NBART_RED",
283-
"NBART_RED_EDGE_1"
281+
"COASTAL-AEROSOL",
282+
"RED",
283+
"RED-EDGE-1"
284284
)))
285285
expect_equal(nrow(sentinel_cube), 9)
286286
r <- .raster_open_rast(.tile_path(sentinel_cube))
@@ -293,7 +293,7 @@ test_that("Creating GA_S2AM_ARD_3 cubes from DEAustralia using tiles", {
293293
sits_cube(
294294
source = "DEAUSTRALIA",
295295
collection = "GA_S2AM_ARD_3",
296-
bands = c("nbart_blue", "nbart_nir_2", "nbart_swir_2"),
296+
bands = c("BLUE", "NIR-2", "SWIR-2"),
297297
tiles = c("53HQE", "53HPE"),
298298
start_date = "2019-01-01",
299299
end_date = "2019-08-28",
@@ -308,9 +308,9 @@ test_that("Creating GA_S2AM_ARD_3 cubes from DEAustralia using tiles", {
308308
)
309309

310310
expect_true(all(sits_bands(sentinel_cube) %in% c(
311-
"NBART_BLUE",
312-
"NBART_NIR_2",
313-
"NBART_SWIR_2"
311+
"BLUE",
312+
"NIR-2",
313+
"SWIR-2"
314314
)))
315315
expect_equal(nrow(sentinel_cube), 2)
316316
r <- .raster_open_rast(.tile_path(sentinel_cube))
@@ -327,9 +327,9 @@ test_that("Creating GA_S2BM_ARD_3 cubes from DEAustralia using ROI", {
327327
source = "DEAUSTRALIA",
328328
collection = "GA_S2BM_ARD_3",
329329
bands = c(
330-
"nbart_coastal_aerosol",
331-
"nbart_red",
332-
"nbart_red_edge_1"
330+
"COASTAL-AEROSOL",
331+
"RED",
332+
"RED-EDGE-1"
333333
),
334334
roi = c(
335335
lon_min = 137.15991,
@@ -350,9 +350,9 @@ test_that("Creating GA_S2BM_ARD_3 cubes from DEAustralia using ROI", {
350350
)
351351

352352
expect_true(all(sits_bands(sentinel_cube) %in% c(
353-
"NBART_COASTAL_AEROSOL",
354-
"NBART_RED",
355-
"NBART_RED_EDGE_1"
353+
"COASTAL-AEROSOL",
354+
"RED",
355+
"RED-EDGE-1"
356356
)))
357357
expect_equal(nrow(sentinel_cube), 9)
358358
r <- .raster_open_rast(.tile_path(sentinel_cube))
@@ -366,9 +366,9 @@ test_that("Creating GA_S2BM_ARD_3 cubes from DEAustralia using tiles", {
366366
source = "DEAUSTRALIA",
367367
collection = "GA_S2BM_ARD_3",
368368
bands = c(
369-
"NBART_RED_EDGE_1",
370-
"nbart_nir_2",
371-
"nbart_swir_2"
369+
"RED-EDGE-1",
370+
"NIR-2",
371+
"SWIR-2"
372372
),
373373
tiles = c("53HQE","53HPE"),
374374
start_date = "2019-01-01",
@@ -384,9 +384,7 @@ test_that("Creating GA_S2BM_ARD_3 cubes from DEAustralia using tiles", {
384384
)
385385

386386
expect_true(all(sits_bands(sentinel_cube) %in% c(
387-
"NBART_RED_EDGE_1",
388-
"NBART_NIR_2",
389-
"NBART_SWIR_2"
387+
"RED-EDGE-1", "NIR-2", "SWIR-2"
390388
)))
391389
expect_equal(nrow(sentinel_cube), 2)
392390
r <- .raster_open_rast(.tile_path(sentinel_cube))
@@ -403,7 +401,7 @@ test_that(
403401
sits_cube(
404402
source = "DEAUSTRALIA",
405403
collection = "ga_s2am_ard_3",
406-
bands = c("nbart_blue", "NBART_NIR_2"),
404+
bands = c("BLUE", "NIR-2"),
407405
tiles = c("53HQE","53HPE"),
408406
start_date = "2019-01-01",
409407
end_date = "2019-08-28",
@@ -418,7 +416,7 @@ test_that(
418416
sits_cube(
419417
source = "DEAUSTRALIA",
420418
collection = "GA_S2BM_ARD_3",
421-
bands = c("NBART_SWIR_2"),
419+
bands = c("SWIR-2"),
422420
tiles = c("53HQE","53HPE"),
423421
start_date = "2019-01-01",
424422
end_date = "2019-08-28",
@@ -435,7 +433,7 @@ test_that(
435433
sentinel_cube <- sits_merge(s2a_cube, s2b_cube)
436434

437435
expect_true(all(sits_bands(sentinel_cube) %in% c(
438-
"NBART_BLUE", "NBART_NIR_2", "NBART_SWIR_2"
436+
"BLUE", "NIR-2", "SWIR-2"
439437
)))
440438
expect_equal(nrow(sentinel_cube), 2)
441439
r <- .raster_open_rast(.tile_path(sentinel_cube))

0 commit comments

Comments
 (0)