Biomass Estimation¶
Estimate tree biomass (dry weight) and carbon content.
Overview¶
The biomass() function calculates biomass estimates by component.
import pyfia
db = pyfia.FIA("georgia.duckdb")
db.clip_by_state("GA")
# Above-ground biomass
result = pyfia.biomass(db, component="AG")
# Total biomass as carbon
carbon = pyfia.biomass(db, component="TOTAL", as_carbon=True)
Function Reference¶
biomass
¶
biomass(db: Union[str, FIA], grp_by: Optional[Union[str, List[str]]] = None, by_species: bool = False, by_size_class: bool = False, land_type: str = 'forest', tree_type: str = 'live', component: str = 'AG', tree_domain: Optional[str] = None, area_domain: Optional[str] = None, plot_domain: Optional[str] = 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.
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
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 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 | |
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¶
When as_carbon=True, biomass is multiplied by 0.47 (standard carbon fraction).
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("estimate", descending=True).head(10))
Total Carbon Stock¶
result = pyfia.biomass(
db,
component="TOTAL",
as_carbon=True,
land_type="forest"
)
print(f"Carbon: {result['estimate'][0]:,.0f} tons")