improver.fire_weather.drought_code module#

class DroughtCode[source]#

Bases: IterativeFireWeatherBase

Plugin to calculate the Drought Code (DC).

The DC is a numerical rating of the average moisture content of deep, compact organic layers. It is a useful indicator of seasonal drought effects on forest fuels and the amount of smoldering in deep duff layers and large logs. Higher values indicate drier conditions.

This process is adapted directly from:

Equations and FORTRAN Program for the Canadian Forest Fire Weather Index System (C.E. Van Wagner and T.L. Pickett, 1985). Pages 6-7, Equations 18-23.

Expected input units:
  • Temperature: degrees Celsius

  • Precipitation: mm (24-hour accumulation)

  • Previous DC: dimensionless

  • Month: integer (1-12) for day length factor lookup

DC_DAY_LENGTH_FACTORS = [0.0, -1.6, -1.6, -1.6, 0.9, 3.8, 5.8, 6.4, 5.0, 2.4, 0.4, -1.6, -1.6]#
INPUT_ATTRIBUTE_MAPPINGS: dict[str, str] = {'drought_code': 'input_dc'}#
INPUT_CUBE_NAMES: list[str] = ['air_temperature', 'lwe_thickness_of_precipitation_amount', 'drought_code']#
LAG_TIME: int = 53#
METADATA_SOURCE_CUBE: str = 'drought_code'#
OUTPUT_CUBE_NAME: str = 'drought_code'#
REQUIRES_MONTH: bool = True#
STARTING_VALUE: int = 15#
VALID_OUTPUT_RANGE: tuple[float | None, float | None] | None = (0.0, 1000)#
_abc_impl = <_abc._abc_data object>#
_calculate()[source]#

Calculate the Drought Code (DC).

Return type:

ndarray

Returns:

The calculated DC values for the current day.

_calculate_dc(potential_evapotranspiration)[source]#

Calculates the Drought Code from previous DC and potential evapotranspiration.

From Van Wagner and Pickett (1985), Page 7: Equation 23.

Parameters:

potential_evapotranspiration (ndarray) – The potential evapotranspiration.

Return type:

ndarray

Returns:

The calculated DC value.

_calculate_potential_evapotranspiration()[source]#

Calculates the potential evapotranspiration adjusted for day length. This represents the moisture loss from deep layers due to evaporation and transpiration.

From Van Wagner and Pickett (1985), Pages 6-7: Equation 22, Steps 3 & 4.

Return type:

ndarray

Returns:

The potential evapotranspiration value.

_perform_rainfall_adjustment()[source]#

Updates the previous DC value based on available precipitation accumulation data for the previous 24 hours. This is done element-wise for each grid point.

From Van Wagner and Pickett (1985), Pages 6-7: Equations 18-21, and Steps 2a-2d corresponding to rainfall adjustment.

input_dc: Cube#
month: int#
precipitation: Cube#
previous_dc: ndarray#
temperature: Cube#