In [2]:
import utils as ut
from pint import UnitRegistry
import pandas as pd
from ggplot import *
import seaborn as sns
from tabulate import tabulate
from numpy import average as avg
import numpy as np


/Users/pete/src/fcat_biomass/lib/python2.7/site-packages/matplotlib/__init__.py:872: UserWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter.
  warnings.warn(self.msg_depr % (key, alt_key))

Some usefull functions and housekeeping

Initalize a sqlite database


In [3]:
sqdb = ut.sqlitedb('fcat_biomass')

Functions for


In [4]:
def distFromRange(total, maxr = 32, minr = 2):
    av = (maxr + minr)/2
    stdev = (float(maxr) - float(minr))/4 
    d_frac = (total-np.floor(total))*np.random.normal(av, stdev, 1).clip(min=0)[0]
    t_bdt = np.random.normal(av,stdev,np.floor(total)).clip(min=0)
    return np.append(t_bdt, d_frac)

In [5]:
def sumFromDist(total, maxr = 0.32, minr = 0.02):
    av = (maxr + minr)/2
    stdev = (float(maxr) - float(minr))/4 
    d_frac = (total-np.floor(total))*np.random.normal(av, stdev, 1).clip(min=0)[0]
    t_bdt = np.sum(np.random.normal(av,stdev,np.floor(total)).clip(min=0))
    return (d_frac+t_bdt)

Black Carbon from pile burning

The CARB criteria pollutant emissions inventory reports Particualte Matter (PM 2.5) emissions from anthropogenic buring of forest residuals. The following estimates elemental carbon (Black Carbon) based on empirically derived relationships between PM2.5 and EC from.

  1. Ward DE, Hardy CC. Organic and elemental profiles for smoke from prescribed fires. In: Watson JG, editor. International specialty conference of the Air and Waste Management Association [Internet]. San Francisco: Air and Waste Management Association; 1989. Available from: http://www.frames.gov/documents/smoke/serdp/ward_hardy_1989a.pdf

In [33]:
ward = ut.gData('13UQtRfNBSJ81PXxbYSnB2LrjHePNcvhJhrsxRBjHpoY', 475419971)
#Units are ratio of EC to PM produced 
wardDF = ward[['source','pct_sm','pct_f','tc_f_est','tc_f_cv','tc_s_est','tc_s_cv','ec_f_est','ec_f_cv', 'ec_s_est','ec_s_cv','ecton-1_h_pm','ecton-1_l_pm']].transpose()
wardDF.columns = wardDF.iloc[0]
eFact = wardDF.to_dict()
d = dict(zip([eFact[i]['source'] for i in eFact.keys()],['ALL VEGETATION','WILDLAND FIRE USE (WFU)','FOREST MANAGEMENT']))
for k in eFact.keys():
    eFact[k]['arblink'] = d[k]
pd.DataFrame.from_dict(eFact).transpose().to_sql('bc_pm_ratio', sqdb['cx'], if_exists= 'replace')
#print tabulate(pd.DataFrame.from_dict(eFact).transpose(), headers = ['CARB CPE Cat.','BC/t PM 2.5 (high)','BC/t PM 2.5 (low)', 'Source'], tablefmt="pipe")
pd.DataFrame.from_dict(eFact).transpose()


Out[33]:
arblink ec_f_cv ec_f_est ec_s_cv ec_s_est ecton-1_h_pm ecton-1_l_pm pct_f pct_sm source tc_f_cv tc_f_est tc_s_cv tc_s_est
Pile Burn FOREST MANAGEMENT 0.45 0.082 0.49 0.029 0.0078985 0.0047115 0.9 0.1 Pile Burn 0.09 0.572 0.01 0.56
Prescribed WILDLAND FIRE USE (WFU) 0.5833 0.1267 0.29 0.034 0.150954 0.0517122 0.5 0.5 Prescribed 0.0733 0.6327 0.08 0.616
Wildfire ALL VEGETATION 0.4467 0.0962 0.338 0.0367 0.185961 0.0637042 0.3 0.7 Wildfire 0.0867 0.6102 0.06 0.623

In [34]:
pd.DataFrame.from_dict(eFact)


Out[34]:
Pile Burn Prescribed Wildfire
arblink FOREST MANAGEMENT WILDLAND FIRE USE (WFU) ALL VEGETATION
ec_f_cv 0.45 0.5833 0.4467
ec_f_est 0.082 0.1267 0.0962
ec_s_cv 0.49 0.29 0.338
ec_s_est 0.029 0.034 0.0367
ecton-1_h_pm 0.0078985 0.150954 0.185961
ecton-1_l_pm 0.0047115 0.0517122 0.0637042
pct_f 0.9 0.5 0.3
pct_sm 0.1 0.5 0.7
source Pile Burn Prescribed Wildfire
tc_f_cv 0.09 0.0733 0.0867
tc_f_est 0.572 0.6327 0.6102
tc_s_cv 0.01 0.08 0.06
tc_s_est 0.56 0.616 0.623

In [35]:
ward


Out[35]:
source mg pct_sm pct_f pm2.5_sm pm2.5_f tc_f_est tc_f_cv tc_s_est tc_s_cv ... ec_sm_l(kg) ec_sm_h ec_f_l ec_f_h sumec_l sumec_h ecton-1_l_biomass ecton-1_h_biomass ecton-1_l_pm ecton-1_h_pm
0 Pile Burn 10 0.1 0.9 4 36.0 0.5720 0.0900 0.560 0.01 ... 0.0592 0.1728 0.1293 0.1431 0.1885 0.3159 0.0188 0.0316 0.004712 0.007898
1 Prescribed 10 0.5 0.5 70 35.0 0.6327 0.0733 0.616 0.08 ... 1.7061 3.0539 3.7237 12.7964 5.4298 15.8502 0.5430 1.5850 0.051712 0.150954
2 Wildfire 10 0.7 0.3 96 20.9 0.6102 0.0867 0.623 0.06 ... 2.3407 4.1896 5.1085 17.5554 7.4491 21.7450 0.7449 2.1745 0.063704 0.185961

3 rows × 24 columns


In [36]:
ec_rat_table = pd.DataFrame([ward.source, ward.tc_f_est*ward.ec_f_est, ward.tc_f_cv, ward.ec_f_cv,ward.tc_s_est*ward.ec_s_est, ward.tc_s_cv, ward.ec_s_cv]).transpose()
ec_rat_table.to_sql('ec_ratios', sqdb['cx'], if_exists = 'replace')

In [37]:
ec_rat_table


Out[37]:
source Unnamed 0 tc_f_cv ec_f_cv Unnamed 1 tc_s_cv ec_s_cv
0 Pile Burn 0.046904 0.09 0.45 0.01624 0.01 0.49
1 Prescribed 0.0801631 0.0733 0.5833 0.020944 0.08 0.29
2 Wildfire 0.0587012 0.0867 0.4467 0.0228641 0.06 0.338

In [38]:
print tabulate(ec_rat_table, headers = ['Source',
                                        'BC/t PM 2.5 (F, est.)',
                                        'TC/t PM 2.5 (F, CV)',
                                        'BC/t TC (F, CV)',
                                        'BC/t PM 2.5 (S, est.)',
                                        'TC/t PM 2.5 (S, CV)',
                                        'BC/t TC (S, CV)'], tablefmt="pipe")


|    | Source     |   BC/t PM 2.5 (F, est.) |   TC/t PM 2.5 (F, CV) |   BC/t TC (F, CV) |   BC/t PM 2.5 (S, est.) |   TC/t PM 2.5 (S, CV) |   BC/t TC (S, CV) |
|---:|:-----------|------------------------:|----------------------:|------------------:|------------------------:|----------------------:|------------------:|
|  0 | Pile Burn  |               0.046904  |                0.09   |            0.45   |               0.01624   |                  0.01 |             0.49  |
|  1 | Prescribed |               0.0801631 |                0.0733 |            0.5833 |               0.020944  |                  0.08 |             0.29  |
|  2 | Wildfire   |               0.0587012 |                0.0867 |            0.4467 |               0.0228641 |                  0.06 |             0.338 |

In [39]:
ecPct = ward[['ec_f_est', 'pct_f','pct_sm','tc_f_est','tc_f_cv','tc_s_est','tc_s_cv','ec_f_cv','ec_s_est', 'ec_s_cv']].set_index(ward.source).to_dict('index')

Black Carbon Global Warming Potential

Several estimates exist for the GWP of Black Carbon. We use GWP20 estimates for black carbon from the CARB Short-Lived Climate Pollutant Strategy and from Fuglestvedt et. al 2000.

References

  1. California Air Resources Board. Short Lived Climate Pollutant Reduction Strategy. Sacramento, CA; 2015.
  2. Fuglestvedt JS, Berntsen TK, Godal O, Skodvin T. Climate implications of GWP-based reductions in greenhouse gas emissions. Geophys Res Lett [Internet]. 2000 Feb 1 [cited 2015 Sep 5];27(3):409–12. Available from: http://doi.wiley.com/10.1029/1999GL010939

In [40]:
bc_gwp = ut.gData('13UQtRfNBSJ81PXxbYSnB2LrjHePNcvhJhrsxRBjHpoY', 195715938)
bc_gwp.to_sql('bc_gwp', sqdb['cx'], if_exists = 'replace')
#print tabulate(bc_gwp.drop('est_id', 1), headers = [i for i in bc_gwp.drop('est_id', 1).columns],tablefmt="pipe")
bc_gwp = bc_gwp.set_index(bc_gwp.est_id).drop('est_id',1)

In [41]:
bc_gwp


Out[41]:
gwp_20 gwp_20_std gwp_100 gwp_100_std gwp_500 gwp_500_std source
est_id
fug_meta 2200 888.82 633.33 255.41 193.33 77.67 Fuglestvedt2010
carb_slcp 3200 NaN 900.00 NaN NaN NaN CaliforniaAirResourcesBoard2015

CARB Criteria Air Pollutant (CPE) emissions data 2015

Particulate Matter, Carbon Monoxide, Nitrogen Oxide, Sulfur Dioxide, Lead, and Reactive Organic Gases


In [43]:
cpe_data = pd.read_csv('http://www.arb.ca.gov/app/emsinv/2013/emsbyeic.csv?F_YR=2015&F_DIV=0&F_SEASON=A&SP=2013&SPN=2013_Almanac&F_AREA=CA')
cpe_data.columns = [i.lower() for i in cpe_data.columns]
cpe_data.to_sql('cpe_2015', sqdb['cx'], if_exists = 'replace')
cpe_2015 = pd.read_sql('''SELECT
                                eicsoun,
                                pm.source type,
                                pm2_5 pm25_tpd,
                                pm2_5*365*"ecton-1_h_pm" as t_ec_high,
                                pm2_5*365*"ecton-1_l_pm" as t_ec_low,
                                pm2_5*365*"ecton-1_h_pm"*gwp_20 as co2e_high,
                                pm2_5*365*"ecton-1_l_pm"*gwp_20 as co2e_low,
                                pm2_5*365*"ecton-1_l_pm"*(gwp_20-gwp_20_std) as co2e20_low_m1std,
                                pm2_5*365*"ecton-1_l_pm"*(gwp_20+gwp_20_std) as co2e20_low_p1std,
                                pm2_5*365*"ecton-1_h_pm"*(gwp_20-gwp_20_std) as co2e20_hi_m1std,
                                pm2_5*365*"ecton-1_h_pm"*(gwp_20+gwp_20_std) as co2e20_hi_p1std,
                                pm2_5*365*"ecton-1_l_pm"*(gwp_100-gwp_100_std) as co2e100_low_m1std,
                                pm2_5*365*"ecton-1_l_pm"*(gwp_100+gwp_100_std) as co2e100_low_p1std,
                                pm2_5*365*"ecton-1_h_pm"*(gwp_100-gwp_100_std) as co2e100_hi_m1std,
                                pm2_5*365*"ecton-1_h_pm"*(gwp_100+gwp_100_std) as co2e100_hi_p1std,
                                gwp.source
                            FROM cpe_2015
                            JOIN bc_pm_ratio pm  on  (arblink = eicsoun)
                            CROSS JOIN bc_gwp gwp 
                            WHERE eicsoun in ('FOREST MANAGEMENT','WILDLAND FIRE USE (WFU)','ALL VEGETATION')''',
            con = sqdb['cx'])

foo = pd.melt(cpe_2015.drop('eicsoun',1), id_vars = ['type', 'source'])
bar = foo[foo['variable'].str.contains("co2e")].dropna()
bar['type'] = bar.type.astype('category')
bar.value = bar.value

Make the BC GHG emissions plot

A secondary apporoach based on Ward (1989) and Jenkins (1996) uses a range of 2-32% of PM as BC.

  1. Jenkins BM, Turn SQ, Williams RB, Goronea M, Abd-el-Fattah H, Mehlschau J, et al. Atmospheric Pollutant Emissions Factors From Open Burning of Agricultural and Forest Biomass By Wind Tunnel Simulations [Internet]. Sacramento, CA; 1996. Available from: http://www.arb.ca.gov/ei/speciate/r01t20/rf9doc/refnum9.htm

In [50]:
pm2015=pd.read_sql('''select eicsoun,
                    pm2_5*365 as pm25
                from cpe_2015
                WHERE eicsoun in ('FOREST MANAGEMENT','WILDLAND FIRE USE (WFU)','ALL VEGETATION');''', con = sqdb['cx'])
pm2015=pm2015.set_index([['Wildfire','Pile Burn','Prescribed']])

In [51]:
pm2015


Out[51]:
eicsoun pm25
Wildfire ALL VEGETATION 137630.1485
Pile Burn FOREST MANAGEMENT 5480.5115
Prescribed WILDLAND FIRE USE (WFU) 6802.4320

In [52]:
def ecDist(ecEst, ecCV, PM):
    '''
    PM is a mass measure, its intended to be PM2.5
    ecEst is the estimate of the percentage of elemental carbon comprising the PM
    ecCV is the coefficient of variation around the estimate of elemental carbon
    -----
    returns a random selection from a normal distribution of size `len(pm)`
    centered on `ecEst` with standard deviation of `ecCV`*`ecEst`
    '''
    ecStdev = ecCV * ecEst
#    ec_frac = (PM-np.floor(PM))*np.random.normal(ecEst, ecStdev, 1).clip(min=0)[0]
    t_ec = np.random.normal(ecEst,ecStdev,PM).clip(min=0)#+ec_frac
    return t_ec #+ ec_frac

In [62]:
ecPct


Out[62]:
{'Pile Burn': {'ec_f_cv': 0.45000000000000001,
  'ec_f_est': 0.082000000000000003,
  'ec_s_cv': 0.48999999999999999,
  'ec_s_est': 0.029000000000000001,
  'ec_tdist':              0             1           2               3
  0    Pile Burn    Pile Burn0  344.615617  1102769.972953
  1    Pile Burn    Pile Burn1  345.859437  1106750.198271
  2    Pile Burn    Pile Burn2  346.859859  1109951.550164
  3    Pile Burn    Pile Burn3  344.935345  1103793.103990
  4    Pile Burn    Pile Burn4  348.652037  1115686.518376
  5    Pile Burn    Pile Burn5  346.737199  1109559.036798
  6    Pile Burn    Pile Burn6  344.157385  1101303.633148
  7    Pile Burn    Pile Burn7  348.139823  1114047.434495
  8    Pile Burn    Pile Burn8  347.490532  1111969.701482
  9    Pile Burn    Pile Burn9  347.108534  1110747.309904
  10   Pile Burn   Pile Burn10  346.541318  1108932.217222
  11   Pile Burn   Pile Burn11  347.602412  1112327.718403
  12   Pile Burn   Pile Burn12  344.472975  1102313.518443
  13   Pile Burn   Pile Burn13  347.225434  1111121.388644
  14   Pile Burn   Pile Burn14  345.123718  1104395.897903
  15   Pile Burn   Pile Burn15  346.622410  1109191.713195
  16   Pile Burn   Pile Burn16  349.083937  1117068.597747
  17   Pile Burn   Pile Burn17  346.851451  1109924.644694
  18   Pile Burn   Pile Burn18  348.750606  1116001.938464
  19   Pile Burn   Pile Burn19  342.964412  1097486.119667
  20   Pile Burn   Pile Burn20  346.177099  1107766.718047
  21   Pile Burn   Pile Burn21  347.792843  1112937.098734
  22   Pile Burn   Pile Burn22  342.478305  1095930.575148
  23   Pile Burn   Pile Burn23  345.742083  1106374.665108
  24   Pile Burn   Pile Burn24  347.757403  1112823.689933
  25   Pile Burn   Pile Burn25  345.688461  1106203.075236
  26   Pile Burn   Pile Burn26  347.970159  1113504.510157
  27   Pile Burn   Pile Burn27  345.532698  1105704.635191
  28   Pile Burn   Pile Burn28  347.473065  1111913.807457
  29   Pile Burn   Pile Burn29  345.933407  1106986.903225
  ..         ...           ...         ...             ...
  970  Pile Burn  Pile Burn970  348.802589  1116168.284822
  971  Pile Burn  Pile Burn971  349.062619  1117000.382060
  972  Pile Burn  Pile Burn972  343.847517  1100312.055105
  973  Pile Burn  Pile Burn973  346.893369  1110058.781514
  974  Pile Burn  Pile Burn974  343.191622  1098213.191242
  975  Pile Burn  Pile Burn975  347.258013  1111225.640466
  976  Pile Burn  Pile Burn976  342.385940  1095635.007360
  977  Pile Burn  Pile Burn977  344.056011  1100979.235503
  978  Pile Burn  Pile Burn978  344.048659  1100955.710065
  979  Pile Burn  Pile Burn979  346.333184  1108266.189182
  980  Pile Burn  Pile Burn980  347.282302  1111303.365316
  981  Pile Burn  Pile Burn981  347.985401  1113553.284434
  982  Pile Burn  Pile Burn982  345.069132  1104221.221056
  983  Pile Burn  Pile Burn983  344.004736  1100815.154885
  984  Pile Burn  Pile Burn984  347.502741  1112008.771095
  985  Pile Burn  Pile Burn985  351.329916  1124255.730614
  986  Pile Burn  Pile Burn986  345.473359  1105514.748840
  987  Pile Burn  Pile Burn987  349.464981  1118287.939488
  988  Pile Burn  Pile Burn988  346.502780  1108808.897537
  989  Pile Burn  Pile Burn989  347.960401  1113473.281717
  990  Pile Burn  Pile Burn990  347.871290  1113188.129370
  991  Pile Burn  Pile Burn991  345.762416  1106439.731755
  992  Pile Burn  Pile Burn992  348.685060  1115792.192565
  993  Pile Burn  Pile Burn993  346.040157  1107328.501189
  994  Pile Burn  Pile Burn994  347.987980  1113561.534666
  995  Pile Burn  Pile Burn995  345.890216  1106848.691997
  996  Pile Burn  Pile Burn996  348.706937  1115862.198143
  997  Pile Burn  Pile Burn997  347.741253  1112772.008009
  998  Pile Burn  Pile Burn998  347.515686  1112050.195616
  999  Pile Burn  Pile Burn999  347.536681  1112117.379402
  
  [1000 rows x 4 columns],
  'pct_f': 0.90000000000000002,
  'pct_sm': 0.10000000000000001,
  'pm_f': 4932.4603500000003,
  'pm_sm': 548.05115000000012,
  't_pm': 5480.5115000000005,
  'tc_f': 2821.3673202,
  'tc_f_cv': 0.089999999999999997,
  'tc_f_est': 0.57199999999999995,
  'tc_s_cv': 0.01,
  'tc_s_est': 0.56000000000000005,
  'tc_sm': 306.90864400000009},
 'Prescribed': {'ec_f_cv': 0.58330000000000004,
  'ec_f_est': 0.12670000000000001,
  'ec_s_cv': 0.28999999999999998,
  'ec_s_est': 0.034000000000000002,
  'ec_tdist':               0              1           2               3
  0    Prescribed    Prescribed0  697.666717  2232533.494271
  1    Prescribed    Prescribed1  696.276026  2228083.283034
  2    Prescribed    Prescribed2  691.487079  2212758.651557
  3    Prescribed    Prescribed3  700.139484  2240446.347459
  4    Prescribed    Prescribed4  687.453564  2199851.405210
  5    Prescribed    Prescribed5  694.234515  2221550.449269
  6    Prescribed    Prescribed6  689.449531  2206238.498597
  7    Prescribed    Prescribed7  695.213973  2224684.712688
  8    Prescribed    Prescribed8  692.691776  2216613.682488
  9    Prescribed    Prescribed9  698.034470  2233710.304201
  10   Prescribed   Prescribed10  696.658842  2229308.295143
  11   Prescribed   Prescribed11  689.023080  2204873.856421
  12   Prescribed   Prescribed12  690.575749  2209842.396104
  13   Prescribed   Prescribed13  691.924902  2214159.685654
  14   Prescribed   Prescribed14  691.928530  2214171.295708
  15   Prescribed   Prescribed15  689.939626  2207806.802107
  16   Prescribed   Prescribed16  687.529211  2200093.474044
  17   Prescribed   Prescribed17  695.882372  2226823.589174
  18   Prescribed   Prescribed18  688.694743  2203823.178846
  19   Prescribed   Prescribed19  689.646179  2206867.773655
  20   Prescribed   Prescribed20  692.516679  2216053.371481
  21   Prescribed   Prescribed21  696.739953  2229567.849006
  22   Prescribed   Prescribed22  695.553346  2225770.707052
  23   Prescribed   Prescribed23  698.296281  2234548.097991
  24   Prescribed   Prescribed24  692.687134  2216598.829203
  25   Prescribed   Prescribed25  694.818333  2223418.664694
  26   Prescribed   Prescribed26  691.881518  2214020.856346
  27   Prescribed   Prescribed27  695.726247  2226323.988941
  28   Prescribed   Prescribed28  690.750929  2210402.972815
  29   Prescribed   Prescribed29  680.329456  2177054.259584
  ..          ...            ...         ...             ...
  970  Prescribed  Prescribed970  695.244720  2224783.104133
  971  Prescribed  Prescribed971  695.275192  2224880.613382
  972  Prescribed  Prescribed972  687.528986  2200092.756067
  973  Prescribed  Prescribed973  691.293245  2212138.385491
  974  Prescribed  Prescribed974  697.870302  2233184.965837
  975  Prescribed  Prescribed975  694.477046  2222326.547568
  976  Prescribed  Prescribed976  689.233034  2205545.708338
  977  Prescribed  Prescribed977  692.134999  2214831.995324
  978  Prescribed  Prescribed978  695.993693  2227179.817088
  979  Prescribed  Prescribed979  684.050395  2188961.264081
  980  Prescribed  Prescribed980  694.831907  2223462.103049
  981  Prescribed  Prescribed981  692.036937  2214518.198030
  982  Prescribed  Prescribed982  697.914904  2233327.691365
  983  Prescribed  Prescribed983  692.390170  2215648.543789
  984  Prescribed  Prescribed984  690.595101  2209904.322967
  985  Prescribed  Prescribed985  691.086470  2211476.705151
  986  Prescribed  Prescribed986  698.725827  2235922.646764
  987  Prescribed  Prescribed987  694.965130  2223888.415643
  988  Prescribed  Prescribed988  691.165930  2211730.975046
  989  Prescribed  Prescribed989  690.814925  2210607.759000
  990  Prescribed  Prescribed990  693.272073  2218470.632307
  991  Prescribed  Prescribed991  693.103762  2217932.037296
  992  Prescribed  Prescribed992  696.394308  2228461.786897
  993  Prescribed  Prescribed993  688.067237  2201815.157428
  994  Prescribed  Prescribed994  695.431745  2225381.582648
  995  Prescribed  Prescribed995  692.554181  2216173.379535
  996  Prescribed  Prescribed996  696.260458  2228033.467152
  997  Prescribed  Prescribed997  690.786541  2210516.932615
  998  Prescribed  Prescribed998  694.679472  2222974.309830
  999  Prescribed  Prescribed999  695.511767  2225637.654164
  
  [1000 rows x 4 columns],
  'pct_f': 0.5,
  'pct_sm': 0.5,
  'pm_f': 3401.2160000000003,
  'pm_sm': 3401.2160000000003,
  't_pm': 6802.4320000000007,
  'tc_f': 2151.9493632000003,
  'tc_f_cv': 0.073300000000000004,
  'tc_f_est': 0.63270000000000004,
  'tc_s_cv': 0.080000000000000002,
  'tc_s_est': 0.61599999999999999,
  'tc_sm': 2095.1490560000002},
 'Wildfire': {'ec_f_cv': 0.44669999999999999,
  'ec_f_est': 0.096199999999999994,
  'ec_s_cv': 0.33800000000000002,
  'ec_s_est': 0.036700000000000003,
  'ec_tdist':             0            1             2                3
  0    Wildfire    Wildfire0  11242.399341  35975677.890948
  1    Wildfire    Wildfire1  11235.758199  35954426.236052
  2    Wildfire    Wildfire2  11237.513239  35960042.366026
  3    Wildfire    Wildfire3  11221.456295  35908660.144811
  4    Wildfire    Wildfire4  11231.379454  35940414.252384
  5    Wildfire    Wildfire5  11244.439061  35982204.994930
  6    Wildfire    Wildfire6  11234.253763  35949612.043147
  7    Wildfire    Wildfire7  11240.897710  35970872.670708
  8    Wildfire    Wildfire8  11249.866366  35999572.372488
  9    Wildfire    Wildfire9  11239.049103  35964957.129329
  10   Wildfire   Wildfire10  11235.084897  35952271.670341
  11   Wildfire   Wildfire11  11260.463845  36033484.304947
  12   Wildfire   Wildfire12  11248.955621  35996657.986700
  13   Wildfire   Wildfire13  11231.111789  35939557.725859
  14   Wildfire   Wildfire14  11243.389480  35978846.334468
  15   Wildfire   Wildfire15  11230.583217  35937866.294565
  16   Wildfire   Wildfire16  11243.427016  35978966.450234
  17   Wildfire   Wildfire17  11246.335498  35988273.593548
  18   Wildfire   Wildfire18  11235.163067  35952521.813949
  19   Wildfire   Wildfire19  11244.802971  35983369.507440
  20   Wildfire   Wildfire20  11255.606473  36017940.714334
  21   Wildfire   Wildfire21  11241.045082  35971344.263962
  22   Wildfire   Wildfire22  11239.387837  35966041.079866
  23   Wildfire   Wildfire23  11239.837007  35967478.420909
  24   Wildfire   Wildfire24  11240.643369  35970058.781852
  25   Wildfire   Wildfire25  11234.759222  35951229.511054
  26   Wildfire   Wildfire26  11240.732770  35970344.865276
  27   Wildfire   Wildfire27  11266.132751  36051624.802719
  28   Wildfire   Wildfire28  11247.028527  35990491.287400
  29   Wildfire   Wildfire29  11240.814633  35970606.825275
  ..        ...          ...           ...              ...
  970  Wildfire  Wildfire970  11245.724486  35986318.354290
  971  Wildfire  Wildfire971  11221.019360  35907261.953120
  972  Wildfire  Wildfire972  11225.401245  35921283.985042
  973  Wildfire  Wildfire973  11220.798085  35906553.870928
  974  Wildfire  Wildfire974  11242.961040  35977475.328015
  975  Wildfire  Wildfire975  11253.291167  36010531.735063
  976  Wildfire  Wildfire976  11246.136808  35987637.786969
  977  Wildfire  Wildfire977  11239.443193  35966218.217879
  978  Wildfire  Wildfire978  11240.586727  35969877.526648
  979  Wildfire  Wildfire979  11243.512736  35979240.754398
  980  Wildfire  Wildfire980  11242.676459  35976564.667668
  981  Wildfire  Wildfire981  11243.251258  35978404.025852
  982  Wildfire  Wildfire982  11231.701579  35941445.051575
  983  Wildfire  Wildfire983  11242.795310  35976944.991429
  984  Wildfire  Wildfire984  11246.533553  35988907.369386
  985  Wildfire  Wildfire985  11256.746800  36021589.761439
  986  Wildfire  Wildfire986  11239.297229  35965751.133500
  987  Wildfire  Wildfire987  11235.287857  35952921.142610
  988  Wildfire  Wildfire988  11263.715231  36043888.740587
  989  Wildfire  Wildfire989  11251.112355  36003559.534576
  990  Wildfire  Wildfire990  11251.568963  36005020.681089
  991  Wildfire  Wildfire991  11248.763642  35996043.655207
  992  Wildfire  Wildfire992  11242.770376  35976865.204762
  993  Wildfire  Wildfire993  11236.450469  35956641.499767
  994  Wildfire  Wildfire994  11247.085693  35990674.218528
  995  Wildfire  Wildfire995  11248.033370  35993706.783546
  996  Wildfire  Wildfire996  11232.079487  35942654.358945
  997  Wildfire  Wildfire997  11261.423072  36036553.830555
  998  Wildfire  Wildfire998  11231.329832  35940255.462520
  999  Wildfire  Wildfire999  11256.372536  36020392.114391
  
  [1000 rows x 4 columns],
  'pct_f': 0.29999999999999999,
  'pct_sm': 0.69999999999999996,
  'pm_f': 41289.044549999991,
  'pm_sm': 96341.103949999975,
  't_pm': 137630.14849999998,
  'tc_f': 25194.574984409992,
  'tc_f_cv': 0.086699999999999999,
  'tc_f_est': 0.61019999999999996,
  'tc_s_cv': 0.059999999999999998,
  'tc_s_est': 0.623,
  'tc_sm': 60020.507760849985}}

In [54]:
for k in ecPct.keys():
    pm = pm2015.loc[k]['pm25']
    ecPct[k]['t_pm'] = pm
    #PM2.5 smoldering 
    pm_sm = ecPct[k]['pct_sm']*pm
    ecPct[k]['pm_sm'] = pm_sm
    #TC smoldering
    tc_sm = ecPct[k]['tc_s_est']*pm_sm
    ecPct[k]['tc_sm'] = tc_sm
    #PM2.5 flaming
    pm_f = ecPct[k]['pct_f']*pm
    ecPct[k]['pm_f'] = pm_f
    #TC flaming
    tc_f = ecPct[k]['tc_f_est']*pm_f
    ecPct[k]['tc_f'] = tc_f
    res1k = []
    for t in range(1000):
        rnd = t
        # Total Carbon in PM
        tc_s = ecDist(ecPct[k]['tc_s_est'], ecPct[k]['tc_s_cv'], pm)
        tc_f = ecDist(ecPct[k]['tc_f_est'], ecPct[k]['tc_f_cv'], pm)
        #Elemental Carbon in Total Carbon
        ec_s = ecDist(ecPct[k]['ec_s_est'], ecPct[k]['ec_s_cv'], pm)
        ec_f = ecDist(ecPct[k]['ec_f_est'], ecPct[k]['ec_f_cv'], pm)
        ec1tpm = (tc_s*ec_s) + (tc_f*ec_f)
        ec_total_rnd = sum(ec1tpm)
        ec_total_gwp = ec_total_rnd * bc_gwp.loc['carb_slcp']['gwp_20']
        res1k.append([k,k+str(rnd),ec_total_rnd, ec_total_gwp])
    ecPct[k]['ec_tdist'] = pd.DataFrame(res1k)
    #ecPct[k]['ecSMDist'] = np.array([(ecDist(ecPct[k]['ec_s_est'], ecPct[k]['ec_s_cv'], pm)) for i in range(1000)])
    #ecPct[k]['ecFDist'] = np.array([(ecDist(ecPct[k]['ec_f_est'], ecPct[k]['ec_f_cv'], pm)) for i in range(1000)])
    #ecPct[k]['tECDist'] = ecPct[k]['ecSMDist']+ecPct[k]['ecFDist']
    #ecPct[k]['df'] = pd.DataFrame(np.column_stack((ecPct[k]['tECDist'], [k]*len(ecPct[k]['tECDist']))))

In [56]:
ecPct['Prescribed']['tc_f']


Out[56]:
2151.9493632000003

In [57]:
(pm_sm*0.2*3200)+(pm_f*0.2*3200)


Out[57]:
3507527.3600000003

In [58]:
df=pd.concat([ecPct[i]['ec_tdist'] for i in ecPct.keys()])
df.columns = ['source', 'sourcernd', 'mt_ec','co2e_ec']

In [59]:
t=sns.FacetGrid(df,col='source', sharey=False)
t.map(sns.boxplot, 'source','co2e_ec')
t.set_ylabels('t $CO_2e$')
[c.xaxis.set_visible(False) for c in t.axes[0]]
sns.plt.subplots_adjust(top = 0.8)
t.fig.suptitle('Black carbon emissions in CO2 equivalent units from burning in CA, 2015', fontsize= 15)
t.fig.text(0.1, -0.08,'''Sources: CARB Criteria Pollutant Emissions Inventory(2015), Ward and Hardy (1989)''',
      fontsize=10)
for f in ['.png','.pdf']:
    t.savefig('graphics/bc_prob_gwp{0}'.format(f))


/Users/pete/src/fcat_biomass/lib/python2.7/site-packages/matplotlib/__init__.py:892: UserWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter.
  warnings.warn(self.msg_depr % (key, alt_key))

In [61]:
122*0.66


Out[61]:
80.52000000000001

In [63]:
pd.read_csv('fera_pile_cemissions.csv', header=1)


Out[63]:
Group ID/Name Number of Piles Pile Type Pile Shape W1 (ft) H1 (ft) L1 (ft) W2 (ft) H2 (ft) L2 (ft) ... Adjusted Volume (ft^3) Pile Biomass (tons) Consumed Fuel (tons) PM (tons) PM10 (tons) PM2.5 (tons) CO (tons) CO2 (tons) CH4 (tons) NMHC (tons)
PileGroup1 1 1 Half sphere NaN 10 NaN NaN NaN NaN NaN ... 1007.169088 1.360178 1.224161 0.013405 0.009487 0.008263 0.046502 2.036643 0.003431 0.00277

1 rows × 32 columns

Forested Lands and Wood Products Biodegradable Carbon Emissions & Sinks (MMTCO2)

ARB (2007). Technical support document for Land Use, Land Use Change & Forestry - Biodegradable Carbon Emissions & Sinks. Table available as a pdf document at: http://www.arb.ca.gov/cc/inventory/archive/tables/net_co2_flux_2007-11-19.pdf


In [65]:
t=foo[foo['variable'].str.contains("co2e20")].dropna()
co2 = ut.gData('1GDdquzrCoq2cxVN2fbCpP4gwi2yrMnONNrWbfhZKZu4', 1636249481)
co2.columns = co2.iloc[0]
co2plot=pd.melt(co2.reindex(co2.index.drop(0)), id_vars = ['Year'])
co2plot.columns = ['sc_cat','year','mmtco2e']
co2plot.to_sql('arb_co2', sqdb['cx'], if_exists = 'replace')
cdata = pd.read_sql('''select sc_cat, avg(mmtco2e) from arb_co2 where sc_cat in ('Forest and rangeland fires', 'Timber harvest slash')  group by sc_cat''', con = sqdb['cx'])


---------------------------------------------------------------------------
DatabaseError                             Traceback (most recent call last)
<ipython-input-65-b5abc1eec5e0> in <module>()
      4 co2plot=pd.melt(co2.reindex(co2.index.drop(0)), id_vars = ['Year'])
      5 co2plot.columns = ['sc_cat','year','mmtco2e']
----> 6 co2plot.to_sql('arb_co2', sqdb['cx'], if_exists = 'replace')
      7 cdata = pd.read_sql('''select sc_cat, avg(mmtco2e) from arb_co2 where sc_cat in ('Forest and rangeland fires', 'Timber harvest slash')  group by sc_cat''', con = sqdb['cx'])

/Users/pete/src/fcat_biomass/lib/python2.7/site-packages/pandas/core/generic.pyc in to_sql(self, name, con, flavor, schema, if_exists, index, index_label, chunksize, dtype)
   1001             self, name, con, flavor=flavor, schema=schema, if_exists=if_exists,
   1002             index=index, index_label=index_label, chunksize=chunksize,
-> 1003             dtype=dtype)
   1004 
   1005     def to_pickle(self, path):

/Users/pete/src/fcat_biomass/lib/python2.7/site-packages/pandas/io/sql.pyc in to_sql(frame, name, con, flavor, schema, if_exists, index, index_label, chunksize, dtype)
    567     pandas_sql.to_sql(frame, name, if_exists=if_exists, index=index,
    568                       index_label=index_label, schema=schema,
--> 569                       chunksize=chunksize, dtype=dtype)
    570 
    571 

/Users/pete/src/fcat_biomass/lib/python2.7/site-packages/pandas/io/sql.pyc in to_sql(self, frame, name, if_exists, index, index_label, schema, chunksize, dtype)
   1631                             if_exists=if_exists, index_label=index_label,
   1632                             dtype=dtype)
-> 1633         table.create()
   1634         table.insert(chunksize)
   1635 

/Users/pete/src/fcat_biomass/lib/python2.7/site-packages/pandas/io/sql.pyc in create(self)
    687                 raise ValueError("Table '%s' already exists." % self.name)
    688             elif self.if_exists == 'replace':
--> 689                 self.pd_sql.drop_table(self.name, self.schema)
    690                 self._execute_create()
    691             elif self.if_exists == 'append':

/Users/pete/src/fcat_biomass/lib/python2.7/site-packages/pandas/io/sql.pyc in drop_table(self, name, schema)
   1652         escape = _SQL_GET_IDENTIFIER[self.flavor]
   1653         drop_sql = "DROP TABLE %s" % escape(name)
-> 1654         self.execute(drop_sql)
   1655 
   1656     def _create_sql_schema(self, frame, table_name, keys=None, dtype=None):

/Users/pete/src/fcat_biomass/lib/python2.7/site-packages/pandas/io/sql.pyc in execute(self, *args, **kwargs)
   1548 
   1549             ex = DatabaseError("Execution failed on sql '%s': %s" % (args[0], exc))
-> 1550             raise_with_traceback(ex)
   1551 
   1552     @staticmethod

/Users/pete/src/fcat_biomass/lib/python2.7/site-packages/pandas/io/sql.pyc in execute(self, *args, **kwargs)
   1537                 cur.execute(*args, **kwargs)
   1538             else:
-> 1539                 cur.execute(*args)
   1540             return cur
   1541         except Exception as exc:

DatabaseError: Execution failed on sql 'DROP TABLE "arb_co2"': database is locked

In [136]:
co2


Out[136]:
Year 1990.0 1991.0 1992.0 1993.0 1994.0 1995.0 1996.0 1997.0 1998.0 1999.0 2000.0 2001.0 2002.0 2003.0 2004.0
0 Year 1990.000 1991.000 1992.000 1993.000 1994.000 1995.000 1996.000 1997.000 1998.000 1999.000 2000.000 2001.000 2002.000 2003.000 2004.000
1 Forest and rangeland fires 2.032 2.028 2.025 2.022 2.018 2.018 2.018 2.018 2.018 2.018 2.018 2.017 2.015 2.014 2.012
2 Other disturbances 1.208 1.206 1.204 1.202 1.200 1.200 1.200 1.200 1.200 1.200 1.200 1.199 1.198 1.197 1.196
3 Development of forest or range lands (Landuse ... 0.021 0.021 0.021 0.021 0.021 0.021 0.021 0.021 0.021 0.021 0.021 0.021 0.021 0.021 0.021
4 Timber harvest slash 0.156 0.156 0.156 0.156 0.155 0.155 0.155 0.155 0.155 0.155 0.155 0.155 0.155 0.155 0.155

In [135]:
cdata
#Output GitHub Markdown using the following:
#print tabulate(cdata, headers = ['Source Category','MMTCO2'],tablefmt="pipe")


Out[135]:
sc_cat avg(mmtco2e)
0 Forest and rangeland fires 2.019400
1 Timber harvest slash 0.155267

GHG equivalent emissions from management residuals

To arrive at an estimate of total annual emissions from buring forest management residuals in CO2 equivalent terms from published CARB estimates we can combine the CO2 emissions reported for 2004 in the LULUC Biodegradable Carbon Emissions and Sinks with black carbon emissions extrapolated from the CARB Criteria Air Pollutant Emissions inventory estimates. The dime discreppancy between the 2004 and 2015 is acknowledged as an irreconcilable source of uncertainty in this estimation among others. This does however reflect that a baseline of substantial emissions from forest management residuals has been reported in CARB emissions inventories and should be recognized as a baseline condition.


In [64]:
t=foo[foo['variable'].str.contains("co2e20")].dropna()
tE = pd.DataFrame([cdata['avg(mmtco2e)'][1]*1.10231,
              avg(t[t['type'].str.contains('piles')]['value'])/1000000,
             (cdata['avg(mmtco2e)'][1]*1.10231)+(avg(t[t['type'].str.contains('piles')]['value'])/1000000)],columns = ['Mt CO2e'])
tE['Source']=['CO2 pile buring', 'CO2e BC pile burning', 'Total Mt CO2e']
tE.to_sql('pile_em', sqdb['cx'], if_exists = 'replace')


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-64-3646703ea2fa> in <module>()
      1 t=foo[foo['variable'].str.contains("co2e20")].dropna()
----> 2 tE = pd.DataFrame([cdata['avg(mmtco2e)'][1]*1.10231,
      3               avg(t[t['type'].str.contains('piles')]['value'])/1000000,
      4              (cdata['avg(mmtco2e)'][1]*1.10231)+(avg(t[t['type'].str.contains('piles')]['value'])/1000000)],columns = ['Mt CO2e'])
      5 tE['Source']=['CO2 pile buring', 'CO2e BC pile burning', 'Total Mt CO2e']

NameError: name 'cdata' is not defined

In [13]:
#print tabulate(tE, headers = tE.columns.tolist(), tablefmt ='pipe')
tE


Out[13]:
Mt CO2e Source
0 0.171152 CO2 pile buring
1 0.065169 CO2e BC pile burning
2 0.236321 Total Mt CO2e

Timber Products Output

The TPO estimates logging redisues produced from commercial timber harvesting operations.


In [14]:
tpoData = ut.gData('1GDdquzrCoq2cxVN2fbCpP4gwi2yrMnONNrWbfhZKZu4', 872275354, hrow=1)
tpoData


Out[14]:
ownership roundwoodproducts loggingresidues year
0 National Forest 72.4 20.7 2012
1 Other Public 16.2 3.4 2012
2 Forest Industry 328.9 72.4 2012
3 Other Private 53.0 11.2 2012
4 National Forest 52.8 16.3 2006
5 Other Public 1.1 0.3 2006
6 Forest Industry 274.3 59.6 2006
7 Other Private 139.2 33.2 2006
8 National Forest 90.8 22.6 2000
9 Other Public 5.2 1.6 2000
10 Forest Industry 372.5 70.6 2000
11 Other Private 159.4 49.1 2000
12 National Forest 132.1 11.2 1994
13 Other Public 24.7 4.3 1994
14 Forest Industry 396.1 63.1 1994
15 Other Private 174.7 22.3 1994

Biomass residuals from non-commercial management activities

Data from TPO does not account for forest management activities that do not result in commercial products (timber sales, biomass sales). To estimate the amount of residual material produced from non commercial management activities we use data from the US Forest Service (FACTS) and from CalFires timber harvest plan data.

Forest Service ACtivity Tracking System (FACTS)

Data from TPO does not account for forest management activities that do not result in commercial products (timber sales, biomass sales). We use a range of 10-35 BDT/acre to convert acres reported in FACTS to volume.


In [12]:
pd.read_excel('FACTS_Tabular_092115.xlsx', sheetname = 'CategoryCrosswalk').to_sql('facts_cat', sqdb['cx'], if_exists = 'replace')

In [13]:
pd.read_csv('pd/facts_notimber.csv').to_sql('facts_notimber', sqdb['cx'], if_exists='replace')

Querying FACTS

The USFS reports Hazardous Fuels Treatment (HFT) activities as well as Timber Sales (TS) derived from the FACTS database. We use these two datasets to estimate the number of acres treated that did not produce commercial material (sawlogs or biomass) and where burning was not used. The first step is to elimina all treatments in the HFT dataset that included timber sales. We accomplish this by eliminating all rows in the HFT dataset that have identical FACTS_ID fields in the TS dataset. We further filter the HFT dataset by removing any planned but not executed treatements (nbr_units1 >0 below -- nbr_units1 references NBR_UNITS_ACCOMPLISHED in the USFS dataset, see metadata for HFT here), and use text matching in the 'ACTIVITY' and 'METHOD' fields to remove any rows that contain reference to 'burning' or 'fire'. Finally, we remove all rows that that reference 'Biomass' in the method category as it is assumed that this means material was removed for bioenergy.


In [14]:
usfs_acres = pd.read_sql('''select
                                sum(nbr_units1) acres,
                                method,
                                strftime('%Y',date_compl) year,
                                cat."ACTIVITY" activity,
                                cat."TENTATIVE_CATEGORY" r5_cat
                            from facts_notimber n 
                                join facts_cat cat
                                    on (n.activity = cat."ACTIVITY") 
                            where date_compl is not null
                                and nbr_units1 > 0
                                and cat."TENTATIVE_CATEGORY" != 'Burning'
                                and cat."ACTIVITY" not like '%ire%'
                                and method not like '%Burn%'
                                and method != 'Biomass'
                            group by cat."ACTIVITY",
                                year,
                                method,
                                cat."TENTATIVE_CATEGORY"
                            order by year;''', con = sqdb['cx'])

Converting acres to cubic feet

FACTS reports in acres. To estimate the production of biomass from acres treated we use a range of 10-35 BDT/acre. We assume that actual biomass residuals per acre are normally distributed with a mean of 22.5 and a standard deviation of (35-10)/4 = 6.25


In [15]:
def sumBDT(ac, maxbdt = 35, minbdt = 10):
    av = (maxbdt + minbdt)/2
    stdev = (float(maxbdt) - float(minbdt))/4 
    d_frac = (ac-np.floor(ac))*np.random.normal(av, stdev, 1).clip(min=0)[0]
    t_bdt = np.sum(np.random.normal(av,stdev,np.floor(ac)).clip(min=0))
    return d_frac+t_bdt

In [16]:
usfs_acres['bdt'] = usfs_acres['acres'].apply(sumBDT)
usfs_an_bdt = usfs_acres.groupby(['year']).sum()

Weighted average wood density

Average wood density weighted by harvested species percent. Derived from McIver and Morgan, Table 4


In [17]:
wood_dens = ut.gData('138FWlGeW57MKdcz2UkWxtWV4o50SZO8sduB1R6JOFp8', 1297253755)
wavg_dens =sum(wood_dens.pct/100 * wood_dens.density_lbscuft)

Annual unutilized management residuals

  • [x] Public lands non-commercial management residuals
  • [ ] Private land non-commercial management residuals
  • [x] Public lands logging residuals
  • [x] Private lands logging residuals

In [60]:
cat_codes = {'nf_ncmr': 'Unburned, non-commercial management residuals from National Forest lands',
             'nf_lr': 'Logging residuals generated from timber sales on National Forest lands',
             'opriv_lr': 'Logging residuals generated from timber sales on non-industrial private forest lands',
             'fi_lr': 'Logging residuals generated from timber sales on industrial private lands',
             'opub_lr': 'Logging residuals generated from timber sales on industrial private lands'}

In [48]:
usfs_an_bdt['cuft']= usfs_an_bdt.bdt *wavg_dens
resid_stats=pd.DataFrame((usfs_an_bdt.iloc[6:,2]/1000000).describe())
resid_stats.columns = ['nf_ncmr']
resid_stats['nf_lr']=tpoData[tpoData.ownership.str.contains('National Forest')]['loggingresidues'].describe()
resid_stats['opriv_lr']=tpoData[tpoData.ownership.str.contains('Other Private')]['loggingresidues'].describe()
resid_stats['fi_lr']=tpoData[tpoData.ownership.str.contains('Forest Industry')]['loggingresidues'].describe()
resid_stats['opub_lr']=tpoData[tpoData.ownership.str.contains('Other Public')]['loggingresidues'].describe()
resid_stats


Out[48]:
nf_ncmr nf_lr opriv_lr fi_lr opub_lr
count 11.000000 4.00000 4.000000 4.000000 4.000000
mean 12.019440 17.70000 28.950000 66.425000 2.400000
std 4.689480 5.07346 16.159311 6.076389 1.794436
min 2.374210 11.20000 11.200000 59.600000 0.300000
25% 8.924072 15.02500 19.525000 62.225000 1.275000
50% 13.355718 18.50000 27.750000 66.850000 2.500000
75% 14.534933 21.17500 37.175000 71.050000 3.625000
max 17.853204 22.60000 49.100000 72.400000 4.300000

In [63]:
print tabulate(resid_stats, headers = resid_stats.columns.tolist(), tablefmt ='pipe')


|       |   nf_ncmr |    nf_lr |   opriv_lr |    fi_lr |   opub_lr |
|:------|----------:|---------:|-----------:|---------:|----------:|
| count |  11       |  4       |     4      |  4       |   4       |
| mean  |  12.0194  | 17.7     |    28.95   | 66.425   |   2.4     |
| std   |   4.68948 |  5.07346 |    16.1593 |  6.07639 |   1.79444 |
| min   |   2.37421 | 11.2     |    11.2    | 59.6     |   0.3     |
| 25%   |   8.92407 | 15.025   |    19.525  | 62.225   |   1.275   |
| 50%   |  13.3557  | 18.5     |    27.75   | 66.85    |   2.5     |
| 75%   |  14.5349  | 21.175   |    37.175  | 71.05    |   3.625   |
| max   |  17.8532  | 22.6     |    49.1    | 72.4     |   4.3     |

In [120]:
import os

In [133]:
[os.path.splitext(i)[0] for i in os.listdir('lf/') if os.path.splitext(i)[1] =='.csv']


Out[133]:
['ignition_requests',
 'system_counties',
 'current_burns',
 'district_smp_comments',
 'system_air_districts',
 'cover_types',
 'smp_smoke_sensitive_areas',
 'smp_contact_methods',
 'smp_landowner_information',
 'smp_misc_comments',
 'current_burns_status',
 'ignitions',
 'smp_land_manager_information',
 'smp_pile_units',
 'system_air_basins',
 'smp_smoke_mitigation',
 'smp_broadcast_units',
 'smp_alternatives_to_burning']

In [9]:
ureg = UnitRegistry()
ureg.define('cubic foot =  cubic_centimeter/ 3.53147e-5 = cubic_foot' )
ureg.define('million cubic foot =  cubic_foot*1000000 = MMCF' )
ureg.define('board foot sawlog = cubic_foot / 5.44 = BF_saw')
ureg.define('board foot veneer = cubic_foot / 5.0 = BF_vo')
ureg.define('board foot bioenergy = cubic_foot / 1.0 = BF_bio')
ureg.define('bone-dry unit = cubic_foot * 96 = BDU')