Package firetools :: Module FirePerimeters
[hide private]
[frames] | no frames]

Module FirePerimeters

source code

Fire Perimeter Functions

This module contains two convienence functions (Import and Extract) and a host of low level functions for dealing with fire perimeter data. The import function is called by the user in the configuration script and includes the input data parameters and analysis options. the extract function is called for the fire perimeter data during the more general call to Study.Extract().

Classes [hide private]
  FirePerimeters
Functions [hide private]
 
Import(study, inshape, datefield, datetype, count=True, pointinterval=True, adddates=True, exporttable=True)
Fire perimeter shapefile import convienence function
source code
 
Extract(study, varname)
Extract Case History Data from a Fire Perimeter Series
source code
 
PrepFirePerims(study, inshape, datefield, datetype, varname='FIRE', adddates=True)
Prepare / Import the input fire perimeter history.
source code
 
FireCountRaster(rawdatagrid, cellsize)
Compute rasters summarizing the period [start <= t < end]
source code
 
PopulatePointIntervals(datagrid)
Populate the fire points with the data about the previous fire
source code
 
ExtractBurn(datagrid, sdates, edates, cellsize)
Extract fire occurrence rasters for each sample period
source code
 
ExtractTSF(datagrid, sdates, edates, cellsize)
Extract Time Since Fire for each sample period
source code
 
PrepFirePerims_X(workingdir, pointgrid, inshape, datefield, datetype, initshp=False, finshp=False)
Prepare / Import the input fire perimeter history.
source code
Function Details [hide private]

Import(study, inshape, datefield, datetype, count=True, pointinterval=True, adddates=True, exporttable=True)

source code 
Fire perimeter shapefile import convienence function

Inputs          
        study                   the study object        
        inshape                 fire perimeter polygon shapefile
        datefield               name of fire date field
        datetype                format of date field ( YYYY | YYYYMMDD )
        
Options (see named option functions for specifics)
        count                   create summary rasters (count,min,max,range) 
        pointinterval   Compute the previous fire date for datagrid
        extract                 Extract the case history data (rasters) 
        adddates                add unique dates to study
        exporttable             export the point-event table
        
This function first calls preparation function  to copy, standardize 
and intersect overlapping fires. Then all the option functions 
except for extract are called. The extract function is called after 
all the data is imported and any additional sample dates are added 
to the date list using option [adddates=True].

Extract(study, varname)

source code 
Extract Case History Data from a Fire Perimeter Series

This Function takes an imported fire perimeter polygon history
and extracts three reserved data variable names for each point
and date combination in the study. This means there should only
be one fire history imported into a study. Previous data will be
overwritten with a second call to extract.

Input
        study   study object
        varname name of the source variable ("FIRE")

Output: (none) Adds paths to data files to study variables list
        BURN    Fire occurs during [Start < FireDate <= End]
        SAGE    Time since fire at SDATE (0 if fire on SDATE)
        EAGE    Time since fire at EDATE (pre-fire tsf if BURN is 1)
        
                

PrepFirePerims(study, inshape, datefield, datetype, varname='FIRE', adddates=True)

source code 
Prepare / Import the input fire perimeter history.

Inputs
        Input variables defined in ImportFirePerims() 
        
Procedure
                
        Create data directory at StudyDir/FIRE 
        Copy perimeter shapefile to [datashp] 
        Copy and convert date field to EVTDATE 
        Add study area polygons at [startdate] and [enddate]
        Intersect [datashp] * [pointgrid] -> [rawdatagrid]
        adddates add fire occurrence dates to study dates 

Outputs
        datashape.shp   Fire perimeter shapefile
        datagrid.shp    Fire occurrence point grid
        
        

FireCountRaster(rawdatagrid, cellsize)

source code 
Compute rasters summarizing the period [start <= t < end]

Inputs
        rawdatagrid             fire point grid
        cellsize                output cellsize

Outputs: rasters of the same size as studyarea giving
        count   : count of fires
        min             : first fire 
        max     : last fire
        range   : max - min
        meanint : [(count-1) / (max-min)]  

PopulatePointIntervals(datagrid)

source code 

Populate the fire points with the data about the previous fire

PREVSTATE : Id number of previous fire PREVDATE : date of previous fire

ExtractBurn(datagrid, sdates, edates, cellsize)

source code 

Extract fire occurrence rasters for each sample period

BURN = (0|1) Fire occurs during [SDATE < t <= EDATE]

ExtractTSF(datagrid, sdates, edates, cellsize)

source code 

Extract Time Since Fire for each sample period

SAGE = Time Since Fire at SDATE (0 for fires on SDATE) EAGE = Time Since Fire at EDATE (Age at Burn for fires on EDATE)

PrepFirePerims_X(workingdir, pointgrid, inshape, datefield, datetype, initshp=False, finshp=False)

source code 
Prepare / Import the input fire perimeter history.

Inputs
        Input variables defined in ImportFirePerims() 
        
Procedure
                
        Create data directory at StudyDir/FIRE 
        Copy perimeter shapefile to [datashp] 
        Copy and convert date field to EVTDATE 
        Add study area polygons at [startdate] and [enddate]
        Intersect [datashp] * [pointgrid] -> [rawdatagrid]
        adddates add fire occurrence dates to study dates 

Outputs
        datashape.shp   Fire perimeter shapefile
        datagrid.shp    Fire occurrence point grid