USFS-PNW / Fia-Biosum-Manager

User interface and main code repository for Biosum
http://biosum.info/
Other
3 stars 3 forks source link

DATABASE: Interface with new FCS .jar #262

Closed lbross closed 2 years ago

lbross commented 2 years ago

This issue tracks changes that need to be made to BioSum to properly interface with the new FCS .jar for calculating biomasses and volumes.

  1. Replace centroid_dia_ht_actual with centroid_dia_ht. We can send nulls as this is currently required only for PACI plots
sorgtyler commented 2 years ago

@lbross Initial questions: Does this need to be done on top of the issue #223 code? Is it a global string replace? Would version control need to update these columns in existing databases? Would fcs_tree.db BIOSUM_CALC need a different column name?

lbross commented 2 years ago

Per Jason Brown, this is a non-issue. The calculations are sending in centroid_dia_ht_actual instead of centroid_dia_ht anyway so what we are doing is just fine. No changes needed. Leaving this issue open in case Jason runs into anything else while working on the new FCS .jar.

lbross commented 2 years ago

From Jason: We will need to add ecodiv to the biosum calc process. This is for CRM2. For now, we can use plot.ecosubcd in its place.

And cond.stdorgcd

lbross commented 2 years ago

Implement an error handling system. Jason suggests two tiers of errors:

  1. System-level error codes; One per run. Examples: 0: No errors 1: Sqlite tree database not found 2: Sqlite tree config database not found 3: Successful run with some tree errors etc.
  2. Per tree errors could include: --No dia --No ht --Species config data not found for this tree --etc. These errors would be written back to the SQLite database. BioSum could read them from the database and write to the master.tree table or an error table that could be audited or queried.

Edit: May want 2 additional columns for the tree errors; An integer status code and a text description.

lbross commented 2 years ago

Change references from biosum_volume to biosum_calc. The output table in the SQLite database will have a new name.

lbross commented 2 years ago

Need to add ecodiv to master.plot. Source is FIA plot.ecosubcd. Need to add stdorgcd to master.cond. This includes updating the scripts that create the tables for new projects and version_control for existing projects. Also need to update the plot load process to start loading these fields from FIA.

version_control needs to delete audit_Post_NOVALUE_ERROR and audit_Post_VALUE_ERROR tables from all \fvs\data\BM\BiosumCalc\PostAudit.accdb. These are tables to support the post-processor audit. On legacy projects they are missing the new tree table columns that were added for FCS. BioSum will recreate the tables with the new columns if the tables don't exist.

lbross commented 2 years ago

Record of switches that are available with v0.3.02 image001

lbross commented 2 years ago

Got an error in fcs_tree.db when using Tree Troubleshooter on master.tree table: No configuration found for the config/spcd combination. This was due to the trees having a null dia (bad input data). Jason says he will try to remember to separate those errors out when we need a new version. When we fully implement the new equations at the latest.

jsfried commented 2 years ago

Was this a manually input tree or one that came from FIADB? Strange that any tree that BioSum would try to process (live only, right?) would have a null dia.

lbross commented 2 years ago

This was in the master.tree table of Sebastian's FTCE_JaJoSi project. He loaded it using the old .jar so he probably wouldn't have seen the error. Looks like it came from FIADB because the fvs_tree_id didn't have the "S". I was using the Tree Troubleshooter so it may not have as many checks as regular processing.

jsfried commented 2 years ago

This is a great one to have almost completed (pending check of new interface item for diahtcd)! Truly outstanding work by all! Troubleshooter OK except for Default Values button puts a different diameter in the fcs_tree db than it puts in the interface and manual changes to diameter made in the interface do not "take" in the db either; however, if a sample tree is loaded into the interface from a table, then all is well, dbh propagates into the DB correctly, etc. SB reports that volumes and biomass are populating correctly when loading plots. JF confirmed that they are populating correctly in BioSumCalc when appending FVS out.

jsfried commented 2 years ago

Troubleshooter interface now working great. For what it is worth, the results for the species I tested (Doug Fir and CA Juniper) don't seem to vary with the setting of DiaHtCd but it is good that we set it in case there are species in some region for which this setting does matter.