-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deal with species attribution #17
Comments
Would we want As you mentioned, EDIT: trying to remove hardcoded 1 and 62 species IDs Of note: With these tables I did this:
With this anything in Hopefully this all makes sense! |
Incorporated a version of this to spadesCBMpython.
Then link it to
This runs on my machine but slightly changes results. For example, landscape average NPP was calculated at 7.38 MgC/ha/yr in previous runs, but is 6.933 MgC/ha/yr with this change. |
The spinup function (
libcbmr::cbm_exn_spinup()
) requires species passed via thespinup_parameters
object. In our current small raster example, these are hard coded (line 333 inCBM_core
). We, on the spadesCBM side, attach species to growth curves inCBM_dataPrep_SK
. It is my current assumption (Celine) that the species we give in the spinup viaspinup_parameters
would be used on the Python side to either figure out the Boudewyn parameters, or track species, or sw_hw. But since we give the$growth_increments
out ofCBM_vol2biomass
and that the match to specific species is in$gcMetaAllCols
(created inCBM_vol2biomass
), and that we define the sw_hw flag also as part of thespinup_parameters
, we don't use thespecies
specified inspinup_parameters
.Regardless, the
species
inspinup_parameters
needs to match thespecies
in we associate with each growth curves. Currently, on line 333 ofCBM_core
, species are assigned "1" if sw and "62" if hw. Those refer to the two species table in the SQLight database that we read inCBM_defaults
, we don't currently read in thespecies
andspecies_tr
tables but they match to 1 == Spruce and 62 == Poplar. Thespecies
table from the SQLight has a columngenus
which matches back to another pair of tables in the SQLight (genus
just has an id andgenus_tr
which links it to poplar). Note that these (genus
andgenus_tr
tables) do not seem to be linked to the$canfi_species
object that is necessary to get the parameters for the Boudewyn equations inCBM_vol2biomass
. My guess (Celine) is that this link (from genus to canfi_species) is internally done when people use libcbm with higher level functions than the ones we call from spadesCBM. For us,species
inspinup_parameters
have to have the rightspecies_tr$species_id
, and that has to match the species we attach to each growth curve. For spadesCBM, it will have to be something like a messy match between the species names inspecies_tr$name
from the SQLight, and$gcMetaAllCols
created inCBM_vol2biomass
. When we get toLandRCBM
(spadesCBM
that gets its growth and cohort information fromLandR
), we will have to match it to cohort-species.The text was updated successfully, but these errors were encountered: