Created: Tuesday 31 January 2017 github.com/rhyswhitley/fire_limitation


Quantifying the uncertainity of a global fire limitation model using Bayesian inference

Part 3: Data visualisation



1,* Douglas Kelley, 2 Ioannis Bistinas, 3, 4 Chantelle Burton, 1 Tobias Marthews, 5 Rhys Whitley


1 Centre for Ecology and Hydrology, Maclean Building, Crowmarsh Gifford, Wallingford, Oxfordshire, United Kingdom
2 Vrije Universiteit Amsterdam, Faculty of Earth and Life Sciences, Amsterdam, Netherlands
3 Met Office United Kingdom, Exeter, United Kingdom
4 Geography, University of Exeter, Exeter, United Kingdom
5 Natural Perils Pricing, Commercial & Consumer Portfolio & Pricing, Suncorp Group, Sydney, Australia

Load libraries


In [1]:
# data munging and analytical libraries 
import re
import os
import numpy as np
import pandas as pd

# graphical libraries
import matplotlib.pyplot as plt
import matplotlib.pylab as pylab

# default plot settings for notebook
from IPython.core.pylabtools import figsize
figsize(11, 9)
plt.style.use('ggplot')

%matplotlib inline

dataPath = "../data/globfire.csv"

Import data


In [2]:
DATAPATH = os.path.expanduser(dataPath)

fd = pd.read_csv(DATAPATH)

Function definitions


In [3]:
def ignition(lightning, pasture_area, pop_density, kp, kd1):
    """
    Definition for the measure of ignition
    """
    return lightning + kp*pasture_area + kd1*pop_density

def supression(crop_area, pop_density, kd2):
    """
    Definition for the measure of fire supression
    """
    return crop_area + kd2*pop_density

def np_sigmoid(x, a, b):
    """
    Sigmoid function to describe limitation using tensor
    """
    return 1.0/(1.0 + np.exp(a*x + b))

Extra model covariates determined

Determine the ignition and supression covariates as per the model documentation


In [4]:
fd['ignite'] = ignition(fd["lightning_ignitions"].values, \
               fd["pasture"].values, \
               fd["population_density"].values, \
               500, 10)

fd['suppress'] = supression(fd["cropland"].values, \
                 fd["population_density"].values, \
                 10)

Data viz below

Base Data


In [5]:
def pltVsFire(x, xlab):
    plt.plot(x, fd.fire, 'o', alpha = 0.01)
    plt.ylabel("Burnt area fraction")
    plt.xlabel(xlab);

In [6]:
pltVsFire(fd.NPP, "NPP weight per area");
plt.xscale('log')



In [7]:
pltVsFire(fd.alpha, "Alpha")



In [8]:
pltVsFire(fd.lightning_ignitions, "lightning strikes")
plt.xscale('log')



In [9]:
pltVsFire(fd.cropland, "Crop cover")


Secondary Data


In [10]:
pltVsFire(fd.pasture, "Pasture")



In [11]:
pltVsFire(fd.population_density, "Population Density")
plt.xscale('log')



In [ ]: