FMSC-Measurements / CruiseProcessing

2 stars 1 forks source link

In rare situations, percent removed not calculated if cruise has other species/prod where percent removed is 0 #29

Closed BenCamps closed 5 months ago

BenCamps commented 6 months ago

Because the way that the biomass equation for a given tree is accessed. I.e. by calculating its index in an array and then accessing it via its array index every time, rather than storing it in a variable.

There appears to be a bug where the array used to access the biomass equation changes for one check.

The result of this is when checking whether or not to adjust percent removed for a tree, the biomass equation looked at could be from a different species/prod

The percent removed values used for the adjustment are the correct values. Its just the value used to check if the step needs to be skipped which is possible wrong. However in a survey of regional test files it is very unlikely that this error would cause an issue.

Issue is at line 571 in CalculateTreeValues.cs

BenCamps commented 5 months ago

Existing behavior unchanged in CalculateTreeValues.cs but fixed the issue with CalculateTreeValues2.cs