Exemple #1
0
filename = os.path.join(os.path.dirname(__file__), 'fireraininput.txt')

# Initializing the PrecipitationDistribution class using the default file
# and getting the time series needed for comparison against the fire time series.

Rain = PrecipitationDistribution(filename)
Rain.get_storm_time_series()
storm= Rain.storm_time_series

# Initializing the FireGenerator class using the default file and getting the
# time series needed for comparison against the precipitation time series.

# As an additional step, we should find the scale parameter and set it.
# The default value is set to 0.

Fire = FireGenerator(filename)
Fire.get_scale_parameter()
Fire.generate_fire_time_series()
fires = Fire.fire_events

## Methods used to find these potentially erosion-inducing events.

def set_threshold(arr):

    # Gets threshold using the intensity-duration threshold
    # relationship described in Cannon et al., 2008, for the
    # Coal Seam Fire, East of Denver, Colorado.

    # Threshold value changes for each storm event.

    for event in arr:
The default file is currently set using parameters from central Colorado,
given by Cannon et al., (2008) and Moody and Martin (2001). This sample driver
should not be applied at other sites without careful consideration.

"""

from landlab.components.fire_generator import FireGenerator
from matplotlib import pyplot as plt
import numpy as np

mean_fire = 20.0 # Twenty years between fires
shape_param = 5.5 # Right skewed curve


# Initializing the FireGenerator() class from fire_generator.py
FG = FireGenerator(mean_fire_recurrence = mean_fire,
                   shape_parameter = shape_param)

# Finding a time series based on the Weibull distribution

# First, a list of each fire event as it occurs in time. Time = 0 is the start
# of the model run.
fire_events = [0]
time  = 0

# This will store the randomly generated data points, to be plotted as a
# histogram.
sampled_time_to_fire = []

# How long the time series will be.
time_to_run = 50000.0
Exemple #3
0
drawing from a stochastic, statistical distribution, the output may change
after the component is reloaded.

The default file is currently set using parameters from central Colorado,
given by Cannon et al., (2008) and Moody and Martin (2001). This sample driver
should not be applied at other sites without careful consideration.

"""

from landlab.components.fire_generator import FireGenerator
from matplotlib import pyplot as plt
from scipy.optimize import curve_fit


# Initializing the FireGenerator() class from fire_generator.py
FG = FireGenerator()
FG.initialize()

# Finding unknown scale parameter given the mean fire recurrence value
FG.get_scale_parameter()

# Finding a time series based on the Weibull distribution
FG.generate_fire_time_series()

# Sorting the fire series to test the distribution...
FG.firelist.sort()

# Plotting the histogram to show the distribution.
plt.hist(FG.firelist)
plt.title('Weibull Distribution of Fire Recurrence Values')
plt.xlabel('Histogram of Fire Recurrence (years)', fontsize=14)