FuelCalc

class fuels.FuelCalc(trees)[source]

Bases: object

This class calculates several fuel attributes and appends them to the FVS output tree list generated by the Fvsfuels class, generating a new .csv file.

Parameters:trees (csv file or pandas data frame) – FVS output tree list
calc_bulk_density()[source]

Calculates crown bulk density based on crown volume and biomass weight (weight/vol)

calc_crown_volume()[source]

Calculates crown volume based on geometry and crown dimensions

static cone_volume(radius, height)[source]

Returns the volume of a cone

Parameters:
  • radius (float) – radius
  • height (float) – height
Returns:

volume

Return type:

float

\[\Pi*radius^2 \frac{height}{3}\]
convert_units(from_to=1)[source]

Convert all units in data frame

Parameters:from_to (integer) – 1 = english to metric; 2 = metric to english (default=1)

Note

if this method is called more than once on the same instance of a data frame with the same conversion code a warning will be printed to the console

static cylinder_volume(radius, height)[source]

Returns the volume of a cylinder

Parameters:
  • radius (float) – radius
  • height (float) – height
Returns:

volume

Return type:

float

\[\Pi*radius^2*height\]
static frustum_volume(big_r, height, small_r=0.5)[source]

Returns the volume of a frustum

Parameters:
  • small_r (float) – small (top) radius
  • height (float) – height
  • big_r (float) – big (bottom) radius
Returns:

volume

Return type:

float

\[\frac{\Pi*height}{3}(big_r^2+small_r*big_r+small_r^2)\]
get_crown_base_ht()[source]

Calculates crown base height for each tree based on crown ratio and tree height. This value is added to the data frame

\[h - (c_{ratio}*h)\]
get_crown_ht()[source]

Calculates crown height for each trees based on crown ratio. This value is added to the data frame

\[c_{ratio}*h\]
get_species_list()[source]

Return set of species existing in trees file supplied to constructor

Returns:unique list of species
Return type:list

Note

This methods is useful when assigning geometries by species. A user can first retrieve the species list then use it to assigne crown geometries

static rectangle_volume(width, height)[source]

Returns the volume of a rectangle

Parameters:
  • width (float) – width
  • height (float) – height
Returns:

volume

Return type:

float

\[width^2*height\]
save_trees(save_to)[source]

Write trees data frame to specified directory

Parameters:save_to (string) – directory and filename of file to save
set_crown_geometry(sp_geom_dict)[source]

Appends crown geometry to each tree in the data frame conditional on species.

Parameters:

sp_geom_dict (python dictionary) – dictionary of species-specific crown geometries

Example:
>>> sp_dict = {"PIPO" : "cylinder", "PSME" : "frustum"}
>>> fuels.set_crown_geometry(sp_dict)