Skip to content

Commit 1a4802c

Browse files
authored
Merge pull request #1175 from M3nin0/fix/base-cube-missingvalues
handle empty samples values from base_cube
2 parents b405b55 + bc5415c commit 1a4802c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

R/api_data.R

+7-1
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,18 @@
101101
base_tbl <- base_tbl |>
102102
dplyr::select("longitude", "latitude", "time_series") |>
103103
dplyr::rename("base_data" = "time_series")
104+
# Assuming `ts_tbl` as the source of truth, the size of the following
105+
# `join` must be the same as the current `ts_tbl`.
106+
ts_tbl_size <- nrow(ts_tbl)
104107
# joining samples data from cube and base_cube by longitude / latitude
105108
ts_tbl <- dplyr::left_join(
106109
x = ts_tbl,
107110
y = base_tbl,
108111
by = c("longitude", "latitude")
109-
)
112+
) |>
113+
tidyr::drop_na()
114+
# checking samples consistency
115+
.data_check(ts_tbl_size, nrow(ts_tbl))
110116
# add base class
111117
class(ts_tbl) <- c("sits_base", class(ts_tbl))
112118
}

inst/extdata/sources/config_source_mpc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ sources:
128128
resolution : 30
129129
data_type : "FLT4S"
130130
missing_value : -32768
131-
minimum_value : 0
131+
minimum_value : -32767
132132
maximum_value : 65534
133133
scale_factor : 1
134134
offset_value : 0

0 commit comments

Comments
 (0)