Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions improver/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"FieldTexture": "improver.utilities.textural",
"FillRadarHoles": "improver.nowcasting.utilities",
"FineFuelMoistureContent": "improver.fire_weather.fine_fuel_moisture_content",
"FireSeverityIndex": "improver.fire_weather.fire_severity_index",
"FreezingRain": "improver.precipitation.freezing_rain",
"FrictionVelocity": "improver.wind_calculations.wind_downscaling",
"GenerateClearskySolarRadiation": "improver.generate_ancillaries.generate_derived_solar_fields",
Expand Down
5 changes: 3 additions & 2 deletions improver/fire_weather/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class FireWeatherIndexBase(BasePlugin):
The Canadian Forest Fire Weather Index System requires specific units
for all calculations. These are fixed and cannot be overridden:

- Temperature: degrees Celsius (degC)
- Temperature: degrees Celsius (Celsius)
- Precipitation: millimeters (mm)
- Relative humidity: dimensionless fraction (1)
- Wind speed: kilometers per hour (km/h)
Expand All @@ -50,7 +50,7 @@ class FireWeatherIndexBase(BasePlugin):
# Fixed unit conversions for all cube types used in fire weather calculations
# These units are required by the Canadian FWI System and cannot be changed
_REQUIRED_UNITS: dict[str, str] = {
"temperature": "degC",
"temperature": "Celsius",
"precipitation": "mm",
"relative_humidity": "1",
"wind_speed": "km/h",
Expand Down Expand Up @@ -85,6 +85,7 @@ class FireWeatherIndexBase(BasePlugin):
"input_ffmc": (0.0, 101.0), # Valid FFMC range
"input_dmc": (0.0, None), # DMC is non-negative
"input_dc": (0.0, None), # DC is non-negative
"canadian_forest_fire_weather_index": (0.0, 100.0), # FWI valid range
}

# Valid output ranges for warning checks (output_name: (min, max))
Expand Down
50 changes: 50 additions & 0 deletions improver/fire_weather/fire_severity_index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# (C) Crown Copyright, Met Office. All rights reserved.
#
# This file is part of 'IMPROVER' and is released under the BSD 3-Clause license.
# See LICENSE in the root of the repository for full licensing details.
"""Plugin to calculate the Fire Severity Index (Daily Severity Rating)."""

import numpy as np
from iris.cube import Cube

from improver.fire_weather import FireWeatherIndexBase


class FireSeverityIndex(FireWeatherIndexBase):
"""
Plugin to calculate the Fire Severity Index, also known as the
Daily Severity Rating (DSR).

The DSR provides a numerical rating of the difficulty of controlling fires.
It is derived from the Fire Weather Index (FWI) and represents the daily
fire load and the expected effort required for fire suppression.

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 8, Equation 31.

Expected input units:
- Fire Weather Index (FWI): dimensionless
"""

INPUT_CUBE_NAMES = ["canadian_forest_fire_weather_index"]
OUTPUT_CUBE_NAME = "fire_severity_index"

canadian_forest_fire_weather_index: Cube

def _calculate(self) -> np.ndarray:
"""Calculates the Daily Severity Rating (DSR) from FWI.

From Van Wagner and Pickett (1985), Page 8: Equation 31.

Returns:
np.ndarray: The calculated DSR values.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
np.ndarray: The calculated DSR values.
The calculated DSR values.

Return type in docstring not required. Sphinx/Read the Docs infers from return type hint.

"""
fwi_data = self.canadian_forest_fire_weather_index.data

# Equation 31: DSR = 0.0272 * FWI^1.77
dsr = 0.0272 * fwi_data**1.77

return dsr
2 changes: 1 addition & 1 deletion improver_tests/fire_weather/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def make_input_cubes(
Example:
>>> cubes = make_input_cubes(
... [
... ("air_temperature", 20.0, "degC", False),
... ("air_temperature", 20.0, "Celsius", False),
... ("lwe_thickness_of_precipitation_amount", 1.0, "mm", True),
... ]
... )
Expand Down
Loading