Get mosaic or merged raster from multiple MODIS hdf files.
Usage
process_modis_merge(
path = NULL,
date = NULL,
subdataset = NULL,
fun_agg = "mean",
path_secondary = NULL,
fusion_method = c("mean", "primary_first", "secondary_first"),
...
)Arguments
- path
character. Full list of hdf file paths. preferably a recursive search result from
base::list.files.- date
character(1). date to query. Should be in
"YYYY-MM-DD"format.- subdataset
character(1). subdataset names to extract. Should conform to regular expression. See
base::regexfor details. Default isNULL, which will result in errors. Users should specify which subdatasets will be imported.- 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 (e.g., Aqua files) to fuse with
pathfor improved temporal coverage.- fusion_method
character(1). Fusion method when
path_secondaryis provided:"mean","primary_first","secondary_first".- ...
For internal use.
Note
Curvilinear products (i.e., swaths) will not be accepted.
MODIS products downloaded by functions in amadeus,
MODISTools,
and luna are accepted.
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_merge <- process_modis_merge(
path =
list.files("./data", pattern = "MOD09GA.", full.names = TRUE),
date = "2024-01-01",
subdataset = "sur_refl_b01_1",
fun_agg = "mean"
)
} # }