Skip to content

Commit

Permalink
Merge pull request #971 from OldLipe/dev2
Browse files Browse the repository at this point in the history
Fix bug in selecting derived cubes
  • Loading branch information
gilbertocamara committed May 16, 2023
2 parents c59b5f5 + d670f7c commit c73a552
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/api_file_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,12 @@ NULL
}

.fi_during <- function(fi, start_date, end_date) {
.between(.fi_timeline(fi), start_date[[1]], end_date[[1]])
fi_tl <- .fi_timeline(fi)
.fi_switch(
fi = fi,
eo_cube = .between(fi_tl, start_date[[1]], end_date[[1]]),
derived_cube = all(.between(fi_tl, start_date[[1]], end_date[[1]]))
)
}

.fi_filter_interval <- function(fi, start_date, end_date) {
Expand Down
3 changes: 3 additions & 0 deletions R/sits_select.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ sits_select.raster_cube <- function(data,
# Filter dates
if (!is.null(start_date) || !is.null(end_date)) {
.check_dates_parameter(c(start_date, end_date))
start_date <- .default(start_date, .cube_start_date(data))
end_date <- .default(end_date, .cube_end_date(data))

data <- .cube_filter_interval(
cube = data, start_date = start_date, end_date = end_date
)
Expand Down

0 comments on commit c73a552

Please sign in to comment.