RunConfig

class capsis.RunConfig(run_directory)[source]

Bases: object

The RunConfig class is used to configure a capsis run.

Parameters:run_directory (string) – desired path for Capsis run

Example:

>>> import capsis
>>> config = capsis.RunConfig("/path/to/capsis_run/")
>>> config.set_xy_size(160,90,64,64)
>>> config.set_svs_base("stand_0001")
>>> config.set_crown_space(1.5)
>>> config.set_show_3d("true")
>>> config.save_config()
save_config()[source]

This method uses template and reference files to create capsis input files. Input files include input_template.txt, additionalProperties_template.txt and speciesFile.txt, all of which are located in the /data/capsis/ directory. It creates the following output files for the capsis run: capsis_run_file.txt, additionalProperties.txt and <run name>_scalars.csv. Run name is generally the standid found in the FVS keyword file. This method also calls the WFDS.py GenerateBinaryGrid method to generate a binary FDS grid for use by capsis and creates the sim_area.txt file for use by the standfire_analyze.py script.

set_crown_space(space)[source]

Set the distance between crown for Capsis intervention

Parameters:space (float) – crown spacing in meters
set_extend_fvs_sample(extend)[source]

Resets CAPSIS extend to true. This will cause CAPSIS to add additional trees to its landscape based on patterns found in the FVS input tree list. This should only be implemented when the sample doesn’t cover the whole scene (e.g. not for lidar data).

Parameters:extend (boolean) – Truth value of the extend parameter
set_path(path)[source]

Sets path to Capsis run directory. Initially used to verify that “path” is a legitimate directory. Allows the user to modify the path after initialization.

Parameters:path (string) – path to Capsis run directory
set_prune_height(prune)[source]

Set the prunning height (vertical spacing between ground and crown) for a Capsis intervention

Parameters:prune (float) – prunning height
set_show_3d(value)[source]

Set the boolean value of the show3D parameter in the Capsis run file. If true, Capsis will open a 3D display showing the simulation domain.

Parameters:value (boolean) – Truth value of the show3D parameter
set_srf_cover(shrub_cover, herb_cover, litter_cover)[source]

Set percent cover for shrubs, herbs and litter

Parameters:
  • shrub_cover (integer) – shrub percent cover
  • herb_cover (integer) – herb percent cover
  • litter_cover (integer) – litter percent cover
set_srf_dead_load(shrub_load, herb_load, litter_load)[source]

Set surface loads (kg/m2) for dead shrubs, herbs and litter

Parameters:
  • shrub_load (float) – dead shrub surface load (kg/m2)
  • herb_load (float) – dead herbaceaous surface load (kg/m2)
  • litter_load (float) – litter surface load (kg/m2)
set_srf_dead_mc(shrub_mc, herb_mc, litter_mc)[source]

Set percent moisture content for dead shrubs, herbs and litter

Parameters:
  • shrub_mc (integer) – dead shrub moisture content (%)
  • herb_mc (integer) – dead herbaceaous moisture content (%)
  • litter_mc (integer) – dead litter moisture content (%)
set_srf_dead_svr(shrub_svr, herb_svr, litter_svr)[source]

Set surface area to volume ratio for dead shrubs, herbs and litter

Parameters:
  • shrub_svr (integer) – shrub surface area to volume ratio
  • herb_svr (integer) – herbaceaous surface area to volume ratio
  • litter_svr (integer) – litter surface area to volume ratio

Note

Live and dead surface area to volume ratios and not yet differentiated in the user interface. Both live and dead surface area to volume ratios are currently set to the same value.

set_srf_height(shrub_ht, herb_ht, litter_ht)[source]

Set surface fuel heights for shrubs, herbs and litter

Parameters:
  • shrub_ht (float) – shrub height
  • herb_ht (float) – herb height
  • litter_ht (float) – litter height
set_srf_live_load(shrub_load, herb_load)[source]

Set surface loads (kg/m2) for live shrubs and herbs

Parameters:
  • shrub_load (float) – live shrub surface load (kg/m2)
  • herb_load (float) – live herbaceaous surface load (kg/m2)
set_srf_live_mc(shrub_mc, herb_mc)[source]

Set percent moisture content for live shrubs and herbs

Parameters:
  • shrub_mc (integer) – live shrub moisture content (%)
  • herb_mc (integer) – live herbaceaous moisture content (%)
set_srf_live_svr(shrub_svr, herb_svr)[source]

Set surface area to volume ratio for live shrubs and herbs

Parameters:
  • shrub_svr (integer) – shrub surface area to volume ratio
  • herb_svr (integer) – herbaceaous surface area to volume ratio
set_srf_patch(shrub_patch, herb_patch, litter_patch)[source]

Set patch sizes (widths) for shrubs, herbs and litter

Parameters:
  • shrub_patch (float) – shrub patch size (meters)
  • herb_patch (float) – herb patch size (meters)
  • litter_patch (float) – litter patch size (meters)
set_svs_base(base_name)[source]

Sets the base file name for FVS/SVS fuel output files. Unless reset using this function the base name generally is the stand ID found in the FVS keyword file.

Parameters:base_name (string) – base file name for fuel output files

Note

Only the tree .csv file is required. If snags, coarse woody debris (cwd) and scalar files exist in the same directory they will be used by Capsis when writing WFDS fuel inputs.

set_xy_size(x_size, y_size, x_aoi_size, y_aoi_size)[source]

Sets scene and Area Of Interest (AOI) dimensions. Calls methods to update offset and surface fuel block values

Parameters:
  • x_size (integer) – size of scene in the x domain (meters)
  • y_size (integer) – size of scene in the y domain (meters)
  • x_aoi_size (integer) – area of interest size in the x domain
  • y_aoi_size (integer) – area of interest size in the y domain

Note

“x_size” and “y_size” must be greater than or equal to 64 meters

Note

“x_aoi_size” and “y_aoi_size” must be at least 2 meters less than x and y sizes

set_z_size(z_size)[source]

Sets scene z dimension

Parameters:z_size (integer) – size of scene in the z domain (meters)

Note

“z_size” must be greater than or equal to tallest tree in the domain