improver.fire_weather.duff_moisture_code module#

class DuffMoistureCode[source]#

Bases: IterativeFireWeatherBase

Plugin to calculate the Duff Moisture Code (DMC).

The DMC is a numerical rating of the average moisture content of loosely compacted organic layers of moderate depth. It indicates fuel consumption in moderate duff layers and medium-size woody material. 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). Page 6, Equations 11-16.

Expected input units:
  • Temperature: degrees Celsius

  • Precipitation: mm (24-hour accumulation)

  • Relative humidity: percentage (0-100)

  • Previous DMC: dimensionless

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

DMC_DAY_LENGTH_FACTORS = [0.0, 6.5, 7.5, 9.0, 12.8, 13.9, 13.9, 12.4, 10.9, 9.4, 8.0, 7.0, 6.0]#
INPUT_ATTRIBUTE_MAPPINGS: dict[str, str] = {'duff_moisture_code': 'input_dmc'}#
INPUT_CUBE_NAMES: list[str] = ['air_temperature', 'lwe_thickness_of_precipitation_amount', 'relative_humidity', 'duff_moisture_code']#
LAG_TIME: int = 15#
METADATA_SOURCE_CUBE: str = 'duff_moisture_code'#
OUTPUT_CUBE_NAME: str = 'duff_moisture_code'#
REQUIRES_MONTH: bool = True#
STARTING_VALUE: int = 6#
VALID_OUTPUT_RANGE: tuple[float | None, float | None] | None = (0.0, 400)#
_abc_impl = <_abc._abc_data object>#
_calculate()[source]#

Calculate the Duff Moisture Code (DMC).

Returns:

The calculated DMC values for the current day.

Return type:

np.ndarray

_calculate_dmc(drying_rate)[source]#

Calculates the Duff Moisture Code from previous DMC and drying rate. Note that the drying rate is expected to be pre-multiplied by 100 for computational efficiency. This mathematically matches the original algorithm, but is more efficient to implement this way.

From Van Wagner and Pickett (1985), Page 6: Equation 16.

Parameters:

drying_rate (ndarray) – The drying rate, represented by ‘K’ in the original equations.

Return type:

ndarray

Returns:

The calculated DMC value.

_calculate_drying_rate()[source]#

Calculates the drying rate for DMC. This is multiplied by 100 for computational efficiency in the final DMC calculation. The original algorithm calculates K and then multiplies it by 100 in the DMC equation.

Temperature is bounded to a minimum of -1.1°C. Uses the day length factor for the current month from DMC_DAY_LENGTH_FACTORS.

From Van Wagner and Pickett (1985), Page 6: Equation 16, Steps 3 & 4.

Return type:

ndarray

Returns:

The drying rate (dimensionless). Shape matches input cube data shape. This value is added to previous DMC to get today’s DMC.

_perform_rainfall_adjustment()[source]#

Updates the previous DMC 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), Page 6: Equations 11-15, and Steps 2a-2e corresponding to rainfall adjustment.

input_dmc: Cube#
month: int#
precipitation: Cube#
previous_dmc: ndarray#
relative_humidity: Cube#
temperature: Cube#