
Save observed fire-regime targets (NFDB-derived) for calibration loss
save_observed_fire_targets.RdPre-computes per-ecoregion observed summaries that downstream calibration
loss components (loss_from_stats()) compare simulated fires against.
Saves a single small .rds payload of base R types – so DEoptim workers
can read it from disk without terra/sf in their environments.
Usage
save_observed_fire_targets(
primary_points,
primary_polys,
fire_years,
fuel_types_rast,
path,
secondary_points = NULL,
secondary_polys = NULL,
primary_label = "primary",
secondary_label = "secondary",
fuel_code_to_base = bc_fuel_code_to_base(),
severity_dist = NULL
)Arguments
- primary_points, primary_polys
SpatVector. NFDB ignition points and fire polygons for the primary ecoregion (the LANDIS simulation extent).
- fire_years
Integer vector. Years over which counts are normalised (denominator for
lambda_obs).- fuel_types_rast
SpatRaster. Integer-coded fuel-type raster covering the LANDIS simulation extent.
- path
Character. Output
.rdspath. Parent dir created if missing.- secondary_points, secondary_polys
SpatVector or NULL. Same, for an optional regional-context ecoregion.
area_by_fuel_hais NOT computed for the secondary (see Details).- primary_label, secondary_label
Character. Labels for the two ecoregions (e.g.,
"FRU59"/"FRT12"). Stored in the payload for reproducibility.- fuel_code_to_base
Named character vector. Mapping from
fuel_types_rastinteger codes (as character names) to the five base fuel types fromdefaultFuelTypeTable(). NA values mark non-fuel codes to be excluded. Default:bc_fuel_code_to_base().- severity_dist
Named numeric vector or NULL. Expected proportions across the 5 Dynamic Fire severity classes (names
"1".."5"). Stored on the primary-ecoregion summary; consumed byloss_from_stats()'sL_severitycomponent. NULL = skip severity calibration (the loss contributes 0). For a literature-prior default, seedefault_severity_prior_sturtevant2009().
Details
Loss-component consumers:
L_countusesn_fires_by_year(mean + sd for normalisation).L_sizeusesfire_sizes_ha(sorted vector; KS test against sim).L_area_fueluses primary-ecoregionarea_by_fuel_ha(Tier 2; weight 0 in Tier 1).L_severitystays NULL; populate from literature priors when Tier 2 severity matching is implemented.
Per ecoregion (primary_ecoregion, secondary_ecoregion):
Fire counts come from NFDB IGNITION POINTS (one row = one ignition). NFDB polygons are sparser (only mapped for larger fires).
Fire sizes come from NFDB points'
SIZE_HAcolumn (zeros dropped to keep the lognormal-flavoured size distribution positive).area_by_fuel_hais computed for the PRIMARY ecoregion only via polygon overlay onfuel_types_rast.fuel_types_rastcovers the LANDIS simulation domain; secondary-ecoregion polygons typically extend well beyond that extent, making a secondary computation misleading (it would just be the primary value over again).
See also
Other Dynamic Fire calibration helpers:
apply_calibrated_hi_prop(),
apply_calibrated_ignprob(),
bc_fuel_code_to_base(),
build_calibration_scenario_template(),
build_calibration_spinup_scenario(),
calibrate_dynamic_fire(),
calibration_par_names(),
default_severity_prior_sturtevant2009(),
loss_from_stats(),
parse_dynamic_fire_logs(),
patch_fire_config(),
run_calibration_spinup(),
sim_landis(),
sim_mock(),
sim_r_reimpl()