pyfia.utils.reference_tables
Utility module for joining reference tables in pyFIA.
This module provides functions to easily join FIA reference tables
with estimation results to add descriptive names and metadata.
Functions
join_forest_type_names
data: DataFrame containing forest type codesdb: FIA database object or path to databaseforest_type_col: Column name containing forest type codesname_col: Name for the joined forest type name column
- Original data with forest type names added
results = area(db, grp_by=[‘FORTYPCD’], totals=True) results_with_names = join_forest_type_names(results, db)
join_species_names
data: DataFrame containing species codesdb: FIA database object or path to databasespecies_col: Column name containing species codescommon_name_col: Name for the joined common name columnscientific_name_col: Name for the joined scientific name columninclude_scientific: Whether to include scientific names
- Original data with species names added
results = tpa(db, bySpecies=True) results_with_names = join_species_names(results, db)
join_state_names
data: DataFrame containing state codesdb: FIA database object or path to databasestate_col: Column name containing state codesstate_name_col: Name for the joined state name columnstate_abbr_col: Name for the joined state abbreviation columninclude_abbr: Whether to include state abbreviations
- Original data with state names added
join_multiple_references
data: DataFrame to join reference tables todb: FIA database object or path to databaseforest_type: Whether to join forest type namesspecies: Whether to join species namesstate: Whether to join state names**kwargs: Additional arguments passed to individual join functions
- Data with requested reference tables joined
results = area(db, grp_by=[‘STATECD’, ‘FORTYPCD’], totals=True) results_with_names = join_multiple_references( … results, db, … forest_type=True, … state=True … )