0
# Fire Weather Indices
1
2
Complete Canadian Forest Fire Weather Index System implementation for wildfire risk assessment and forest management applications. These indices are internationally recognized standards for fire weather monitoring.
3
4
## Capabilities
5
6
### Core Fire Weather Components
7
8
The fundamental components of the Canadian Forest Fire Weather Index System.
9
10
```python { .api }
11
def fine_fuel_moisture_code(pr, tas, hurs, sfcwind, ffmc0=85.0, **kwargs):
12
"""
13
Fine Fuel Moisture Code (FFMC) - moisture content of litter and fine fuels.
14
15
Parameters:
16
- pr: xr.DataArray, daily precipitation data
17
- tas: xr.DataArray, daily temperature at noon
18
- hurs: xr.DataArray, daily relative humidity at noon
19
- sfcwind: xr.DataArray, daily wind speed at noon
20
- ffmc0: float, initial FFMC value (default 85.0)
21
- **kwargs: additional parameters
22
23
Returns:
24
xr.DataArray: Fine Fuel Moisture Code values
25
"""
26
27
def duff_moisture_code(pr, tas, hurs, dmc0=6.0, lat=None, **kwargs):
28
"""
29
Duff Moisture Code (DMC) - moisture content of loosely compacted organic layers.
30
31
Parameters:
32
- pr: xr.DataArray, daily precipitation data
33
- tas: xr.DataArray, daily temperature at noon
34
- hurs: xr.DataArray, daily relative humidity at noon
35
- dmc0: float, initial DMC value (default 6.0)
36
- lat: xr.DataArray, latitude for day length adjustment
37
- **kwargs: additional parameters
38
39
Returns:
40
xr.DataArray: Duff Moisture Code values
41
"""
42
43
def drought_code(pr, tas, dc0=15.0, lat=None, **kwargs):
44
"""
45
Drought Code (DC) - moisture content of deep, compact organic layers.
46
47
Parameters:
48
- pr: xr.DataArray, daily precipitation data
49
- tas: xr.DataArray, daily temperature at noon
50
- dc0: float, initial DC value (default 15.0)
51
- lat: xr.DataArray, latitude for day length adjustment
52
- **kwargs: additional parameters
53
54
Returns:
55
xr.DataArray: Drought Code values
56
"""
57
```
58
59
### Fire Behavior Indices
60
61
Fire behavior and intensity indices derived from the core moisture codes.
62
63
```python { .api }
64
def initial_spread_index(ffmc, sfcwind, **kwargs):
65
"""
66
Initial Spread Index (ISI) - rate of fire spread without wind influence.
67
68
Parameters:
69
- ffmc: xr.DataArray, Fine Fuel Moisture Code values
70
- sfcwind: xr.DataArray, daily wind speed at noon
71
- **kwargs: additional parameters
72
73
Returns:
74
xr.DataArray: Initial Spread Index values
75
"""
76
77
def buildup_index(dmc, dc, **kwargs):
78
"""
79
Buildup Index (BUI) - total fuel available for combustion.
80
81
Parameters:
82
- dmc: xr.DataArray, Duff Moisture Code values
83
- dc: xr.DataArray, Drought Code values
84
- **kwargs: additional parameters
85
86
Returns:
87
xr.DataArray: Buildup Index values
88
"""
89
90
def fire_weather_index(isi, bui, **kwargs):
91
"""
92
Fire Weather Index (FWI) - general fire intensity index.
93
94
Parameters:
95
- isi: xr.DataArray, Initial Spread Index values
96
- bui: xr.DataArray, Buildup Index values
97
- **kwargs: additional parameters
98
99
Returns:
100
xr.DataArray: Fire Weather Index values
101
"""
102
103
def daily_severity_rating(fwi, **kwargs):
104
"""
105
Daily Severity Rating (DSR) - relative measure of difficulty of fire suppression.
106
107
Parameters:
108
- fwi: xr.DataArray, Fire Weather Index values
109
- **kwargs: additional parameters
110
111
Returns:
112
xr.DataArray: Daily Severity Rating values
113
"""
114
```
115
116
### Seasonal Fire Indices
117
118
Seasonal fire weather analysis and overwinter adjustments.
119
120
```python { .api }
121
def overwintering_drought_code(dc_end, precipitation_winter, **kwargs):
122
"""
123
Overwintering Drought Code for spring fire season initialization.
124
125
Parameters:
126
- dc_end: xr.DataArray, DC value at end of previous fire season
127
- precipitation_winter: xr.DataArray, total winter precipitation
128
- **kwargs: additional parameters
129
130
Returns:
131
xr.DataArray: Spring DC initialization values
132
"""
133
134
def fire_season(tas, method="wf93", **kwargs):
135
"""
136
Determine fire season start and end dates.
137
138
Parameters:
139
- tas: xr.DataArray, daily temperature data
140
- method: str, method for season determination ("wf93", "las08")
141
- **kwargs: additional parameters
142
143
Returns:
144
xr.Dataset: Fire season start and end dates
145
"""
146
147
def fire_season_length(tas, method="wf93", freq="YS", **kwargs):
148
"""
149
Calculate fire season length.
150
151
Parameters:
152
- tas: xr.DataArray, daily temperature data
153
- method: str, method for season determination
154
- freq: str, resampling frequency
155
- **kwargs: additional parameters
156
157
Returns:
158
xr.DataArray: Fire season length in days
159
"""
160
```
161
162
### Fire Danger Classes
163
164
Classification of fire danger levels based on FWI system components.
165
166
```python { .api }
167
def fire_danger_class(fwi, **kwargs):
168
"""
169
Classify fire danger level based on FWI values.
170
171
Parameters:
172
- fwi: xr.DataArray, Fire Weather Index values
173
- **kwargs: additional classification parameters
174
175
Returns:
176
xr.DataArray: Fire danger class (1=Low, 2=Moderate, 3=High, 4=Very High, 5=Extreme)
177
"""
178
179
def ffmc_danger_class(ffmc, **kwargs):
180
"""
181
Classify fine fuel moisture danger level.
182
183
Parameters:
184
- ffmc: xr.DataArray, Fine Fuel Moisture Code values
185
- **kwargs: additional parameters
186
187
Returns:
188
xr.DataArray: FFMC danger class
189
"""
190
191
def dmc_danger_class(dmc, **kwargs):
192
"""
193
Classify duff moisture danger level.
194
195
Parameters:
196
- dmc: xr.DataArray, Duff Moisture Code values
197
- **kwargs: additional parameters
198
199
Returns:
200
xr.DataArray: DMC danger class
201
"""
202
203
def dc_danger_class(dc, **kwargs):
204
"""
205
Classify drought danger level.
206
207
Parameters:
208
- dc: xr.DataArray, Drought Code values
209
- **kwargs: additional parameters
210
211
Returns:
212
xr.DataArray: DC danger class
213
"""
214
```
215
216
## Usage Examples
217
218
### Complete FWI System Calculation
219
220
```python
221
import xarray as xr
222
import xclim.indices.fire as xcf
223
224
# Load weather data
225
ds = xr.open_dataset("weather_data.nc")
226
pr = ds.pr # Daily precipitation
227
tas = ds.tas # Daily temperature at noon
228
hurs = ds.hurs # Daily relative humidity at noon
229
sfcwind = ds.sfcwind # Daily wind speed at noon
230
lat = ds.lat # Latitude for day length correction
231
232
# Calculate moisture codes
233
ffmc = xcf.fine_fuel_moisture_code(pr, tas, hurs, sfcwind, ffmc0=85.0)
234
dmc = xcf.duff_moisture_code(pr, tas, hurs, dmc0=6.0, lat=lat)
235
dc = xcf.drought_code(pr, tas, dc0=15.0, lat=lat)
236
237
# Calculate fire behavior indices
238
isi = xcf.initial_spread_index(ffmc, sfcwind)
239
bui = xcf.buildup_index(dmc, dc)
240
fwi = xcf.fire_weather_index(isi, bui)
241
dsr = xcf.daily_severity_rating(fwi)
242
```
243
244
### Fire Danger Classification
245
246
```python
247
# Classify fire danger levels
248
danger_class = xcf.fire_danger_class(fwi)
249
250
# Component-specific danger levels
251
ffmc_class = xcf.ffmc_danger_class(ffmc)
252
dmc_class = xcf.dmc_danger_class(dmc)
253
dc_class = xcf.dc_danger_class(dc)
254
255
# Count extreme fire danger days
256
extreme_days = (danger_class == 5).sum(dim="time")
257
```
258
259
### Seasonal Fire Analysis
260
261
```python
262
# Determine fire season
263
fire_season_dates = xcf.fire_season(tas, method="wf93")
264
season_start = fire_season_dates.fire_season_start
265
season_end = fire_season_dates.fire_season_end
266
267
# Calculate season length
268
season_length = xcf.fire_season_length(tas, method="wf93", freq="YS")
269
270
# Seasonal FWI statistics (during fire season only)
271
seasonal_fwi_max = fwi.where(
272
(fwi.time.dt.dayofyear >= season_start) &
273
(fwi.time.dt.dayofyear <= season_end)
274
).resample(time="YS").max()
275
```
276
277
### Overwinter Adjustment
278
279
```python
280
# Calculate overwinter DC adjustment for multi-year runs
281
winter_precip = pr.where(
282
(pr.time.dt.month >= 11) | (pr.time.dt.month <= 3)
283
).resample(time="YS-NOV").sum()
284
285
# Get DC at end of fire season
286
dc_fall = dc.where(dc.time.dt.month == 10).resample(time="YS").last()
287
288
# Calculate spring DC initialization
289
dc_spring = xcf.overwintering_drought_code(dc_fall, winter_precip)
290
```
291
292
### Fire Weather Thresholds
293
294
```python
295
# High fire danger conditions
296
high_fwi_days = (fwi > 30).sum(dim="time") # FWI > 30
297
extreme_fwi_days = (fwi > 50).sum(dim="time") # FWI > 50
298
299
# Dry fuel conditions
300
dry_ffmc_days = (ffmc > 90).sum(dim="time") # Very dry fine fuels
301
drought_dc_days = (dc > 600).sum(dim="time") # Severe drought
302
303
# Combined severe conditions
304
severe_conditions = (
305
(fwi > 30) & (ffmc > 90) & (dc > 400)
306
).sum(dim="time")
307
```