Standalone function that performs the seasonal analysis workflow.
Usage
wapor_run_seasonal_analysis(
config,
crop_params,
rasters,
aoi_region = NULL,
progress_callback = NULL
)Arguments
- config
List of configuration parameters. Besides the variable codes,
period,data_source,folderandindicators, it accepts:processing:"auto"(default),"memory","stream"or"tiled". Seewapor_plan_processing().min_coverage: share of season days a pixel must have data for (default1, every dekad). Pixels below it areNArather than having missing dekads counted as zero.keep_intermediates: keepdekadal_stacksandseason_weightsin the result. DefaultFALSE(they are large; indicator steps that need them still get them). The run logs an estimate of the disk space it writes and warns when the output or temporary folder has less free space (options(Rwapor.disk_check = FALSE)turns the check off).output_dir: folder for stream and tiled outputs (default: a folder undertempdir()).cache_dir: withdata_source = "api", a folder in which the source rasters this run needs are saved first withwapor_download()(only the missing ones) and then read locally. Later runs for the same area read the saved files and work without internet. One folder per area; not available withl3_mode = "mosaic_all".reference_layer,resampling_method: target grid and per-layer resampling (see Details).
- crop_params
data.frame of crop class parameters (Kc, HI, etc.).
- rasters
List of terra::SpatRaster objects (mask, start, end).
- aoi_region
Optional region (bbox, vector path or sf). When
NULL, the extent ofrasters$crop_mask(or the season rasters) is used.- progress_callback
Optional function(value, detail) for updates.
Value
List of results (SpatRaster objects and summary tables), including
coverage (per-variable share of season days with data) and processing
(the wapor_plan_processing() plan that ran).
Details
Alignment uses config$reference_layer ("aeti" default, also
"crop_mask", "ret", "pcp", "npp", "template").
Seasonal and monthly totals are summed at each source's native resolution
and then resampled once onto the analysis grid. With the default
nearest-neighbour resampling every output value is a raw server value or a
sum of raw values. Set config$resampling_method (for example
c(ret = "bilinear")) to interpolate instead. Crop mask and season rasters
always use nearest neighbour.