Skip to content

Cubage Planning


Warning

This library is under development, none of the presented solutions are available for download.

Use forest inventory data to plan the trees to be sampled for volume measurement, ensuring sufficient sampling of the plantation.

Class Parameters

CubagePlanning(df, tree_dbh, tree_height)
Parameters Description
df The DataFrame containing the tree data.
tree_dbh The name of the column containing the diameter at breast height (DBH) values of the trees (centimeters).
tree_height The name of the column that contains the total heights of the trees (meters).

Class Functions

functions and parameters
  CubagePlanning.resume(n_classes=10, dbh_classes=None, height_classes=None,
                        only_height_classes=False, only_dbh_classes=False)  #(1)
  CubagePlanning.p_resume(n_classes=10, dbh_classes=None, height_classes=None,
                          only_height_classes=False, only_dbh_classes=False)  #(2)
  CubagePlanning.get_values(n_cubage_trees, n_classes=10, dbh_classes=None, height_classes=None,
                            only_height_classes=False, only_dbh_classes=False) #(3)
  1. n_classes = Number of classes to which the values of height and diameter at breast height will be subjected.
    dbh_classes = (Optional) Number of DBH classes to which the values of diameter at breast height will be subjected. If None, uses n_classes value.
    height_classes = (Optional) Number of height classes to which the values of height will be subjected. If None, uses n_classes value.
    only_height_classes = (Optional) If True, only height classes will be used for the summary.
    only_dbh_classes = (Optional) only DBH classes will be used for the summary.

  2. n_classes = Number of classes to which the values of height and diameter at breast height will be subjected.
    dbh_classes = (Optional) Number of DBH classes to which the values of diameter at breast height will be subjected. If None, uses n_classes value.
    height_classes = (Optional) Number of height classes to which the values of height will be subjected. If None, uses n_classes value.
    only_height_classes = (Optional) If True, only height classes will be used for the summary.
    only_dbh_classes = (Optional) only DBH classes will be used for the summary.

  3. n_cubage_trees = Number of trees that will be selected for cubage. The default is 10.
    n_classes = Number of classes to which the values of height and diameter at breast height will be subjected.
    dbh_classes = (Optional) Number of DBH classes to which the values of diameter at breast height will be subjected. If None, uses n_classes value.
    height_classes = (Optional) Number of height classes to which the values of height will be subjected. If None, uses n_classes value.
    only_height_classes = (Optional) If True, only height classes will be used for the summary.
    only_dbh_classes = (Optional) only DBH classes will be used for the summary.

Parameters Description
.resume() Returns a summary of how many trees from the provided dataframe are in each class.
.p_resume() Returns a summary of the percentage of trees from the provided dataframe in each class.
.get_values() Returns a dataframe indicating how many trees should be sampled for volume measurement in each class, based on the percentage representation of each class in the total inventory.

Example Usage

taper_functions_example.py
1
2
from fptools.cubage_planning import CubagePlanning #(1)
import pandas as pd #(2)

  1. Import CubagePlanning class.
  2. Import pandas for data manipulation.

Create a variable for the Volumetrics Class

taper_functions_example.py
3
4
5
6
7
df = pd.read_csv(r'C:\Your\path\csv_inventory_file.csv') #(1)
cub = CubagePlanning(df ,'DAP','HT') #(2)
resume = cub.resume() #(3)
percentual_resume = cub.p_resume() #(4)
results = cub.get_values(n_cubage_trees=100) #(5)

  1. Load your csv file.
  2. Create the variable cub containing the CubagePlanning class, using column DAP for the DBH values and the column HT for the heights values.
  3. Get a summary of how many trees from the provided dataframe are in each class and save on resume variable.
  4. Get a summary of the percentage of trees from the provided dataframe in each class and save on percentual_resume variable.
  5. Get a dataframe indicating how many trees should be sampled for volume measurement in each class, based on the percentage representation of each class in the total inventory and save on results variable.