예제 #1
0
        /// <summary>
        /// Find cubic volume of tree per hectare.
        /// </summary>
        /// <param name="trees">Trees in stand.</param>
        /// <param name="treeIndex">Tree.</param>
        /// <returns>Cubic volume including top and stump in m³/ha.</returns>
        public static float GetCubicVolume(Trees trees, int treeIndex)
        {
            float dbhInCm         = trees.Dbh[treeIndex];
            float heightInM       = trees.Height[treeIndex];
            float expansionFactor = trees.LiveExpansionFactor[treeIndex];

            if (trees.Units == Units.English)
            {
                dbhInCm         *= Constant.CentimetersPerInch;
                heightInM       *= Constant.MetersPerFoot;
                expansionFactor *= Constant.AcresPerHectare;
            }
            if (dbhInCm <= 0.0F)
            {
                Debug.Assert(dbhInCm == 0.0F);
                return(0.0F);
            }

            float cvtsPerTreeInCubicM = trees.Species switch
            {
                // Poudel K, Temesgen H, Gray AN. 2018. Estimating upper stem diameters and volume of Douglas-fir and Western hemlock
                //   trees in the Pacific northwest. Forest Ecosystems 5:16. https://doi.org/10.1186/s40663-018-0134-2
                // Table 8
                FiaCode.PseudotsugaMenziesii => MathV.Exp(-9.70405F + 1.61812F * MathV.Ln(dbhInCm) + 1.21071F * MathV.Ln(heightInM)),
                FiaCode.TsugaHeterophylla => MathV.Exp(-9.98200F + 1.37228F * MathV.Ln(dbhInCm) + 1.57319F * MathV.Ln(heightInM)),
                _ => throw Trees.CreateUnhandledSpeciesException(trees.Species),
            };

            return(expansionFactor * cvtsPerTreeInCubicM);
        }
예제 #2
0
파일: FiaVolume.cs 프로젝트: OSU-MARS/SEEM
        /// <summary>
        /// Find cubic volume of tree.
        /// </summary>
        /// <param name="trees">Trees in stand.</param>
        /// <param name="treeIndex">Tree.</param>
        /// <returns>Tree's volume including top and stump in ft³.</returns>
        public static float GetCubicFeet(Trees trees, int treeIndex)
        {
            if (trees.Units != Units.English)
            {
                throw new NotSupportedException();
            }

            float dbhInInches = trees.Dbh[treeIndex];

            if (dbhInInches < Constant.InchesPerCentimeter * Constant.Bucking.MinimumScalingDiameter4Saw)
            {
                return(0.0F);
            }

            float logDbhInInches  = MathV.Log10(dbhInInches);
            float heightInFeet    = trees.Height[treeIndex];
            float logHeightInFeet = MathV.Log10(heightInFeet);
            float cvtsl           = trees.Species switch
            {
                // Waddell K, Campbell K, Kuegler O, Christensen G. 2014. FIA Volume Equation documentation updated on 9-19-2014:
                //   Volume estimation for PNW Databases NIMS and FIADB. https://ww3.arb.ca.gov/cc/capandtrade/offsets/copupdatereferences/qm_volume_equations_pnw_updated_091914.pdf
                // Equation 1: western Oregon and Washington (Brackett 1973)
                FiaCode.PseudotsugaMenziesii => - 3.21809F + 0.04948F * logHeightInFeet * logDbhInInches - 0.15664F * logDbhInInches * logDbhInInches +
                2.02132F * logDbhInInches + 1.63408F * logHeightInFeet - 0.16184F * logHeightInFeet * logHeightInFeet,
                // FIA Equation 6: all of Oregon and California (Chambers 1979)
                FiaCode.TsugaHeterophylla => - 2.72170F + 2.00857F * logDbhInInches + 1.08620F * logHeightInFeet - 0.00568F * dbhInInches,
                _ => throw Trees.CreateUnhandledSpeciesException(trees.Species)
            };

            return(MathV.Exp10(cvtsl));
        }
예제 #3
0
파일: FiaVolume.cs 프로젝트: OSU-MARS/SEEM
        /// <summary>
        /// Get cubic volume to a 10 centimeter (four inch) top.
        /// </summary>
        /// <param name="trees">Trees in stand.</param>
        /// <param name="treeIndex">Tree.</param>
        /// <returns>Tree's volume in m³.</returns>
        public static float GetMerchantableCubicFeet(Trees trees, int treeIndex)
        {
            if (trees.Units != Units.English)
            {
                throw new NotSupportedException();
            }

            float dbhInInches = trees.Dbh[treeIndex];

            if (dbhInInches < Constant.InchesPerCentimeter * Constant.Bucking.MinimumScalingDiameter4Saw)
            {
                // CV4 regression goes negative, unsurprisingly, for trees less than four inches in diameter
                return(0.0F);
            }

            float cvts = FiaVolume.GetCubicFeet(trees, treeIndex);

            if (cvts <= 0.0)
            {
                return(0.0F);
            }

            float basalAreaInSquareFeet = Constant.ForestersEnglish * dbhInInches * dbhInInches;
            float tarif = trees.Species switch
            {
                // Waddell K, Campbell K, Kuegler O, Christensen G. 2014. FIA Volume Equation documentation updated on 9-19-2014:
                //   Volume estimation for PNW Databases NIMS and FIADB. https://ww3.arb.ca.gov/cc/capandtrade/offsets/copupdatereferences/qm_volume_equations_pnw_updated_091914.pdf
                // Douglas-fir and western hemlock use the same tarif and CV4 regressions
                // FIA Equation 1: western Oregon and Washington (Brackett 1973)
                // FIA Equation 6: all of Oregon and California (Chambers 1979)
                FiaCode.PseudotsugaMenziesii or
                FiaCode.TsugaHeterophylla =>
                0.912733F *cvts / (1.033F * (1.0F + 1.382937F * MathV.Exp(-4.015292F * dbhInInches / 10.0F)) * (basalAreaInSquareFeet + 0.087266F) - 0.174533F),
                _ => throw Trees.CreateUnhandledSpeciesException(trees.Species)
            };

            return(tarif * (basalAreaInSquareFeet - 0.087266F) / 0.912733F);
        }
예제 #4
0
파일: FiaVolume.cs 프로젝트: OSU-MARS/SEEM
        /// <summary>
        /// Get Scribner board foot volume for 32 foot logs to a six inch top.
        /// </summary>
        /// <param name="trees">Trees in stand.</param>
        /// <param name="treeIndex">Tree.</param>
        /// <returns>Tree's volume in Scribner board feet</returns>
        public static float GetScribnerBoardFeet(Trees trees, int treeIndex)
        {
            if (trees.Units != Units.English)
            {
                throw new NotSupportedException();
            }

            // repeat code of GetCubicFeet() as this provides about a 6% speedup
            float dbhInInches = trees.Dbh[treeIndex];

            if (dbhInInches < 6.0F)
            {
                return(0.0F);
            }

            float logDbhInInches  = MathV.Log10(dbhInInches);
            float heightInFeet    = trees.Height[treeIndex];
            float logHeightInFeet = MathV.Log10(heightInFeet);
            float cvtsl           = trees.Species switch
            {
                // Waddell K, Campbell K, Kuegler O, Christensen G. 2014. FIA Volume Equation documentation updated on 9-19-2014:
                //   Volume estimation for PNW Databases NIMS and FIADB. https://ww3.arb.ca.gov/cc/capandtrade/offsets/copupdatereferences/qm_volume_equations_pnw_updated_091914.pdf
                // Equation 1: western Oregon and Washington (Brackett 1973)
                FiaCode.PseudotsugaMenziesii => - 3.21809F + 0.04948F * logHeightInFeet * logDbhInInches - 0.15664F * logDbhInInches * logDbhInInches +
                2.02132F * logDbhInInches + 1.63408F * logHeightInFeet - 0.16184F * logHeightInFeet * logHeightInFeet,
                // FIA Equation 6: all of Oregon and California (Chambers 1979)
                FiaCode.TsugaHeterophylla => - 2.72170F + 2.00857F * logDbhInInches + 1.08620F * logHeightInFeet - 0.00568F * dbhInInches,
                _ => throw Trees.CreateUnhandledSpeciesException(trees.Species)
            };
            float cubicFeet = MathV.Exp10(cvtsl);

            float basalAreaInSquareFeet = Constant.ForestersEnglish * dbhInInches * dbhInInches;
            float tarif = trees.Species switch
            {
                // Waddell K, Campbell K, Kuegler O, Christensen G. 2014. FIA Volume Equation documentation updated on 9-19-2014:
                //   Volume estimation for PNW Databases NIMS and FIADB. https://ww3.arb.ca.gov/cc/capandtrade/offsets/copupdatereferences/qm_volume_equations_pnw_updated_091914.pdf
                // Douglas-fir and western hemlock use the same tarif and CV4 regressions
                // FIA Equation 1: western Oregon and Washington (Brackett 1973)
                // FIA Equation 6: all of Oregon and California (Chambers 1979)
                FiaCode.PseudotsugaMenziesii or
                FiaCode.TsugaHeterophylla =>
                0.912733F *cubicFeet / (1.033F * (1.0F + 1.382937F * MathV.Exp(-4.015292F * dbhInInches / 10.0F)) * (basalAreaInSquareFeet + 0.087266F) - 0.174533F),
                _ => throw Trees.CreateUnhandledSpeciesException(trees.Species)
            };
            float cv4 = tarif * (basalAreaInSquareFeet - 0.087266F) / 0.912733F;

            // conversion to Scribner volumes for 32 foot trees
            // Waddell 2014:32
            // float rc6 = 0.993F * (1.0F - MathF.Pow(0.62F, dbhInInches - 6.0F));
            float rc6   = 0.993F * (1.0F - MathV.Exp(-0.6896598794F * (dbhInInches - 6.0F))); // log2(0.62) = -0.6896598794
            float cv6   = rc6 * cv4;
            float b4    = tarif / 0.912733F;
            float logB4 = MathV.Log10(b4);
            // float rs616 = MathF.Pow(10.0F, 0.174439F + 0.117594F * logDbhInInches * logB4 - 8.210585F / (dbhInInches * dbhInInches) + 0.236693F * logB4 - 0.00001345F * b4 * b4 - 0.00001937F * dbhInInches * dbhInInches);
            float rs616 = MathV.Exp10(0.174439F + 0.117594F * logDbhInInches * logB4 - 8.210585F / (dbhInInches * dbhInInches) + 0.236693F * logB4 - 0.00001345F * b4 * b4 - 0.00001937F * dbhInInches * dbhInInches);
            float sv616 = rs616 * cv6;   // Scribner board foot volume to a 6 inch top for 16 foot logs
            float rs632 = 1.001491F - 6.924097F / tarif + 0.00001351F * dbhInInches * dbhInInches;
            float sv632 = rs632 * sv616; // Scribner board foot volume to a 6 inch top for 32 foot logs

            Debug.Assert(rc6 >= 0.0F);
            Debug.Assert(rc6 <= 1.0F);
            Debug.Assert(rs616 >= 1.0F);
            Debug.Assert(rs616 <= 6.8F);
            Debug.Assert(rs632 >= 0.0F);
            Debug.Assert(rs632 <= 1.0F);
            Debug.Assert(sv632 >= 0.0F);
            Debug.Assert(sv632 <= 10.0 * 1000.0F);
            return(sv632);
        }
    }
}