Skip to content

Commit

Permalink
Merge pull request #1175 from M3nin0/fix/base-cube-missingvalues
Browse files Browse the repository at this point in the history
handle empty samples values from base_cube
  • Loading branch information
M3nin0 authored Jul 19, 2024
2 parents b405b55 + bc5415c commit 1a4802c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion R/api_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,18 @@
base_tbl <- base_tbl |>
dplyr::select("longitude", "latitude", "time_series") |>
dplyr::rename("base_data" = "time_series")
# Assuming `ts_tbl` as the source of truth, the size of the following
# `join` must be the same as the current `ts_tbl`.
ts_tbl_size <- nrow(ts_tbl)
# joining samples data from cube and base_cube by longitude / latitude
ts_tbl <- dplyr::left_join(
x = ts_tbl,
y = base_tbl,
by = c("longitude", "latitude")
)
) |>
tidyr::drop_na()
# checking samples consistency
.data_check(ts_tbl_size, nrow(ts_tbl))
# add base class
class(ts_tbl) <- c("sits_base", class(ts_tbl))
}
Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/sources/config_source_mpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ sources:
resolution : 30
data_type : "FLT4S"
missing_value : -32768
minimum_value : 0
minimum_value : -32767
maximum_value : 65534
scale_factor : 1
offset_value : 0
Expand Down

0 comments on commit 1a4802c

Please sign in to comment.