This notebook shows how to generate basic statistics for the paper

Making Figure 3


In [1]:
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import pickle
%matplotlib inline

month_doy = {'Jan':1, 'Feb':32, 'Mar':60, 
             'Apr':91, 'May':121, 'Jun':152, 
             'Jul':182, 'Aug':213, 'Sep':244, 
             'Oct':274, 'Nov':305, 'Dec':335}

def draw_cumu_labels(ax):
    ax.set_xlim(1, 365)
    
    ax.set_xticks(list(month_doy.values()))
    ax.set_xticklabels(list(month_doy.keys()), rotation=45)
    
    ax.axvspan(month_doy['Jan'], month_doy['Mar'], facecolor='0.5', alpha=0.1)
    ax.axvspan(month_doy['Jun'], month_doy['Sep'], facecolor='0.5', alpha=0.1)
    ax.axvspan(month_doy['Dec'], 365, facecolor='0.5', alpha=0.1)
    ax.grid()
    return ax

plt.rcParams['figure.figsize'] = 30, 20
plt.rcParams['xtick.labelsize'] = 25
plt.rcParams['ytick.labelsize'] = 25
regions = {'conus':'CONUS', 'cornbelt':'Corn Belt', 'high_plains':'High Plains', 
            'mid_south':'Mid South', 'north_east':'Northeast', 'north_plains':'North Plains'}

abrev = {'conus':'CO', 'cornbelt':'CB', 'high_plains':'HP', 
            'mid_south':'MS', 'north_east':'NE', 'north_plains':'NP'}

colors = ['lightgreen', 'darkkhaki', 'darkgreen', 'seagreen', 'khaki']

d = {'Year':[], 'Count':[], 'Region':[]}
ax = plt.subplot(1,1,1)

linetype = ['-', '--', ':', '-', '--', ':']
color = ['k', 'k', 'k', 'lightgrey', 'lightgrey', 'lightgrey']

track_loc = "../data/track_data/"

for count, key in enumerate(['econus', 'north_plains', 'high_plains', 'cornbelt', 'mid_south', 'north_east']):
    
    ax = plt.subplot(2, 3, count+1)

    df_select = pd.read_csv(track_loc + key + "_mcs_swaths_within.csv")
    df_select['datetime'] = pd.to_datetime(df_select.datetime)
    df_select = df_select.set_index('datetime')

    df_select['doy'] = df_select.index.dayofyear
    years = df_select.groupby(df_select.index.year)
    year_data = np.zeros(shape=(22, 365))

    texts = []

    for yid, year in years:

        data = []

        if yid in [1996, 2000, 2004, 2008, 2012, 2016]:

            #iterate 1 to 366 days
            for i in range(1, 367):

                #business as usual
                if i != 60:
                    s_count = year[year['doy'].values <= i]
                    data.append(s_count.storm_num.nunique())

                #Otherwise, set February 29th to February 28th count 
                else:
                    s_count = year[year['doy'].values <= i]
                    data[-1] = s_count.storm_num.nunique()
        else:

            #iterate 1 to 365 days
            for i in range(1, 366):
                s_count = year[year['doy'].values <= i]
                data.append(s_count.storm_num.nunique())

        year_data[yid-1996, :] = np.array(data)
        
        ax.plot(data, 'k-', linewidth=1, alpha=0.7)
        d['Year'].append(yid)
        d['Count'].append(data[-1])
        d['Region'].append(key)

    ax.set_title(key)
    ax.plot(np.mean(year_data, axis=0), 'k-', linewidth=4)
    ax.set_ylabel("Cumulative Count", fontsize=25)

    draw_cumu_labels(ax)
    
#plt.savefig("Fig3.tif", bbox_inches='tight', dpi=300)


Run through the yearly generated stats.


In [2]:
from scipy.stats import variation

counts = pd.DataFrame.from_dict(d)

for gid, group in counts.groupby('Region'):
    
    g = group.sort_values(by='Count', ascending=False)
    
    print(g)
    print(print('Mean MCS', np.mean(g.Count.values)))
    print(print('C.V. MCS', variation(g.Count.values)))
    print(print('V. MCS', np.std(g.Count.values)))


    Year  Count    Region
80  2010    121  cornbelt
76  2006    120  cornbelt
78  2008    106  cornbelt
77  2007    104  cornbelt
68  1998     97  cornbelt
70  2000     96  cornbelt
71  2001     95  cornbelt
81  2011     95  cornbelt
86  2016     91  cornbelt
87  2017     91  cornbelt
74  2004     90  cornbelt
75  2005     89  cornbelt
72  2002     88  cornbelt
66  1996     88  cornbelt
85  2015     84  cornbelt
84  2014     82  cornbelt
69  1999     81  cornbelt
73  2003     79  cornbelt
83  2013     79  cornbelt
67  1997     67  cornbelt
82  2012     67  cornbelt
79  2009     60  cornbelt
Mean MCS 89.54545454545455
None
C.V. MCS 0.16556318284174884
None
V. MCS 14.825430463556602
None
    Year  Count  Region
11  2007    719  econus
12  2008    702  econus
8   2004    697  econus
13  2009    695  econus
5   2001    667  econus
15  2011    663  econus
10  2006    663  econus
6   2002    658  econus
14  2010    654  econus
20  2016    649  econus
7   2003    633  econus
0   1996    630  econus
19  2015    628  econus
16  2012    622  econus
4   2000    619  econus
1   1997    614  econus
2   1998    613  econus
9   2005    591  econus
21  2017    591  econus
3   1999    553  econus
18  2014    541  econus
17  2013    528  econus
Mean MCS 633.1818181818181
None
C.V. MCS 0.07889679121450896
None
V. MCS 49.95601370991408
None
    Year  Count       Region
55  2007    116  high_plains
57  2009    110  high_plains
63  2015    106  high_plains
53  2005    102  high_plains
52  2004    100  high_plains
64  2016    100  high_plains
56  2008     97  high_plains
44  1996     91  high_plains
48  2000     89  high_plains
54  2006     87  high_plains
49  2001     87  high_plains
61  2013     87  high_plains
58  2010     85  high_plains
47  1999     85  high_plains
46  1998     85  high_plains
65  2017     79  high_plains
51  2003     76  high_plains
50  2002     76  high_plains
59  2011     76  high_plains
60  2012     76  high_plains
62  2014     75  high_plains
45  1997     72  high_plains
Mean MCS 88.95454545454545
None
C.V. MCS 0.1368231757121448
None
V. MCS 12.171043403121244
None
     Year  Count     Region
101  2009    157  mid_south
88   1996    122  mid_south
96   2004    121  mid_south
93   2001    119  mid_south
100  2008    119  mid_south
103  2011    114  mid_south
89   1997    112  mid_south
104  2012    111  mid_south
95   2003    111  mid_south
107  2015    107  mid_south
109  2017    107  mid_south
98   2006    107  mid_south
102  2010    101  mid_south
108  2016    100  mid_south
94   2002     97  mid_south
91   1999     95  mid_south
99   2007     94  mid_south
97   2005     93  mid_south
90   1998     92  mid_south
106  2014     91  mid_south
105  2013     83  mid_south
92   2000     79  mid_south
Mean MCS 106.0
None
C.V. MCS 0.15354743496278264
None
V. MCS 16.27602810605496
None
     Year  Count      Region
125  2011     91  north_east
122  2008     67  north_east
112  1998     64  north_east
123  2009     62  north_east
118  2004     61  north_east
114  2000     59  north_east
121  2007     58  north_east
110  1996     52  north_east
117  2003     51  north_east
115  2001     51  north_east
120  2006     47  north_east
116  2002     46  north_east
113  1999     45  north_east
126  2012     45  north_east
124  2010     43  north_east
129  2015     43  north_east
128  2014     41  north_east
127  2013     40  north_east
131  2017     39  north_east
111  1997     37  north_east
130  2016     37  north_east
119  2005     23  north_east
Mean MCS 50.09090909090909
None
C.V. MCS 0.2733250904156221
None
V. MCS 13.691102256273435
None
    Year  Count        Region
33  2007     43  north_plains
37  2011     43  north_plains
36  2010     42  north_plains
31  2005     42  north_plains
42  2016     40  north_plains
26  2000     39  north_plains
35  2009     38  north_plains
23  1997     35  north_plains
34  2008     34  north_plains
27  2001     33  north_plains
24  1998     33  north_plains
28  2002     32  north_plains
25  1999     31  north_plains
41  2015     31  north_plains
30  2004     28  north_plains
40  2014     28  north_plains
39  2013     28  north_plains
29  2003     27  north_plains
22  1996     25  north_plains
38  2012     24  north_plains
32  2006     20  north_plains
43  2017     19  north_plains
Mean MCS 32.5
None
C.V. MCS 0.21771961083074368
None
V. MCS 7.075887351999169
None

Compare mean counts between the regions from 2002-2017 (Figure 10)


In [3]:
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline

plt.rcParams['figure.figsize'] = 30, 20
plt.rcParams['xtick.labelsize'] = 35
plt.rcParams['ytick.labelsize'] = 35

regions = {'econus':'E. CONUS', 'cornbelt':'Corn Belt', 'high_plains':'High Plains', 
            'mid_south':'Mid South', 'north_east':'Northeast', 'north_plains':'North Plains'}

ax = plt.subplot(1,1,1)

def draw_cumu_labels(ax):
    ax.set_xlim(1, 365)
    
    ax.set_xticks(list(month_doy.values()))
    ax.set_xticklabels(list(month_doy.keys()), rotation=45)
    
    ax.axvspan(month_doy['Jan'], month_doy['Mar'], facecolor='0.5', alpha=0.1)
    ax.axvspan(month_doy['Jun'], month_doy['Sep'], facecolor='0.5', alpha=0.1)
    ax.axvspan(month_doy['Dec'], 365, facecolor='0.5', alpha=0.1)
    ax.grid()
    return ax

linetype = ['-', '--', ':', '-', '--', ':']
color = ['k', 'k', 'k', 'lightgrey', 'lightgrey', 'lightgrey']

ax = plt.subplot(1, 1, 1)

for count, key in enumerate(['mid_south', 'cornbelt', 'high_plains', 'north_east', 'north_plains']):
    
    df_select = pd.read_csv(track_loc + key + "_mcs_swaths_within.csv")
        
    df_select['datetime'] = pd.to_datetime(df_select.datetime)
    df_select = df_select.set_index('datetime')
    

    df_select['doy'] = df_select.index.dayofyear
    years = df_select.groupby(df_select.index.year)
    year_data = np.zeros(shape=(16, 365))

    for yid, year in years:
        
        if yid >= 2002:
            data = []

            if yid in [2004, 2008, 2012, 2016]:

                #iterate 1 to 366 days
                for i in range(1, 367):

                    #business as usual
                    if i != 60:
                        s_count = year[year['doy'].values <= i]
                        data.append(s_count.storm_num.nunique())

                    #Otherwise, add February 29th to February 28th count 
                    else:
                        s_count = year[year['doy'].values <= i]
                        data[-1] = s_count.storm_num.nunique()
            else:

                #iterate 1 to 365 days
                for i in range(1, 366):
                    s_count = year[year['doy'].values <= i]
                    data.append(s_count.storm_num.nunique())

            year_data[yid-2002, :] = np.array(data)
        
    #ax.set_title(key)
    ax.plot(np.mean(year_data, axis=0), color=color[count], 
            ls=linetype[count], linewidth=6, label=regions[key])

draw_cumu_labels(ax)
ax.legend(loc=2, prop={'size':40})
ax.set_ylabel("MCS Counts", fontsize=35)
#ax.set_title("Cumulative MCS Preciptation Volume")

plt.savefig("Fig10b.tif", bbox_inches='tight', dpi=300)


C:\Users\AlexHaberlie\Anaconda3\envs\py36\lib\site-packages\matplotlib\cbook\deprecation.py:107: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  warnings.warn(message, mplDeprecation, stacklevel=1)

Examine amount of times a track exists during a particular hour in a particular region. (Figure 4)


In [4]:
plt.rcParams['figure.figsize'] = 30, 20

def draw_hour_labels(ax, lab):
    ax.set_xlim(0, 23)
    ax.legend(prop={'size': 30})
    ax.set_xlabel("Hour of Day (UTC)", fontsize=35)
    ax.set_xticks(list(range(0, 24)))
    ax.set_xticklabels(list(range(0, 24)), rotation=45)
    #ax.set_title(lab + " Swath Count by Hour of Day", fontsize=20)
    ax.grid()
    return ax

linetype = ['-', '--', ':', '-', '--', ':']
color = ['k', 'k', 'k', 'lightgrey', 'lightgrey', 'lightgrey']

ax = plt.subplot(1, 1, 1)

regions = {'econus':'E. CONUS', 'cornbelt':'Corn Belt', 'high_plains':'High Plains', 
            'mid_south':'Mid South', 'north_east':'Northeast', 'north_plains':'North Plains'}

for count, key in enumerate(['mid_south', 'cornbelt', 'high_plains', 'north_east', 'north_plains']):

    df_select = pd.read_csv(track_loc + key + "_mcs_swaths_within.csv")
    df_select['datetime'] = pd.to_datetime(df_select.datetime)
    df_select = df_select.set_index('datetime')

    df_ = df_select[df_select.index.month.isin([5,6,7,8])].copy()

    years = df_.groupby(df_.index.year)
    year_data = np.zeros((22, 24), dtype=int)

    for yid, year in years:

        hour_data = []
        for hid in range(0, 24):

            hour = year[year.index.hour==hid].copy()
            hour_data.append(hour.storm_num.nunique())

        year_data[yid-1996, :] = np.array(hour_data)

    ax.plot(np.mean(year_data, axis=0), color=color[count], 
            ls=linetype[count], label=regions[key], linewidth=4)

ax.set_ylabel("MCS Count Per Hour", fontsize=35)
ax = draw_hour_labels(ax, key.upper())
ax.set_ylim(0.5, 30)
plt.tight_layout()

plt.savefig("Fig4.tif", bbox_inches='tight', dpi=300)


Examine summary statistics of MCS slice attributes (Figure 5)


In [5]:
import matplotlib.pyplot as plt
%matplotlib inline
import pandas as pd

plt.rcParams['figure.figsize'] =30,30
plt.rcParams['xtick.labelsize'] = 35
plt.rcParams['ytick.labelsize'] = 35

from matplotlib.patches import Polygon

regions = {'E. CONUS':'econus', 'High Plains':'high_plains', 'Corn Belt':'cornbelt', 
           'Mid South':'mid_south', 'Northeast':'north_east',
           'North Plains': 'north_plains'}
 

meanpointprops = dict(marker='.', markeredgecolor='black',
                      markerfacecolor='black')

basic_slice_stats = {'variable':[], 'region':[], 'period':[], 'max':[], 'min':[], 'mean':[]}

colors = ['w', 'lightgrey', 'darkgrey']

labels = {'area': r'$km^2$', 'mean_intensity':'dBZ', 'major_axis_length':'km', 'eccentricity':' '}

for fignum, var in enumerate(['area', 'mean_intensity', 'major_axis_length', 'eccentricity']):
    
    results = {'E. CONUS':{'Annual':None, 'May-Aug':None, 'Sep-Apr':None}, 
           'High Plains':{'Annual':None, 'May-Aug':None, 'Sep-Apr':None},
           'Corn Belt': {'Annual':None, 'May-Aug':None, 'Sep-Apr':None},
           'Mid South': {'Annual':None, 'May-Aug':None, 'Sep-Apr':None},
           'Northeast': {'Annual':None, 'May-Aug':None, 'Sep-Apr':None},
           'North Plains': {'Annual':None, 'May-Aug':None, 'Sep-Apr':None}}
    
    for count, key in enumerate(['E. CONUS', 'North Plains', 'High Plains', 
                                 'Corn Belt', 'Mid South', 'Northeast']):

        value = regions[key]

        df_select = pd.read_csv(track_loc + value + "_mcs_swaths_within.csv")
        df_select['datetime'] = pd.to_datetime(df_select.datetime)
        df_select = df_select.set_index('datetime')

        ax = plt.subplot(2, 2, fignum+1)
        
        results[key]['Annual'] = df_select[var].values
        
        results[key]['May-Aug'] = df_select[df_select.index.month.isin([5,6,7,8])][var].values
        results[key]['Sep-Apr'] = df_select[df_select.index.month.isin([9, 10, 11, 12, 1, 2, 3, 4])][var].values

    i = 0
    for region in ['E. CONUS', 'North Plains', 'High Plains', 
                   'Corn Belt', 'Mid South', 'Northeast']:
        
        periods = results[region]
    
        for seas, period in enumerate(['Annual', 'May-Aug', 'Sep-Apr']):

            dist = periods[period]
            bplot = ax.boxplot(dist, positions=[i], whis=[5, 95], patch_artist=True,
                               showfliers=False, showmeans=True, meanprops=meanpointprops)

            plt.setp(bplot['medians'], color='black')

            [item.set_color('black') for item in bplot['means']] 
            
            [patch.set_facecolor(colors[seas]) for patch in bplot['boxes']]

            i += .25
        i += .5
    
    ax.set_xlim(-0.5, i) 
    
    #ax.set_title(labs[spl], fontsize=30)
    ax.set_ylabel(labels[var], fontsize=35)

    if var == 'area':
        ax.set_yscale('log')
        ax.set_ylim(8000, 300000)

    ax.yaxis.grid(b=True, which='both', color='k', linestyle='-')
    
    for region, region_val in results.items():
    
        for period, period_val in region_val.items():

            basic_slice_stats['variable'].append(var)
            basic_slice_stats['region'].append(region)
            basic_slice_stats['period'].append(period)
            basic_slice_stats['max'].append(np.max(period_val))
            basic_slice_stats['min'].append(np.min(period_val))
            basic_slice_stats['mean'].append(np.mean(period_val))

df_basic_stats = pd.DataFrame.from_dict(basic_slice_stats)


    
for i in range(4):

    ax = plt.subplot(2, 2, i+1)
    ax.set_xticks([.25, 1.5, 2.75, 4, 5.25, 6.5])
    ax.set_xticklabels(['E. CONUS', 'North Plains', 'High Plains', 
                                 'Corn Belt', 'Mid South', 'Northeast'], fontsize=35, rotation=45)

    plt.tight_layout()
    
#plt.savefig("Fig5.tif", bbox_inches='tight', dpi=300)


C:\Users\AlexHaberlie\Anaconda3\envs\py36\lib\site-packages\matplotlib\cbook\deprecation.py:107: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  warnings.warn(message, mplDeprecation, stacklevel=1)

Examine the seasonal and annual statistics of these attributes.


In [6]:
grouped = df_basic_stats.groupby('variable')

for vid, group in grouped:
    print("Variable = ", vid)
    print("\n")
    seasonal = group.groupby('period')
    
    for sid, season_group in seasonal:
        
        ordered = season_group.sort_values(by='mean', ascending=False)
        print(" Season = ", sid)
        print(ordered[['region', 'max', 'mean', 'min']])
        print("\n")


Variable =  area


 Season =  Annual
          region       max          mean      min
9      Mid South  446712.0  67478.904944  14232.0
6      Corn Belt  419060.0  55491.765210  14164.0
0       E. CONUS  455416.0  53509.684050  14164.0
3    High Plains  348840.0  51544.182408  14196.0
12     Northeast  243780.0  43191.891029  14236.0
15  North Plains  182184.0  38222.462352  14500.0


 Season =  May-Aug
          region       max          mean      min
7      Corn Belt  419060.0  55210.378999  14164.0
4    High Plains  273208.0  49582.587212  14392.0
10     Mid South  289364.0  49354.665163  14232.0
1       E. CONUS  419060.0  47667.322432  14164.0
13     Northeast  230540.0  41359.990437  14236.0
16  North Plains  182184.0  38151.318625  14500.0


 Season =  Sep-Apr
          region       max          mean      min
11     Mid South  446712.0  84792.004955  14332.0
2       E. CONUS  455416.0  63747.096249  14180.0
5    High Plains  348840.0  57062.570593  14196.0
8      Corn Belt  284832.0  56296.256758  14508.0
14     Northeast  243780.0  49149.009588  14708.0
17  North Plains  153112.0  38836.677741  14620.0


Variable =  eccentricity


 Season =  Annual
          region       max      mean       min
66     Northeast  0.998148  0.894272  0.264411
63     Mid South  0.998606  0.890139  0.264328
54      E. CONUS  0.998606  0.870912  0.253474
60     Corn Belt  0.998040  0.867261  0.256593
57   High Plains  0.996818  0.852285  0.259088
69  North Plains  0.995020  0.833804  0.258428


 Season =  May-Aug
          region       max      mean       min
67     Northeast  0.997354  0.888027  0.264411
64     Mid South  0.997595  0.864204  0.268986
61     Corn Belt  0.998040  0.862757  0.256593
55      E. CONUS  0.998291  0.857364  0.253474
58   High Plains  0.994733  0.842163  0.259088
70  North Plains  0.995020  0.830892  0.258428


 Season =  Sep-Apr
          region       max      mean       min
65     Mid South  0.998606  0.914913  0.264328
68     Northeast  0.998148  0.914577  0.371059
56      E. CONUS  0.998606  0.894653  0.260133
59   High Plains  0.996818  0.880762  0.278919
62     Corn Belt  0.996202  0.880139  0.281904
71  North Plains  0.994405  0.858945  0.346683


Variable =  major_axis_length


 Season =  Annual
          region          max        mean         min
45     Mid South  2440.243160  587.852224  180.645362
42     Corn Belt  2628.504268  497.019174  178.741128
36      E. CONUS  2628.504268  493.888868  171.609243
48     Northeast  1982.274992  478.962388  172.093173
39   High Plains  1985.183808  459.950770  173.176004
51  North Plains  1710.056082  375.696150  172.271980


 Season =  May-Aug
          region          max        mean         min
43     Corn Belt  2628.504268  488.781147  183.960703
46     Mid South  2229.619776  475.201164  180.645362
49     Northeast  1982.274992  466.069601  172.093173
37      E. CONUS  2628.504268  452.743437  171.609243
40   High Plains  1985.183808  437.917803  173.176004
52  North Plains  1464.384016  371.242912  172.271980


 Season =  Sep-Apr
          region          max        mean         min
47     Mid South  2440.243160  695.461652  184.957614
38      E. CONUS  2552.870066  565.986893  171.919628
41   High Plains  1979.174280  521.934232  175.061787
50     Northeast  1645.567670  520.888169  193.862123
44     Corn Belt  1975.663734  520.571939  178.741128
53  North Plains  1710.056082  414.142927  180.486271


Variable =  mean_intensity


 Season =  Annual
          region        max       mean        min
24     Corn Belt  46.815766  31.904695  25.600454
27     Mid South  58.202037  31.808522  26.329527
18      E. CONUS  67.444024  31.548099  24.594797
21   High Plains  42.400232  31.318004  25.303522
30     Northeast  37.216252  31.288968  24.978955
33  North Plains  35.503008  30.603499  24.594797


 Season =  May-Aug
          region        max       mean        min
25     Corn Belt  46.815766  32.127160  25.814805
28     Mid South  44.176936  32.011888  26.329527
19      E. CONUS  66.595525  31.668571  24.594797
22   High Plains  42.400232  31.452988  25.477568
31     Northeast  37.216252  31.412469  26.256145
34  North Plains  35.503008  30.635484  24.594797


 Season =  Sep-Apr
          region        max       mean        min
29     Mid South  58.202037  31.614259  26.922540
20      E. CONUS  67.444024  31.336999  24.696466
26     Corn Belt  35.585304  31.268662  25.600454
23   High Plains  35.467443  30.938267  25.303522
32     Northeast  34.695687  30.887359  24.978955
35  North Plains  34.422916  30.327359  26.005199


Calculate values for a heat map of monthly MCS counts


In [7]:
df = pd.read_csv(track_loc + "econus_mcs_swaths_within.csv")
df['datetime'] = pd.to_datetime(df.datetime)
df = df.set_index('datetime')

monthly = np.zeros(shape=(13, 23), dtype=int)

for i, year in enumerate(range(1996, 2018)):
    
    df_ = df[(df.index.year==year)].copy()
    df_['month'] = df_.index.month
             
    df_first = df_.groupby('storm_num').first()
    
    for j, month in enumerate(range(1, 13)):
    
        df_m = df_first[df_first.month==month]
        
        monthly[j, i] = len(np.unique(df_m.index))

Plot heat map of monthly counts of MCS tracks (Figure 2)


In [8]:
import matplotlib.pyplot as plt
%matplotlib inline

mon = monthly.copy()
mon[-1, :] = -1
mon[:, -1] = -1

mon = np.ma.masked_where(mon<0, mon)

from matplotlib.colors import BoundaryNorm
cmap = plt.cm.viridis
classes = list(range(0, 155, 5))
norm = BoundaryNorm(classes, ncolors=cmap.N, clip=True)

plt.rcParams['figure.figsize'] = 15, 15
plt.rcParams['xtick.labelsize'] = 10
plt.rcParams['ytick.labelsize'] = 10

plt.imshow(mon, norm=norm, cmap=cmap)

plt.xticks(np.array(range(0, 24))-.5, list(range(1996, 2018))+["Monthly\nMean"], rotation=45)
plt.yticks(np.array(range(0, 14))-.53, ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 
                                       'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Yearly\nTotal'])
plt.colorbar(shrink=.4, pad=0.01)
plt.grid()

for i in range(12):
    for j in range(22):
        
        if monthly[i, j] <= 45:
            plt.annotate(monthly[i, j], xy=(j-.3, i+.13), color='w')
        else:
            plt.annotate(monthly[i, j], xy=(j-.3, i+.13), color='k')
        
yr = np.sum(monthly, axis=0)
for i in range(22):
    plt.text(i-.3, 12+.13, yr[i])
    
mn = np.sum(monthly, axis=1)
for i in range(12):
    plt.text(22-.48, i+.13, "%.1f" % (mn[i]/22))
    
#plt.savefig("Fig2.tif", bbox_inches='tight', dpi=300)


Do the same as above for yearly counts, except for MCS rainfall volume. (Figure 8)


In [9]:
plt.rcParams['figure.figsize'] = 30, 20
plt.rcParams['xtick.labelsize'] = 25
plt.rcParams['ytick.labelsize'] = 25

d = {'Year':[], 'MCS_Vol':[], 'TOT_Vol':[], 'Region':[]}
ax = plt.subplot(1,1,1)

volume_loc = "../data/track_data/"

def draw_cumu_labels(ax):
    ax.set_xlim(1, 365)
    
    ax.set_xticks(list(month_doy.values()))
    ax.set_xticklabels(list(month_doy.keys()), rotation=45)
    
    ax.axvspan(month_doy['Jan'], month_doy['Mar'], facecolor='0.5', alpha=0.1)
    ax.axvspan(month_doy['Jun'], month_doy['Sep'], facecolor='0.5', alpha=0.1)
    ax.axvspan(month_doy['Dec'], 365, facecolor='0.5', alpha=0.1)
    ax.grid()
    return ax

for count, key in enumerate(['econus', 'north_plains', 'high_plains', 'cornbelt', 'mid_south', 'north_east']):
    
    ax = plt.subplot(2, 3, count+1)                       
    df_select = pd.read_csv(volume_loc + key + "_volume1.csv")
    df_select['datetime'] = pd.to_datetime(df_select.datetime)
    df_select = df_select.set_index('datetime')

    df_select['doy'] = df_select.index.dayofyear
    years = df_select.groupby(df_select.index.year)

    year_data = np.zeros(shape=(16, 365))

    texts = []

    for yid, year in years:

        data_mcs = []
        data = []
        
        if yid in [2004, 2008, 2012, 2016]:

            #iterate 1 to 366 days
            for i in range(1, 367):

                #business as usual
                if i != 60:
                    s_count = year[year['doy'].values <= i]
                    data.append(np.sum(s_count.cur_vol.values))
                    data_mcs.append(np.sum(s_count.cur_mcs.values))

                #Otherwise, add February 29th to February 28th count 
                else:
                    s_count = year[year['doy'].values <= i]
                    data[-1] = np.sum(s_count.cur_vol.values)
                    data_mcs[-1] = np.sum(s_count.cur_mcs.values)
        else:

            #iterate 1 to 365 days
            for i in range(1, 366):
                s_count = year[year['doy'].values <= i]
                data.append(np.sum(s_count.cur_vol.values))
                data_mcs.append(np.sum(s_count.cur_mcs.values))

        year_data[yid-2002, :] = np.array(data_mcs)
        
        ax.plot(data_mcs, 'k-', linewidth=1, alpha=0.7)

        ax.set_title(key)
        d['Year'].append(yid)
        d['TOT_Vol'].append(data[-1])
        d['MCS_Vol'].append(data_mcs[-1])
        d['Region'].append(key)

    ax.plot(np.mean(year_data, axis=0), 'k-', linewidth=4)
    ax.set_ylabel("Precipitation Volume (" + r'$km^3$' + ")", fontsize=20)

    draw_cumu_labels(ax)
    
#plt.savefig("Fig8.tif", bbox_inches='tight', dpi=300)


Examine yearly statistics of MCS rainfall volume


In [10]:
from scipy.stats import variation
counts = pd.DataFrame.from_dict(d)

for gid, group in counts.groupby('Region'):
    
    g = group.sort_values(by='MCS_Vol', ascending=True)
    g['perc'] = 100*(g['MCS_Vol'] / g['TOT_Vol'])
    
    g = g.sort_values(by='perc', ascending=True)
    print(g)
    print(g[['MCS_Vol', 'TOT_Vol', 'perc']].mean())
    print('C.V. MCS', variation(g.MCS_Vol.values))
    print('C.V. Tot', variation(g.TOT_Vol.values))
    print("\n")


    Year     MCS_Vol     TOT_Vol    Region       perc
55  2009   93.593264  345.238305  cornbelt  27.109757
61  2015  102.854741  369.194817  cornbelt  27.859205
52  2006  101.470820  327.890516  cornbelt  30.946555
59  2013  104.938762  335.828994  cornbelt  31.247678
58  2012   71.225648  224.987871  cornbelt  31.657550
60  2014  115.182664  355.124828  cornbelt  32.434416
63  2017  110.671490  340.112474  cornbelt  32.539674
51  2005   83.601101  255.478110  cornbelt  32.723391
49  2003   94.357600  273.167617  cornbelt  34.542015
57  2011  113.278421  316.378776  cornbelt  35.804684
62  2016  126.902411  340.724677  cornbelt  37.244855
54  2008  141.898234  378.790712  cornbelt  37.460854
50  2004  117.828564  310.084117  cornbelt  37.998903
48  2002   95.194789  245.113962  cornbelt  38.836951
53  2007  139.665818  333.589718  cornbelt  41.867543
56  2010  157.991368  334.236905  cornbelt  47.269277
MCS_Vol    110.665981
TOT_Vol    317.871400
perc        34.846457
dtype: float64
C.V. MCS 0.19773464519346898
C.V. Tot 0.13692896579888875


    Year      MCS_Vol      TOT_Vol  Region       perc
11  2013  1221.447063  5043.175350  econus  24.219802
13  2015  1395.629231  5626.462412  econus  24.804737
12  2014  1305.784265  4954.961701  econus  26.353065
3   2005  1139.222689  4274.187458  econus  26.653550
4   2006  1228.826740  4426.978640  econus  27.757684
2   2004  1356.527733  4832.158864  econus  28.072913
15  2017  1450.348542  5133.884318  econus  28.250511
1   2003  1258.503083  4423.943370  econus  28.447541
7   2009  1554.154574  5003.045600  econus  31.064170
14  2016  1559.259042  5004.588737  econus  31.156587
0   2002  1505.324220  4760.141773  econus  31.623517
10  2012  1285.755643  3951.071831  econus  32.541946
5   2007  1455.105021  4416.495233  econus  32.947053
9   2011  1528.898252  4629.958041  econus  33.021860
8   2010  1486.185244  4495.324432  econus  33.060689
6   2008  1639.073088  4843.188687  econus  33.842850
MCS_Vol    1398.127777
TOT_Vol    4738.722903
perc         29.613655
dtype: float64
C.V. MCS 0.10114724503303683
C.V. Tot 0.08260613004588227


    Year     MCS_Vol     TOT_Vol       Region       perc
36  2006   66.990188  199.660959  high_plains  33.551971
34  2004   79.658801  220.660306  high_plains  36.100195
47  2017   93.805836  245.377687  high_plains  38.229163
45  2015  114.365335  286.592286  high_plains  39.905238
41  2011   73.829880  182.929094  high_plains  40.359835
39  2009   92.001089  226.653255  high_plains  40.591117
43  2013   90.663637  215.962074  high_plains  41.981277
32  2002   70.513253  167.842849  high_plains  42.011473
33  2003   70.322081  164.304770  high_plains  42.799781
38  2008  107.909038  247.600062  high_plains  43.581991
35  2005   96.799009  221.749843  high_plains  43.652346
40  2010   98.544145  223.626043  high_plains  44.066489
42  2012   66.773672  148.374452  high_plains  45.003484
44  2014   95.848545  208.191349  high_plains  46.038678
46  2016  116.254590  239.124975  high_plains  48.616666
37  2007  137.345963  260.536749  high_plains  52.716541
MCS_Vol     91.976566
TOT_Vol    216.199172
perc        42.450390
dtype: float64
C.V. MCS 0.21332164015927726
C.V. Tot 0.1658666926628018


    Year     MCS_Vol     TOT_Vol     Region       perc
75  2013  148.694055  493.265324  mid_south  30.144842
64  2002  175.247399  573.824521  mid_south  30.540242
77  2015  153.941969  502.008645  mid_south  30.665203
66  2004  148.438901  459.687909  mid_south  32.291235
67  2005  118.180339  358.583512  mid_south  32.957550
76  2014  159.941297  448.644180  mid_south  35.649921
79  2017  173.227541  472.928216  mid_south  36.628718
69  2007  121.296758  322.578989  mid_south  37.602188
65  2003  175.335020  458.225102  mid_south  38.263949
78  2016  159.233672  413.130046  mid_south  38.543232
68  2006  166.465726  416.675861  mid_south  39.950893
71  2009  246.053494  570.092299  mid_south  43.160291
74  2012  170.048979  383.665516  mid_south  44.322195
72  2010  161.077244  358.992548  mid_south  44.869244
73  2011  211.432827  448.677188  mid_south  47.123596
70  2008  212.388636  449.774911  mid_south  47.221095
MCS_Vol    168.812741
TOT_Vol    445.672173
perc        38.120900
dtype: float64
C.V. MCS 0.18664805165789572
C.V. Tot 0.15307702060760753


    Year    MCS_Vol     TOT_Vol      Region       perc
83  2005  18.547400  390.897099  north_east   4.744829
88  2010  33.693794  368.843551  north_east   9.134982
81  2003  40.394838  384.380314  north_east  10.509081
84  2006  49.503238  467.661593  north_east  10.585269
94  2016  33.779295  316.955557  north_east  10.657423
91  2013  38.791036  355.102808  north_east  10.923889
92  2014  44.500622  380.794986  north_east  11.686242
95  2017  46.190846  376.945385  north_east  12.253989
93  2015  43.853597  352.592279  north_east  12.437481
87  2009  48.746672  359.542391  north_east  13.557976
82  2004  54.196547  393.478530  north_east  13.773699
85  2007  52.188504  364.537034  north_east  14.316379
90  2012  49.090890  329.084772  north_east  14.917399
80  2002  51.150733  342.178841  north_east  14.948538
86  2008  66.295489  415.787091  north_east  15.944576
89  2011  91.479700  487.890960  north_east  18.750030
MCS_Vol     47.650200
TOT_Vol    380.417074
perc        12.446361
dtype: float64
C.V. MCS 0.3209781814045648
C.V. Tot 0.11586221952640444


    Year    MCS_Vol     TOT_Vol        Region       perc
31  2017  13.112091  149.540303  north_plains   8.768266
20  2006  11.565582  111.533606  north_plains  10.369594
28  2014  23.108013  199.684086  north_plains  11.572286
27  2013  28.081931  212.050291  north_plains  13.243052
17  2003  14.275025  104.293629  north_plains  13.687342
26  2012  16.867562  121.181817  north_plains  13.919218
18  2004  18.431219  131.750789  north_plains  13.989456
25  2011  30.725788  189.318090  north_plains  16.229716
30  2016  32.876315  191.307837  north_plains  17.185033
29  2015  33.330146  190.257035  north_plains  17.518483
23  2009  29.551186  162.498720  north_plains  18.185488
22  2008  32.561620  174.996965  north_plains  18.606963
24  2010  37.807995  172.020338  north_plains  21.978794
19  2005  36.377012  144.156792  north_plains  25.234338
21  2007  39.041366  149.214368  north_plains  26.164616
16  2002  22.231752   84.790063  north_plains  26.219761
MCS_Vol     26.246538
TOT_Vol    155.537170
perc        17.054525
dtype: float64
C.V. MCS 0.3400782975519075
C.V. Tot 0.2328502610877273


Compare mean values of MCS rainfall volume by region. (Figure 10)


In [11]:
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline

plt.rcParams['figure.figsize'] = 30, 20
plt.rcParams['xtick.labelsize'] = 35
plt.rcParams['ytick.labelsize'] = 35
regions = {'conus':'E. CONUS', 'cornbelt':'Corn Belt', 'high_plains':'High Plains', 
            'mid_south':'Mid South', 'north_east':'Northeast', 'north_plains':'North Plains'}

linetype = ['-', '--', ':', '-', '--', ':']
color = ['k', 'k', 'k', 'lightgrey', 'lightgrey', 'lightgrey']

def draw_cumu_labels(ax):
    ax.set_xlim(1, 365)
    
    ax.set_xticks(list(month_doy.values()))
    ax.set_xticklabels(list(month_doy.keys()), rotation=45)
    
    ax.axvspan(month_doy['Jan'], month_doy['Mar'], facecolor='0.5', alpha=0.1)
    ax.axvspan(month_doy['Jun'], month_doy['Sep'], facecolor='0.5', alpha=0.1)
    ax.axvspan(month_doy['Dec'], 365, facecolor='0.5', alpha=0.1)
    ax.grid()
    return ax

for count, key in enumerate(['mid_south', 'cornbelt', 'high_plains', 'north_east', 'north_plains']):
    
    ax = plt.subplot(1, 1, 1)                       
    df_select = pd.read_csv(track_loc + key + "_volume1.csv")
    df_select['datetime'] = pd.to_datetime(df_select.datetime)
    df_select = df_select.set_index('datetime')

    df_day = df_select.resample('D').sum()
    df_day['doy'] = df_day.index.dayofyear
    
    df_day.loc[pd.isnull(df_day['cur_mcs']), 'cur_mcs'] = 0.0
    df_day.loc[pd.isnull(df_day['cur_vol']), 'cur_vol'] = 0.0
    years = df_day.groupby(df_day.index.year)

    year_data = np.zeros(shape=(16, 365))

    for yid, year in years:
        
        data = []

        if yid in [2004, 2008, 2012, 2016]:

            #iterate 1 to 366 days
            for i in range(1, 367):

                #business as usual
                if i != 60:
                    s_count = year[year['doy'].values <= i]
                    data.append(np.sum(s_count.cur_mcs.values)) 

                #Otherwise, add February 29th to February 28th count 
                else:
                    s_count = year[year['doy'].values <= i]
                    data[-1] = np.sum(s_count.cur_mcs.values)
        else:

            #iterate 1 to 365 days
            for i in range(1, 366):
                s_count = year[year['doy'].values <= i]
                data.append(np.sum(s_count.cur_mcs.values)) 
        
        year_data[yid-2002, :] = np.array(data)
        
    ax.plot(np.mean(year_data, axis=0), lw=6, color=color[count], linestyle=linetype[count], label=regions[key])

ax.set_ylabel("Precipitation Volume (" + r'$km^3$' + ")", fontsize=35)
draw_cumu_labels(ax)

ax.legend(loc=2, prop={'size':40})

#plt.savefig("Fig10b.tif", bbox_inches='tight', dpi=300)


C:\Users\AlexHaberlie\Anaconda3\envs\py36\lib\site-packages\matplotlib\cbook\deprecation.py:107: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  warnings.warn(message, mplDeprecation, stacklevel=1)
Out[11]:
<matplotlib.legend.Legend at 0x2171e9fa9b0>

Calculate seasonal contributions of MCS to total rainfall. (Figure 9)


In [12]:
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline

def draw_cumu_labels(ax, ymax):
    ax.set_xlim(0, 13)
    ax.set_ylim(0, 80)
    ax.set_xticks([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
    ax.set_xticklabels(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], rotation=45)
    #ax.legend(loc=2, prop={'size': 25})
    ax.axvspan(0, 3, facecolor='0.5', alpha=0.1)
    ax.axvspan(6, 9, facecolor='0.5', alpha=0.1)
    ax.axvspan(11, 13, facecolor='0.5', alpha=0.1)
    ax.grid()
    #ax.set_ylabel("Cumulative Count", fontsize=35)
    return ax

meanpointprops = dict(marker='.', markeredgecolor='black',
                      markerfacecolor='black')
plt.rcParams['figure.figsize'] = 30, 20
plt.rcParams['xtick.labelsize'] = 20
plt.rcParams['ytick.labelsize'] = 20
regions = {'cornbelt':'Corn Belt', 'high_plains':'High Plains', 
            'mid_south':'Mid South', 'north_east':'North East', 'north_plains':'North Plains'}

basic_volume_stats = {'region':[], 'month':[], 'max':[], 'p95':[], 'mean':[], 'p5':[], 'min':[]}

for count, key in enumerate(['econus', 'north_plains', 'high_plains', 'cornbelt', 'mid_south', 'north_east']):
    
    ax = plt.subplot(2, 3, count+1)                       
    df_select = pd.read_csv(track_loc + key + "_volume1.csv")
    df_select['datetime'] = pd.to_datetime(df_select.datetime)
    df_select = df_select.set_index('datetime')
    
    df_select.loc[pd.isnull(df_select['cur_mcs']), 'cur_mcs'] = 0.0
    df_select.loc[pd.isnull(df_select['cur_vol']), 'cur_vol'] = 0.0

    df_month = df_select.resample('M').sum()
    months = df_month.groupby(df_month.index.month)
    
    data = df_month['cur_mcs']
    data1 = df_month['cur_vol']
    perc = 100*(np.array(data) / np.array(data1))

    df_month['perc'] = perc
    
    month_data = []
    for mid, month in months:
        data = month['cur_mcs']
        data1 = month['cur_vol']
        perc = 100*(np.array(data) / np.array(data1))
        month_data.append([x for x in perc])
        
        basic_volume_stats['region'].append(key)
        basic_volume_stats['month'].append(mid)
        basic_volume_stats['max'].append(np.max(perc))
        basic_volume_stats['p95'].append(np.percentile(perc, 95))
        basic_volume_stats['mean'].append(np.mean(perc))
        basic_volume_stats['p5'].append(np.percentile(perc, 5))
        basic_volume_stats['min'].append(np.min(perc))
        
    bplot = ax.boxplot(month_data, positions=list(range(1, 13)), 
               whis=[5, 95], showfliers=False, showmeans=True, meanprops=meanpointprops)

    plt.setp(bplot['medians'], color='black')
    
    plt.title(key, fontsize=20)

    [item.set_color('black') for item in bplot['means']] 
    ax.set_ylabel("Percent Precipitation Volume From MCSs", fontsize=20)

    draw_cumu_labels(ax, 1)
    
#plt.savefig("Fig9.tif", bbox_inches='tight', dpi=300)


Examine stats of monthly percentages


In [13]:
from scipy.stats import variation

vol_stats = pd.DataFrame.from_dict(basic_volume_stats)

for gid, group in vol_stats.groupby('region'):
    
    print("\n")
    print("Region = ", gid)
    print("Descriptive statistics of MCS percent contribution to rainfall volume per month")
    
    g = group.sort_values(by='month', ascending=True)
    
    print(g[['month', 'max', 'p95', 'mean', 'p5', 'min']])



Region =  cornbelt
Descriptive statistics of MCS percent contribution to rainfall volume per month
    month        max        p95       mean         p5        min
36      1  31.709110  23.355965   6.264369   0.000000   0.000000
37      2  25.027821  24.499172   5.783947   0.000000   0.000000
38      3  39.526258  35.402038  17.361911   0.128175   0.113763
39      4  41.490804  41.409980  28.440112  14.001743  13.740875
40      5  62.738692  59.138429  40.650042  17.397421  16.809035
41      6  79.363945  74.711713  56.861400  44.700044  43.783377
42      7  73.799763  73.677218  60.557066  46.335264  35.521560
43      8  79.358284  76.593263  54.182668  34.509139  31.800271
44      9  62.725257  59.118178  37.666140  14.557518  10.652742
45     10  39.590858  33.181131  16.667029   2.320141   0.000711
46     11  29.850120  29.513894  12.299547   0.003833   0.000000
47     12  22.920374  15.964240   3.190087   0.000000   0.000000


Region =  econus
Descriptive statistics of MCS percent contribution to rainfall volume per month
    month        max        p95       mean         p5        min
0       1  35.081554  30.795065  14.863006   5.677849   5.139009
1       2  35.338628  29.535790  18.656621   8.847329   2.736933
2       3  40.651543  38.644454  26.808267  11.067508   5.001812
3       4  50.215311  45.333694  36.556282  29.570266  29.248755
4       5  46.623769  46.510721  40.090100  32.575601  32.514897
5       6  52.622566  51.742420  40.122634  32.273912  31.634296
6       7  43.802341  42.152684  36.152331  31.249667  25.461942
7       8  45.632418  45.273794  34.296811  26.480556  24.631623
8       9  35.781285  34.211881  25.504025  15.481705  14.732072
9      10  30.620437  30.424725  21.207036  15.456012  15.111810
10     11  28.776672  27.964799  17.954820   7.964527   6.331556
11     12  25.090362  24.721388  14.106734   6.325259   4.447270


Region =  high_plains
Descriptive statistics of MCS percent contribution to rainfall volume per month
    month        max        p95       mean         p5        min
24      1  13.359111  10.876560   2.816991   0.000000   0.000000
25      2  38.738258  26.078305  11.148105   0.000000   0.000000
26      3  60.167243  53.656385  20.422012   3.881750   2.928599
27      4  53.788015  46.551490  34.321094  22.363620  21.842068
28      5  70.815677  66.805101  52.532250  39.841082  39.720787
29      6  76.691850  76.229807  61.968167  43.935526  27.170294
30      7  62.468339  57.565887  46.445544  34.850609  34.809381
31      8  68.735039  67.702817  53.904203  42.492324  39.591758
32      9  60.327906  53.291836  37.530715  22.017078  21.706063
33     10  59.856682  57.010427  35.999342  16.461659  15.615087
34     11  58.688949  50.778859  16.299425   0.000000   0.000000
35     12  26.434797  25.300287   7.513283   0.000000   0.000000


Region =  mid_south
Descriptive statistics of MCS percent contribution to rainfall volume per month
    month        max        p95       mean         p5        min
48      1  51.463108  49.923075  25.072829   7.416561   4.241244
49      2  63.278909  54.951828  31.488822  10.981927   4.294317
50      3  63.108559  58.534892  42.739002  21.534037   7.702698
51      4  87.914420  80.579778  59.250353  37.853939  31.592563
52      5  74.207295  68.574804  53.587496  37.154252  33.391191
53      6  72.222186  65.681689  41.898052  17.608134  13.119440
54      7  61.160735  56.128456  36.150193  26.071551  22.112816
55      8  58.674415  53.823238  33.200548  15.010767  13.461983
56      9  63.485285  46.290116  27.381022  10.200871   5.398827
57     10  64.539233  62.171731  31.314151  11.403898   9.434728
58     11  73.780835  57.656638  31.869134  10.356124   6.452022
59     12  55.246752  54.131096  27.865334   9.547626   2.429968


Region =  north_east
Descriptive statistics of MCS percent contribution to rainfall volume per month
    month        max        p95       mean         p5        min
60      1   7.859870   3.677337   1.083679   0.000000   0.000000
61      2  15.096650  15.021338   4.773273   0.000000   0.000000
62      3  17.011118  15.619188   4.483784   0.000000   0.000000
63      4  37.167683  27.733308  11.200413   0.799248   0.633412
64      5  43.990217  36.876241  19.670217   4.828419   2.353145
65      6  42.022014  37.397408  22.851268  10.180153   9.041815
66      7  48.120010  46.141634  30.184237  17.049102  16.536903
67      8  36.985884  36.176408  22.576520   8.193816   6.655904
68      9  28.114841  27.445133  13.954613   2.962464   1.759932
69     10  20.399110  11.593899   4.418162   0.086496   0.000000
70     11  13.576632   9.685435   3.717355   0.000000   0.000000
71     12  11.060437   4.815860   1.276571   0.000000   0.000000


Region =  north_plains
Descriptive statistics of MCS percent contribution to rainfall volume per month
    month        max        p95       mean         p5        min
12      1   0.000000   0.000000   0.000000   0.000000   0.000000
13      2   0.067095   0.016774   0.004193   0.000000   0.000000
14      3  23.236264  20.953898   4.158795   0.000000   0.000000
15      4  18.238463  15.455597   6.550299   0.360953   0.073768
16      5  40.194947  26.154059  15.072046   2.727780   1.050956
17      6  44.659093  43.748853  31.108918  19.148667  18.721182
18      7  40.366411  37.998337  27.391855  13.329186  11.011770
19      8  40.775719  38.569930  21.805017   7.573566   5.833055
20      9  33.153249  27.567606  12.086467   0.138457   0.000000
21     10  20.946414  20.552895   5.050312   0.000000   0.000000
22     11   4.508041   1.127010   0.281753   0.000000   0.000000
23     12   4.771321   1.192830   0.298208   0.000000   0.000000