This is a wrapper for generatePixelGroups, initiateNewCohort and updates to
pixelGroupMap via assignment to new pixelIndex values in newPixelCohortData.
By running these all together, there is less chance that they will diverge.
There are some checks internally for consistency.
updateCohortDataPostHarvest(
newPixelCohortData,
cohortData,
pixelGroupMap,
currentTime,
speciesEcoregion,
treedHarvestPixelTable = NULL,
successionTimestep,
provenanceTable,
trackPlanting = FALSE,
initialB = 10,
cohortDefinitionCols = c("pixelGroup", "age", "speciesCode"),
verbose = getOption("LandR.verbose", TRUE),
doAssertion = getOption("LandR.assertions", TRUE)
)must be a complete cohortData object with newly created
cohorts. They do not have to have pixelGroup values yet;
they can be overlapping with cohortData, (i.e., they can be regenerated on empty
pixels or on already occupied pixels).
Must contain the columns: pixelIndex, speciesCode, ecoregionGroup.
The remaining 4 (see cohortData) will be created with 0s.
A data.table with columns: pixelGroup, ecoregionGroup,
speciesCode, and optionally age, B, mortality, aNPPAct, and sumB.
A RasterLayer with pixel values equal to a pixel group
number that corresponds exactly to pixelGroup column in cohortData.
The current simulation time e.g., time(sim).
A data.table with species-ecoregion-specific species trait values.
Ecoregion refers to "ecolocation", a categorical variable grouping sites with similar biophysical
characteristics. The table should have at least the following columns: speciesCode and
ecoregionGroup, character representation of species and ecoregion groups respectively,
maxB the maximum biomass for the species in a given 'ecoregion', maxANPP the maximum
aboveground net primary productivity and SEP the species establishment probability.
May contain columns inflationFactor (used to adjust maxB) and mANPPproportion
(used to calculate maxANPP).
A data.table with at least 2 columns, pixelIndex and pixelGroup.
This will be used in conjunction with cohortData and pixelGroupMap
to ensure that everything matches correctly.
The time between successive seed dispersal events. In LANDIS-II, this is called "Succession Timestep".
A data.table with three columns:
New cohorts are initiated at the ecoregionGroup speciesEcoregion from the
corresponding speciesEcoregion listed in the Provenance column
if true, planted cohorts in cohortData are tracked with TRUE
in column 'planted'
the initial biomass of new cohorts. Defaults to ten, even if NA/NULL is passed.
the columns in cohortData that define unique cohorts
Controls message output. Defaults to getOption("LandR.verbose")
A logical indicating whether some internal tests should be run to
ensure the function is running correctly.
Default: getOption("LandR.assertions", TRUE).
A list of length 2, cohortData and pixelGroupMap, with
newPixelCohortData inserted.
Does the following:
add new cohort data into cohortData;
assign initial B and age for new cohort;
assign the new pixelGroup to the pixels that have new cohort;
update the pixelGroup map.