USFS-PNW / Fia-Biosum-Manager

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

tree_vol_val_sum_by_rx_cycle.treated_acres miscalculated when there are placeholder rows #254

Closed jsfried closed 3 years ago

jsfried commented 3 years ago

Treated_acres is intended to hold the sum of treatment area across all 4 BioSum cycles. This it should hold acres 1, 2, 3 or 4 depending on how many times a stand is entered and trees removed over the course of a simulation. But, stands that are entered only once (in a cycle other than cycle 1) are getting treated_acres set at acres 2 apparently because of the presence of the placeholder row. Placeholder rows should not be used when calculating treated_acres

lbross commented 3 years ago

I am not able to replicate this with BlueDemo. Let's look at stand 1200741010700100635900002. It has cycle 1 placeholder records for all rxpackages. Treated_acres is calculated as the sum of acres from the econ_by_rxcycle table. We exclude placeholder records from the econ_by_rxcycle table. (I recall going back and forth on this, but I can't find the communication. The current build excludes placeholders). When I look at stand 1200741010700100635900002 in ECON_BY_RX_UTILIZED_SUM, the value for treated_acres is the sum for each rxpackage from econ_by_rxcycle (662.8949). It's easy to calculate because there is only activity for cycle 4.

jsfried commented 3 years ago

Confirmed that this was an old project. Not happening with current build (that lacks placeholders)