In [ ]:
import sys
import os
import numpy as np
from matplotlib import pyplot as plt
sys.path.append(os.path.abspath(os.path.join('../..')))
from firemodel import rothermel
from firemodel.environment import fuel_models, moisture_scenarios
In [ ]:
print(fuel_models['A1'])
In [ ]:
print(moisture_scenarios['D2L2'])
In [ ]:
# Run rothermel model on predefined fuel and moisture models
rothermel.ros('A1', 'D2L2', 15, 10)
In [ ]:
# Run rothermel model with explicit fuel/moisture parameters
rothermel.ros_detailed(modeltype=1, loads=(1.6599999999999999, 0.0, 0.0, 0.0, 0.0), savs=(11483, 0, 0, 0, 0),
depth=30, mx_dead=12, heat_contents=(12, 18622, 18622, 18622, 18622),
moistures=moisture_scenarios['D1L1'].moistures, wind=0, slope=0)
In [ ]:
# Run rothermel on randomly selected configurations
import random
import pprint
# generate configurations to test against
confs = []
for fuel in fuel_models.keys():
for moisture in moisture_scenarios.keys():
for wind in np.linspace(0, 30, num=10):
for slope in np.linspace(0, 100, num=10):
confs.append((fuel, moisture, wind, slope))
# select 30 of those configurations
rand_confs = [ confs[i] for i in sorted(random.sample(range(len(confs)), 30)) ]
# compute ros for all selected confs
res = []
for fuel, moisture, wind, slope in rand_confs:
ros, summary = rothermel.ros(fuel, moisture, wind, slope)
res.append((fuel, moisture, wind, slope, ros))
pprint.pprint(sorted(res))
In [ ]: