Ejemplo n.º 1
0
This uses the default file in the generate_fire.py component. Because we are
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.generate_fire 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)
Ejemplo n.º 2
0
the fire distribution. 

The fire time series is generated using that scale and shape parameters.
The histogram is sorted and plotted to verify the Weibull distribution.

Written by Jordan Marie Adams, 2013. 
"""
import os
from landlab.components.fire_generator.generate_fire import FireGenerator
from matplotlib import pyplot as plt

# Input text file name and location
filename = os.path.join(os.path.dirname(__file__), 'fire.txt')

# Initializing the FireGenerator() class from generate_fire.py'
FG = FireGenerator(filename)

# Finding the unknown scale parameter for the distribution
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.fire_events.sort()

# Plotting the histogram to show the distribution.
ymax = int(FG.total_run_time)+1
yaxis = range(0, ymax)
#plt.plot(FG.fire_events)
plt.hist(FG.fire_events)
Ejemplo n.º 3
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.
Ejemplo n.º 4
0
from landlab.components.uniform_precip.generate_uniform_precip import PrecipitationDistribution
from landlab.components.fire_generator.generate_fire import FireGenerator
import numpy as np
from math import ceil

## INPUT TXT FILE WITH NECESSARY PARAMETERS ##
filename = os.path.join(os.path.dirname(__file__), 'fireraininput.txt')

## INITIALIZING THE CLASSES IN LANDLAB ##

Rain = PrecipitationDistribution()
Rain.initialize(filename)
Rain.get_storm_time_series() ## UNITS IN DAYS
storm= Rain.storm_time_series

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

## FUNCTIONS TO GET POTENTIAL EROSION EVENTS

## set_threshold() ##
## 
## GETS THRESHOLD BASED ON
## CANNON ET AL., 2008 RELATIONSHIP
## FOR THE COAL SEAM FIRE, EAST OF
## DENVER, COLORADO

def set_threshold(arr):