Wildfire Modeling#
The wildfire model can be imported using the following command
[TSC+23]
from IPython.display import display, HTML
import plotly.graph_objects as go
import plotly.io as pio
pio.renderers.default = "notebook_connected"
from erad.models.hazard import FireModel, FireModelArea
An instance of FireModel is a list of affected areas with each FireModelArea mapping the following pareameters.
- affected_area: The timestamp of the wild fire event 
- wind_direction: Direction of the wind 
- wind_speed: Average wind speed in the area 
from datetime import datetime
from shapely.geometry import Polygon
from gdm.quantities import Angle
from erad.quantities import Speed
fire_affect_area = FireModelArea(
    affected_area=Polygon(
        [
            (-120, 36),
            (-121, 36),
            (-121, 37),
            (-121, 367),
        ]
    ),
    wind_speed=Speed(50, "miles/hour"),
    wind_direction=Angle(45, "deg"),
)
fire_model = FireModel(
    name="fire model",
    timestamp=datetime.now(),
    affected_areas=[fire_affect_area],
)
fire_model.pprint()
FireModel( name='fire model', timestamp=datetime.datetime(2025, 10, 28, 17, 35, 1, 838558), affected_areas=[ FireModelArea( name='', affected_area=<POLYGON ((-120 36, -121 36, -121 37, -121 367, -120 36))>, wind_speed=<Quantity(50, 'mile / hour')>, wind_direction=<Quantity(45, 'degree')> ) ] )
An example of the FireModel can be built using the example() methods for testing purposes.
fire_model = FireModel.example()
fire_model.pprint()
FireModel( name='fire 1', timestamp=datetime.datetime(2025, 10, 28, 17, 35, 1, 861616), affected_areas=[ FireModelArea( name='', affected_area=<POLYGON ((-120.93 36.601, -120.911 36.602, -120.911 36.571, -120.934 36.581...>, wind_speed=<Quantity(50, 'mile / hour')>, wind_direction=<Quantity(45, 'degree')> ) ] )
Building from historical events#
Erad allows users to build fire models from historic wild fire events as well. The from_wildfire_name class method can be used to build fire models representing historic events.
fire_model = FireModel.from_wildfire_name("GREAT LAKES FIRE")
fire_model.pprint()
FireModel( name='GREAT LAKES FIRE', timestamp=datetime.datetime(2023, 4, 19, 19, 14), affected_areas=[ FireModelArea( name='', affected_area=<POLYGON ((-77.046 34.949, -77.047 34.949, -77.047 34.95, -77.047 34.95, -77...>, wind_speed=<Quantity(-999, 'mile / hour')>, wind_direction=<Quantity(0, 'degree')> ), FireModelArea( name='', affected_area=<POLYGON ((-77.085 35.031, -77.085 35.031, -77.085 35.031, -77.085 35.031, -...>, wind_speed=<Quantity(-999, 'mile / hour')>, wind_direction=<Quantity(0, 'degree')> ) ] )
Plotting Wildfire Model#
fig = go.Figure()
fire_model.plot(figure=fig)
display(HTML(pio.to_html(fig, include_plotlyjs="cdn", full_html=False)))
