pyfia.estimation.estimators.tree_metrics
Derived tree metrics estimation for FIA data.
Computes TPA-weighted descriptive statistics at the condition or group level.
These are sample-level metrics (not population estimates), so they do not
require expansion factors or variance estimation.
Functions
tree_metrics
-
db: FIA database connection with EVALID set. -
metrics: Metrics to compute. Valid options: -
"qmd": Quadratic mean diameter -
"mean_dia": Arithmetic mean diameter (TPA-weighted) -
"mean_height": Mean tree height (TPA-weighted) -
"softwood_prop": Softwood proportion of biomass (SPCD < 300) -
"sawtimber_prop": Proportion of TPA above sawtimber threshold -
"max_dia": Maximum tree diameter -
"stocking": Rough stocking index -
grp_by: Grouping columns. Supports standard FIA columns (FORTYPCD, STDAGE, etc.) and plot-condition level grouping (PLT_CN, CONDID). -
land_type: Land type filter: “forest”, “timber”, or “all”. -
tree_type: Tree status filter: “live”, “dead”, or “gs” (growing stock). -
tree_domain: SQL-like tree filter (e.g.,"DIA >= 5.0"). -
area_domain: SQL-like condition filter (e.g.,"FORTYPCD IN (161, 162)"). -
sawtimber_threshold: Diameter threshold for sawtimber_prop metric. -
include_cond_attrs: COND table columns to pass through in the output (e.g.,["SLOPE", "SICOND", "ASPECT"]). Only useful when grouping by PLT_CN + CONDID.
- Metrics with one row per group. Columns include the requested metrics plus N_PLOTS and N_TREES counts.
result = tree_metrics(db, metrics=[“qmd”, “mean_height”], grp_by=“FORTYPCD”) Condition-level metrics for timber valuation: result = tree_metrics( … db, … metrics=[“qmd”, “mean_height”, “softwood_prop”, “sawtimber_prop”], … grp_by=[“PLT_CN”, “CONDID”, “STDAGE”, “FORTYPCD”], … land_type=“timber”, … tree_domain=“DIA >= 1.0”, … include_cond_attrs=[“SLOPE”, “SICOND”], … )