Biomass Estimation¶
Estimate tree biomass (dry weight) and carbon content.
Overview¶
The biomass() function calculates biomass estimates by component. Both biomass and carbon
(biomass × 0.47) are always returned.
import pyfia
db = pyfia.FIA("georgia.duckdb")
db.clip_by_state("GA")
# Above-ground biomass (returns BIO_ACRE, CARB_ACRE, etc.)
result = pyfia.biomass(db, component="AG")
# Total biomass
total = pyfia.biomass(db, component="TOTAL")
Function Reference¶
biomass
¶
biomass(db: str | FIA, grp_by: str | list[str] | None = None, by_species: bool = False, by_size_class: bool = False, land_type: str = 'forest', tree_type: str = 'live', component: str = 'AG', tree_domain: str | None = None, area_domain: str | None = None, plot_domain: str | None = None, totals: bool = True, variance: bool = False, most_recent: bool = False) -> DataFrame
Estimate tree biomass and carbon from FIA data.
Calculates dry weight biomass (in tons) and carbon content using FIA's standard biomass equations and expansion factors. Implements two-stage aggregation following FIA methodology for statistically valid per-acre and total estimates.
| PARAMETER | DESCRIPTION |
|---|---|
db
|
Database connection or path to FIA database. Can be either a path string to a DuckDB/SQLite file or an existing FIA connection object.
TYPE:
|
grp_by
|
Column name(s) to group results by. Can be any column from the FIA tables used in the estimation (PLOT, COND, TREE). Common grouping columns include:
For complete column descriptions, see USDA FIA Database User Guide.
TYPE:
|
by_species
|
If True, group results by species code (SPCD). This is a convenience parameter equivalent to adding 'SPCD' to grp_by.
TYPE:
|
by_size_class
|
If True, group results by diameter size classes. Size classes are defined as: 1.0-4.9", 5.0-9.9", 10.0-19.9", 20.0-29.9", 30.0+".
TYPE:
|
land_type
|
Land type to include in estimation:
TYPE:
|
tree_type
|
Tree type to include:
TYPE:
|
component
|
Biomass component to estimate. Valid options include:
Note: Not all components may be available for all species or regions. Check TREE table for available DRYBIO_* columns.
TYPE:
|
tree_domain
|
SQL-like filter expression for tree-level filtering. Applied to TREE table. Example: "DIA >= 10.0 AND SPCD == 131".
TYPE:
|
area_domain
|
SQL-like filter expression for area/condition-level filtering. Applied to COND table. Example: "OWNGRPCD == 40 AND FORTYPCD == 161".
TYPE:
|
totals
|
If True, include population-level total estimates in addition to per-acre values. Totals are expanded using FIA expansion factors.
TYPE:
|
variance
|
If True, calculate and include variance and standard error estimates. Note: Currently uses simplified variance calculation (10% of estimate).
TYPE:
|
most_recent
|
If True, automatically filter to the most recent evaluation for each state in the database before estimation.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DataFrame
|
Biomass and carbon estimates with the following columns:
|
See Also
volume : Estimate volume per acre (current inventory) tpa : Estimate trees per acre (current inventory) mortality : Estimate annual mortality using GRM tables growth : Estimate annual growth using GRM tables area : Estimate forestland area pyfia.constants.TreeStatus : Tree status code definitions pyfia.constants.OwnershipGroup : Ownership group code definitions pyfia.constants.ForestType : Forest type code definitions pyfia.utils.reference_tables : Functions for adding species/forest type names
Notes
Biomass is calculated using FIA's standard dry weight equations stored in the DRYBIO_* columns of the TREE table. These values are in pounds and are converted to tons by dividing by 2000.
Carbon content is estimated as 47% of dry biomass following IPCC guidelines and FIA standard practice. This percentage may vary slightly by species and component but 47% is the standard factor.
EVALID Handling: If no EVALID is specified, the function automatically selects the most recent EXPVOL evaluation to prevent overcounting from multiple evaluations. For explicit control, use db.clip_by_evalid() before calling biomass().
Evaluation Year vs. Inventory Year: The YEAR in output represents the evaluation reference year from EVALID, not individual plot inventory years (INVYR). Due to FIA's rotating panel design, plots within an evaluation are measured across multiple years (typically 5-7 year cycle), but the evaluation statistically represents forest conditions as of the reference year. For example, EVALID 482300 represents Texas forest conditions as of 2023, even though it includes plots measured 2019-2023.
The function implements two-stage aggregation following FIA methodology:
- Stage 1: Aggregate trees to plot-condition level to ensure each condition's area proportion is counted exactly once.
- Stage 2: Apply expansion factors and calculate ratio-of-means for per-acre estimates and population totals.
This approach prevents the ~20x underestimation that would occur with single-stage aggregation where each tree contributes its condition proportion to the denominator.
Required FIA tables and columns:
- TREE: CN, PLT_CN, CONDID, STATUSCD, SPCD, DIA, TPA_UNADJ, DRYBIO_*
- COND: PLT_CN, CONDID, COND_STATUS_CD, CONDPROP_UNADJ, OWNGRPCD, etc.
- PLOT: CN, STATECD, INVYR, MACRO_BREAKPOINT_DIA
- POP_PLOT_STRATUM_ASSGN: PLT_CN, STRATUM_CN
- POP_STRATUM: CN, EXPNS, ADJ_FACTOR_*
Valid grouping columns depend on which tables are included in the estimation query. For a complete list of available columns and their meanings, refer to:
- USDA FIA Database User Guide, Version 9.1
- pyFIA documentation: https://mihiarc.github.io/pyfia/
- FIA DataMart: https://apps.fs.usda.gov/fia/datamart/
Biomass components availability varies by FIA region and evaluation type. Check your database for available DRYBIO_* columns using:
import duckdb conn = duckdb.connect("your_database.duckdb") columns = conn.execute("PRAGMA table_info(TREE)").fetchall() biomass_cols = [c[1] for c in columns if 'DRYBIO' in c[1]]
Warnings
The variance calculation follows Bechtold & Patterson (2005) methodology for ratio-of-means estimation with stratified sampling. The calculation accounts for covariance between the numerator (biomass/carbon) and denominator (area). For applications requiring the most precise variance estimates, consider also validating against the FIA EVALIDator tool.
Some biomass components may not be available for all species or in all FIA regions. If a requested component is not available, the function will raise an error. Always verify component availability in your specific database.
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the specified biomass component column does not exist in the TREE table, or if grp_by contains invalid column names. |
KeyError
|
If specified columns in grp_by don't exist in the joined tables. |
RuntimeError
|
If no data matches the specified filters and domains. |
Examples:
Basic aboveground biomass on forestland:
>>> results = biomass(db, component="AG", land_type="forest")
>>> if not results.is_empty():
... print(f"Aboveground biomass: {results['BIO_ACRE'][0]:.1f} tons/acre")
... print(f"Carbon storage: {results['CARB_ACRE'][0]:.1f} tons/acre")
... else:
... print("No biomass data available")
Total biomass (above + below ground) by species:
>>> results = biomass(db, by_species=True, component="TOTAL")
>>> # Sort by biomass to find dominant species
>>> if not results.is_empty():
... top_species = results.sort(by='BIO_ACRE', descending=True).head(5)
... print("Top 5 species by biomass per acre:")
... for row in top_species.iter_rows(named=True):
... print(f" SPCD {row['SPCD']}: {row['BIO_ACRE']:.1f} tons/acre")
Biomass by ownership on timberland:
>>> results = biomass(
... db,
... grp_by="OWNGRPCD",
... land_type="timber",
... component="AG",
... tree_type="gs",
... variance=True
... )
>>> # Display with standard errors
>>> for row in results.iter_rows(named=True):
... ownership = {10: "National Forest", 20: "Other Federal",
... 30: "State/Local", 40: "Private"}
... name = ownership.get(row['OWNGRPCD'], f"Code {row['OWNGRPCD']}")
... print(f"{name}: {row['BIO_ACRE']:.1f} ± {row['BIO_ACRE_SE']:.1f} tons/acre")
Large tree biomass by forest type:
>>> results = biomass(
... db,
... grp_by="FORTYPCD",
... tree_domain="DIA >= 20.0",
... component="AG",
... totals=True
... )
>>> # Show both per-acre and total biomass
>>> for row in results.iter_rows(named=True):
... print(f"Forest Type {row['FORTYPCD']}:")
... print(f" Per acre: {row['BIO_ACRE']:.1f} tons")
... print(f" Total: {row['BIO_TOTAL']/1e6:.2f} million tons")
Carbon storage by multiple grouping variables:
>>> results = biomass(
... db,
... grp_by=["STATECD", "OWNGRPCD"],
... component="TOTAL",
... most_recent=True
... )
>>> # Calculate total carbon by state
>>> state_carbon = results.group_by("STATECD").agg([
... pl.col("CARB_TOTAL").sum()
... ])
Standing dead tree biomass:
>>> results = biomass(
... db,
... tree_type="dead",
... component="AG",
... by_size_class=True
... )
>>> print("Dead tree biomass by size class:")
>>> for row in results.iter_rows(named=True):
... print(f" {row['SIZE_CLASS']}: {row['BIO_ACRE']:.1f} tons/acre")
Source code in src/pyfia/estimation/estimators/biomass.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 | |
Biomass Components¶
| Component | Description | FIA Column |
|---|---|---|
"AG" |
Above-ground (default) | DRYBIO_AG |
"BG" |
Below-ground | DRYBIO_BG |
"TOTAL" |
Total biomass | DRYBIO_AG + DRYBIO_BG |
"STEM" |
Stem wood | DRYBIO_STEM |
"STUMP" |
Stump | DRYBIO_STUMP |
"TOP" |
Top and branches | DRYBIO_TOP |
"FOLIAGE" |
Foliage | DRYBIO_FOLIAGE |
Carbon Conversion¶
Carbon is always calculated as biomass × 0.47 (standard carbon fraction) and returned
in the CARB_ACRE and CARB_TOTAL columns alongside the biomass columns.
Examples¶
Above-Ground Biomass by Species¶
result = pyfia.biomass(db, component="AG", grp_by="SPCD")
result = pyfia.join_species_names(result, db)
print(result.sort("BIO_ACRE", descending=True).head(10))
Total Carbon Stock¶
result = pyfia.biomass(
db,
component="TOTAL",
land_type="forest",
totals=True
)
print(f"Carbon: {result['CARB_TOTAL'][0]:,.0f} tons")