| 
235 | 235 | .detect_change_tile_prep <- function(dc_method, tile, ...) {  | 
236 | 236 |     UseMethod(".detect_change_tile_prep", dc_method)  | 
237 | 237 | }  | 
238 |  | -#' @rdname .detect_change_tile_prep  | 
 | 238 | +#' @noRd  | 
239 | 239 | #' @export  | 
240 | 240 | .detect_change_tile_prep.default <- function(dc_method, tile, ...) {  | 
241 | 241 |     return(NULL)  | 
242 | 242 | }  | 
243 |  | -#' @rdname .detect_change_tile_prep  | 
 | 243 | +#' @noRd  | 
244 | 244 | #' @export  | 
245 |  | -.detect_change_tile_prep.bayts_model <- function(dc_method, tile, ..., impute_fn) {  | 
 | 245 | +.detect_change_tile_prep.bayts_model <-  | 
 | 246 | +    function(dc_method, tile, ..., impute_fn) {  | 
246 | 247 |     deseasonlize <- environment(dc_method)[["deseasonlize"]]  | 
247 | 248 | 
 
  | 
248 | 249 |     if (!.has(deseasonlize)) {  | 
 | 
273 | 274 |     })  | 
274 | 275 |     do.call(cbind, quantile_values)  | 
275 | 276 | }  | 
 | 277 | +#' @title Pre-process tile to run detect_change method (bayts)  | 
 | 278 | +#' @name .detect_change_create_timeline  | 
 | 279 | +#' @keywords internal  | 
 | 280 | +#' @noRd  | 
 | 281 | +#' @param  dc_method       Detect change method  | 
 | 282 | +#' @param  tile            Single tile of a data cube.  | 
 | 283 | +#' @param  ...             Additional parameters  | 
 | 284 | +#' @param  impute_fn       Imputation function  | 
276 | 285 | .detect_change_create_timeline <- function(tile) {  | 
277 | 286 |     # Get the number of dates in the timeline  | 
278 | 287 |     tile_tl <- .as_chr(.tile_timeline(tile))  | 
 | 
282 | 291 |     )  | 
283 | 292 |     tile_tl  | 
284 | 293 | }  | 
285 |  | - | 
 | 294 | +#' @name .detect_change_as_polygon  | 
 | 295 | +#' @noRd  | 
286 | 296 | .detect_change_as_polygon <- function(values, block, bbox) {  | 
287 | 297 |     # Create a template raster  | 
288 | 298 |     template_raster <- .raster_new_rast(  | 
 | 
306 | 316 |     # Return the segment object  | 
307 | 317 |     return(values)  | 
308 | 318 | }  | 
309 |  | - | 
 | 319 | +#' @rdname .dc_samples  | 
 | 320 | +#' @title Retrieve samples available in a given detect change method.  | 
 | 321 | +#' @name .dc_samples  | 
 | 322 | +#' @keywords internal  | 
 | 323 | +#' @noRd  | 
 | 324 | +#' @param  dc_method       Detect change method  | 
 | 325 | +#' @return Samples available in the dc method.  | 
310 | 326 | .dc_samples <- function(dc_method) {  | 
311 | 327 |     environment(dc_method)[["samples"]]  | 
312 | 328 | }  | 
 | 
319 | 335 | .dc_bands <- function(dc_method) {  | 
320 | 336 |     UseMethod(".dc_bands", dc_method)  | 
321 | 337 | }  | 
322 |  | -#' @rdname .dc_bands  | 
 | 338 | +#' @noRd  | 
323 | 339 | #' @export  | 
324 | 340 | .dc_bands.sits_model <- function(dc_method) {  | 
325 | 341 |     .samples_bands(.dc_samples(dc_method))  | 
326 | 342 | }  | 
327 |  | -#' @rdname .dc_bands  | 
 | 343 | +#' @noRd  | 
328 | 344 | #' @export  | 
329 | 345 | .dc_bands.bayts_model <- function(dc_method) {  | 
330 | 346 |     if (.has(.dc_samples(dc_method))) {  | 
 | 
334 | 350 |     stats <- unlist(lapply(stats, colnames))  | 
335 | 351 |     return(unique(stats))  | 
336 | 352 | }  | 
337 |  | - | 
 | 353 | +#' @title Retrieve bands associated to detect_change method  | 
 | 354 | +#' @name .dc_class  | 
 | 355 | +#' @keywords internal  | 
 | 356 | +#' @noRd  | 
 | 357 | +#' @param  dc_method       Detect change method  | 
 | 358 | +#' @return Class of the model.  | 
338 | 359 | .dc_class <- function(dc_method) {  | 
339 | 360 |     class(dc_method)[[1]]  | 
340 | 361 | }  | 
0 commit comments