Process MODIS HDF/H5 files into day-specific rasters over a requested date range. This helper preserves daily slices instead of flattening a multi-day range into one merged result.
Arguments
- path
character. Full list of HDF/H5 file paths.
- date
character(1:2). Date or date range in
"YYYY-MM-DD"format.- subdataset
character(1). Subdataset names to extract. Should conform to regular expression. See
base::regexfor details.- fun_agg
Function name or custom function to aggregate overlapping cell values. See
fundescription interra::tappfor details.- path_secondary
character. Optional secondary list of HDF/H5 paths (for example, Aqua files) to fuse with
pathby date.- fusion_method
character(1). Fusion method when
path_secondaryis provided:"mean","primary_first", or"secondary_first".- return_type
character(1). Return
"stack"for a multi-layerSpatRaster(default) or"list"for a named list of dailySpatRasterobjects.- ...
Additional arguments passed to
process_modis_merge.
Value
A day-preserving MODIS result as a SpatRaster
(return_type = "stack") or named list (return_type = "list").
Examples
## NOTE: Example is wrapped in `\dontrun{}` as function requires a large
## amount of data which is not included in the package.
if (FALSE) { # \dontrun{
mod09ga_daily <- process_modis_daily(
path = list.files("./data", pattern = "MOD09GA.", full.names = TRUE),
date = c("2024-01-01", "2024-01-07"),
subdataset = "sur_refl_b01_1",
return_type = "list"
)
} # }