{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python2.7/site-packages/matplotlib/rcsetup.py:342: UserWarning: axes.color_cycle is deprecated.  Use axes.prop_cycle instead. Will be removed in 2.1.0\n",
      "  warnings.warn(\"axes.color_cycle is deprecated.  Use axes.prop_cycle \"\n",
      "/usr/local/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.\n",
      "  warnings.warn(self.msg_depr % (key, alt_key))\n"
     ]
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "from mpl_toolkits.basemap import Basemap, shiftgrid\n",
    "import numpy as np\n",
    "import seaborn as sns\n",
    "import datetime\n",
    "import netCDF4\n",
    "import sys\n",
    "import math \n",
    "from pandas import DataFrame \n",
    "from numpy import ma\n",
    "\n",
    "\n",
    "\n",
    "# colors for the grassland, savanna, forest\n",
    "cmapbare = sns.light_palette(\"#7570b3\", n_colors=5, reverse=False, as_cmap=True)\n",
    "cmapsava = sns.light_palette(\"#d95f02\", n_colors=5, reverse=False, as_cmap=True)\n",
    "cmapfore = sns.light_palette(\"#1b9e77\", n_colors=10, reverse=False, as_cmap=True)\n",
    "colbare = '#7570b3'\n",
    "colsava = '#d95f02'\n",
    "colfore = '#1b9e77'\n",
    "\n",
    "def plot_north_polar(fig, data, lon, lat, blat = 45, lon0 = 60, res = 'l', clevs = np.arange(0), cmap =plt.cm.RdBu_r, par = np.arange(-90.,91.,20.), mer = np.arange(-180.,181.,20.), cbar=True):\n",
    "    m = Basemap(projection='npaeqd',boundinglat=blat,lon_0=lon0,resolution='l')\n",
    "    m.drawcoastlines()\n",
    "    #m.fillcontinents(color='coral',lake_color='aqua')\n",
    "    # draw parallels and meridians.\n",
    "    m.drawparallels(par)\n",
    "    m.drawmeridians(mer)\n",
    "    m.drawmapboundary(fill_color='white')\n",
    "    m.drawcoastlines(linewidth=1.5)\n",
    "    lons,lats = np.meshgrid(lon,lat)\n",
    "    x, y = m(lons,lats)\n",
    "    if (len(clevs)>0): \n",
    "        cs = m.contourf(x,y,data,clevs=clevs,cmap=cmap)\n",
    "    else:\n",
    "        cs = m.contourf(x,y,data,cmap=cmap)\n",
    "    \n",
    "    # cs2 = m.contour(x,y,data,,linewidths=0.5,colors='k',animated=True)\n",
    "    if (cbar==True): cb = m.colorbar(cs,\"right\", size=\"5%\", pad=\"4%\")\n",
    "    return m;\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# datasets\n",
    "\n",
    "path = '/Users/Beniamino/Documents/Datasets/Boreal/'\n",
    "\n",
    "# load netcdfs\n",
    "# Eurasia\n",
    "nc005ea_east = netCDF4.Dataset(path+'NEA_East_50_shift_Bor_MOD44B_V5__VCFFplusVCF__2010__0.05deg__UHAM-ICDC.nc')\n",
    "ncea_east = netCDF4.Dataset(path+'NEA_East_50_shift_Bor_MOD44B_V5__VCFFplusVCF__2010__0.5deg__UHAM-ICDC.nc')\n",
    "nc2ea_east = netCDF4.Dataset(path+'NEA_East_50_shift_Bor_MAR_cru_ts3.22.1998.2010.pre.dat.nc')\n",
    "nc3ea_east = netCDF4.Dataset(path+'NEA_East_50_seasonal_soilw.mon.mean.1998-2010.v2.nc')\n",
    "#nc3ea_east = netCDF4.Dataset(path+'NEA_East_shift_min_bor_yearmean_soilw.mon.mean.1998-2010.v2.nc')\n",
    "nc4ea_east = netCDF4.Dataset(path+'NEA_East_50_shift_0_bor_M6H_0.5_tmin.2m.gauss.1998-2010.nc')\n",
    "nc5ea_east = netCDF4.Dataset(path+'NEA_East_50_shift_bor_GLC2000_0.5.nc')\n",
    "nc6ea_east = netCDF4.Dataset(path+'NEA_East_50_shift_0_bor_0.5_PZI.nc')\n",
    "nc7ea_east = netCDF4.Dataset(path+'NEA_East_50_shift_masked_bor_0.5_Year_Fire_Frequency_1996-2012.nc')\n",
    "# nc8ea_east = netCDF4.Dataset(path+'NEA_East_shift_bor_0.5_Burned_1996-2012_SUM.nc')\n",
    "nc9ea_east = netCDF4.Dataset(path+'NEA_East_50_shift_Bor_ReBil_GloElev_05.nc')\n",
    "nc10ea_east = netCDF4.Dataset(path+'NEA_East_50_Boreal_Mean_GDD0_1998-2010_0.5.nc')\n",
    "nc11ea_east = netCDF4.Dataset(path+'NEA_East_50_Bor_Ease25_Northen_Emisphere_Mean_Thawing_Depth_1901-2002.nc')\n",
    "nc12ea_east = netCDF4.Dataset(path+'NEA_East_50_soil_texture_0.5.nc')\n",
    "                            \n",
    "nc005ea_west = netCDF4.Dataset(path+'NEA_West_Russia_50_shift_Bor_MOD44B_V5__VCFFplusVCF__2010__0.05deg__UHAM-ICDC.nc')\n",
    "ncea_west = netCDF4.Dataset(path+'NEA_West_Russia_50_shift_Bor_MOD44B_V5__VCFFplusVCF__2010__0.5deg__UHAM-ICDC.nc')\n",
    "nc2ea_west = netCDF4.Dataset(path+'NEA_West_Russia_50_shift_Bor_MAR_cru_ts3.22.1998.2010.pre.dat.nc')\n",
    "nc3ea_west = netCDF4.Dataset(path+'NEA_West_Russia_50_seasonal_soilw.mon.mean.1998-2010.v2.nc')\n",
    "#nc3ea_west = netCDF4.Dataset(path+'NEA_West_Russia_shift_min_bor_yearmean_soilw.mon.mean.1998-2010.v2.nc')\n",
    "nc4ea_west = netCDF4.Dataset(path+'NEA_West_Russia_50_shift_0_bor_M6H_0.5_tmin.2m.gauss.1998-2010.nc')\n",
    "nc5ea_west = netCDF4.Dataset(path+'NEA_West_Russia_50_shift_bor_GLC2000_0.5.nc')\n",
    "nc6ea_west = netCDF4.Dataset(path+'NEA_West_Russia_50_shift_0_bor_0.5_PZI.nc')\n",
    "nc7ea_west = netCDF4.Dataset(path+'NEA_West_Russia_50_shift_masked_bor_0.5_Year_Fire_Frequency_1996-2012.nc')\n",
    "# nc8ea_west = netCDF4.Dataset(path+'NEA_West_Russia_shift_bor_0.5_Burned_1996-2012_SUM.nc')\n",
    "nc9ea_west = netCDF4.Dataset(path+'NEA_West_Russia_50_shift_Bor_ReBil_GloElev_05.nc')\n",
    "nc10ea_west = netCDF4.Dataset(path+'NEA_West_Russia_50_Boreal_Mean_GDD0_1998-2010_0.5.nc')\n",
    "nc11ea_west = netCDF4.Dataset(path+'NEA_West_Russia_50_Bor_Ease25_Northen_Emisphere_Mean_Thawing_Depth_1901-2002.nc')\n",
    "nc12ea_west = netCDF4.Dataset(path+'NEA_West_Russia_50_soil_texture_0.5.nc')\n",
    "\n",
    "\n",
    "# North America\n",
    "nc005na_east = netCDF4.Dataset(path+'\\\n",
    "NA_West_shift_Bor_MOD44B_V5__VCFFplusVCF__2010__0.05deg__UHAM-ICDC.nc')\n",
    "ncna_east = netCDF4.Dataset(path+'\\\n",
    "NA_West_shift_Bor_MOD44B_V5__VCFFplusVCF__2010__0.5deg__UHAM-ICDC.nc')\n",
    "nc2na_east = netCDF4.Dataset(path+'NA_West_shift_Bor_MAR_cru_ts3.22.1998.2010.pre.dat.nc')\n",
    "nc3na_east = netCDF4.Dataset(path+'NA_West_seasonal_soilw.mon.mean.1998-2010.v2.nc')\n",
    "#nc3na_east = netCDF4.Dataset(path+'NA_West_shift_min_bor_yearmean_soilw.mon.mean.1998-2010.v2.nc')\n",
    "nc4na_east = netCDF4.Dataset(path+'NA_West_shift_0_bor_M6H_0.5_tmin.2m.gauss.1998-2010.nc')\n",
    "nc5na_east = netCDF4.Dataset(path+'NA_West_shift_bor_GLC2000_0.5.nc')\n",
    "nc6na_east = netCDF4.Dataset(path+'NA_West_shift_0_bor_0.5_PZI.nc')\n",
    "nc7na_east = netCDF4.Dataset(path+'NA_West_shift_masked_bor_0.5_Year_Fire_Frequency_1996-2012.nc')\n",
    "# nc8na_east = netCDF4.Dataset(path+'NA_West_shift_bor_0.5_Burned_1996-2012_SUM.nc')\n",
    "nc9na_east = netCDF4.Dataset(path+'NA_West_shift_Bor_ReBil_GloElev_05.nc')\n",
    "nc10na_east = netCDF4.Dataset(path+'NA_West_Boreal_Mean_GDD0_1998-2010_0.5.nc')\n",
    "nc11na_east = netCDF4.Dataset(path+'NA_West_Bor_Ease25_Northen_Emisphere_Mean_Thawing_Depth_1901-2002.nc')\n",
    "nc12na_east= netCDF4.Dataset(path+'NA_West_soil_texture_0.5.nc')\n",
    "nc13na_east = netCDF4.Dataset(path+'Terra_NA_West_MODIS_0.5_C6_GSSLAI_2000_2015_Decadal_Trend_SigOnly.nc')\n",
    "\n",
    "nc005na_west= netCDF4.Dataset(path+'\\\n",
    "NA_East_shift_Bor_MOD44B_V5__VCFFplusVCF__2010__0.05deg__UHAM-ICDC.nc')\n",
    "ncna_west= netCDF4.Dataset(path+'\\\n",
    "NA_East_shift_Bor_MOD44B_V5__VCFFplusVCF__2010__0.5deg__UHAM-ICDC.nc')\n",
    "nc2na_west= netCDF4.Dataset(path+'NA_East_shift_Bor_MAR_cru_ts3.22.1998.2010.pre.dat.nc')\n",
    "nc3na_west= netCDF4.Dataset(path+'NA_East_seasonal_soilw.mon.mean.1998-2010.v2.nc')\n",
    "#nc3na_west= netCDF4.Dataset(path+'NA_shift_min_bor_yearmean_soilw.mon.mean.1998-2010.v2.nc')\n",
    "nc4na_west= netCDF4.Dataset(path+'NA_East_shift_0_bor_M6H_0.5_tmin.2m.gauss.1998-2010.nc')\n",
    "nc5na_west= netCDF4.Dataset(path+'NA_East_shift_bor_GLC2000_0.5.nc')\n",
    "nc6na_west= netCDF4.Dataset(path+'NA_East_shift_0_bor_0.5_PZI.nc')\n",
    "nc7na_west= netCDF4.Dataset(path+'NA_East_shift_masked_bor_0.5_Year_Fire_Frequency_1996-2012.nc')\n",
    "# nc8na_west= netCDF4.Dataset(path+'NA_shift_bor_0.5_Burned_1996-2012_SUM.nc')\n",
    "nc9na_west= netCDF4.Dataset(path+'NA_East_shift_Bor_ReBil_GloElev_05.nc')\n",
    "nc10na_west= netCDF4.Dataset(path+'NA_East_Boreal_Mean_GDD0_1998-2010_0.5.nc')\n",
    "nc11na_west= netCDF4.Dataset(path+'NA_East_Bor_Ease25_Northen_Emisphere_Mean_Thawing_Depth_1901-2002.nc')\n",
    "nc12na_west= netCDF4.Dataset(path+'NA_East_soil_texture_0.5.nc')\n",
    "nc13na_west= netCDF4.Dataset(path+'Terra_NA_East_MODIS_0.5_C6_GSSLAI_2000_2015_Decadal_Trend_SigOnly.nc')\n",
    "\n",
    "\n",
    "# assign variables and coordinates\n",
    "\n",
    "lon_ea_east = ncea_east.variables['lon']#.tolist()\n",
    "lon_ea_west = ncea_west.variables['lon']\n",
    "lat_ea_east = ncea_east.variables['lat']\n",
    "lat_ea_west = ncea_west.variables['lat']\n",
    "lon005ea_east = nc005ea_east.variables['lon']#.tolist()\n",
    "lon005ea_west = nc005ea_west.variables['lon']\n",
    "lat005ea_east = nc005ea_east.variables['lat']\n",
    "\n",
    "\n",
    "vcff_ea_east = ncea_east.variables['vcff'][0]\n",
    "vcff005_ea_east = nc005ea_east.variables['vcff'][0]\n",
    "pcp_ea_east = nc2ea_east.variables['pre'][0]\n",
    "sm_ea_east = nc3ea_east.variables['soilw'][1]\n",
    "tm_ea_east = nc4ea_east.variables['tmin'][0]-273.15\n",
    "mask_ea_east = ma.getmask(tm_ea_east)\n",
    "glc_ea_east = ma.masked_array(nc5ea_east.variables['var'][:], mask_ea_east)\n",
    "pzi_ea_east = nc6ea_east.variables['pzi'][:]\n",
    "ff_ea_east = nc7ea_east.variables['firefreq'][:]\n",
    "# ba_ea_east = nc8ea_east.variables['burnedarea_east'][:]\n",
    "elev_ea_east = nc9ea_east.variables['elev'][:]\n",
    "gdd0_ea_east = nc10ea_east.variables['gdd0'][0]\n",
    "ptd_ea_east = nc11ea_east.variables['thw_depth'][0]\n",
    "st_ea_east= ma.masked_array(nc12ea_east.variables['var600'], mask_ea_east)\n",
    "\n",
    "\n",
    "vcff_ea_west = ncea_west.variables['vcff'][0]\n",
    "vcff005_ea_west = nc005ea_west.variables['vcff'][0]\n",
    "pcp_ea_west = nc2ea_west.variables['pre'][0]\n",
    "sm_ea_west = nc3ea_west.variables['soilw'][1]\n",
    "tm_ea_west = nc4ea_west.variables['tmin'][0]-273.15\n",
    "mask_ea_west = ma.getmask(tm_ea_west)\n",
    "glc_ea_west = ma.masked_array(nc5ea_west.variables['var'][:], mask_ea_west)\n",
    "pzi_ea_west = nc6ea_west.variables['pzi'][:]\n",
    "ff_ea_west = nc7ea_west.variables['firefreq'][:]\n",
    "# ba_ea_west = nc8ea_west.variables['burnedarea'][:]\n",
    "elev_ea_west = nc9ea_west.variables['elev'][:]\n",
    "gdd0_ea_west = nc10ea_west.variables['gdd0'][0]\n",
    "ptd_ea_west = nc11ea_west.variables['thw_depth'][0]\n",
    "st_ea_west= ma.masked_array(nc12ea_west.variables['var600'], mask_ea_west)\n",
    "\n",
    "lon_na_east= ncna_east.variables['lon']#.tolist()\n",
    "lon_na_west= ncna_west.variables['lon']\n",
    "lat_na_east = ncna_east.variables['lat']\n",
    "lat_na_west = ncna_west.variables['lat']\n",
    "lon005na_east= nc005na_east.variables['lon']#.tolist()\n",
    "lon005na_west= nc005na_west.variables['lon']\n",
    "lat005na_east= nc005na_east.variables['lat']\n",
    "\n",
    "\n",
    "vcff_na_east= ncna_east.variables['vcff'][0]\n",
    "vcff005_na_east= nc005na_east.variables['vcff'][0]\n",
    "pcp_na_east= nc2na_east.variables['pre'][0]\n",
    "sm_na_east= nc3na_east.variables['soilw'][1]\n",
    "tm_na_east= nc4na_east.variables['tmin'][0]-273.15\n",
    "mask_na_east = ma.getmask(tm_na_east)\n",
    "glc_na_east= ma.masked_array(nc5na_east.variables['var'][:], mask_na_east)\n",
    "pzi_na_east= nc6na_east.variables['pzi'][:]\n",
    "ff_na_east= nc7na_east.variables['firefreq'][:]\n",
    "# ba_na_east= nc8na_east.variables['burnedarea'][:]\n",
    "elev_na_east= nc9na_east.variables['elev'][:]\n",
    "gdd0_na_east= nc10na_east.variables['gdd0'][0]\n",
    "ptd_na_east= nc11na_east.variables['thw_depth'][0]\n",
    "lai_na_east= nc13na_east.variables['t_trend'][:]\n",
    "st_na_east= ma.masked_array(nc12na_east.variables['var600'], mask_na_east)\n",
    "\n",
    "\n",
    "vcff_na_west= ncna_west.variables['vcff'][0]\n",
    "vcff005_na_west= nc005na_west.variables['vcff'][0]\n",
    "pcp_na_west= nc2na_west.variables['pre'][0]\n",
    "sm_na_west= nc3na_west.variables['soilw'][1]\n",
    "tm_na_west= nc4na_west.variables['tmin'][0]-273.15\n",
    "mask_na_west = ma.getmask(tm_na_west)\n",
    "glc_na_west= ma.masked_array(nc5na_west.variables['var'][:], mask_na_west)\n",
    "pzi_na_west= nc6na_west.variables['pzi'][:]\n",
    "ff_na_west= nc7na_west.variables['firefreq'][:]\n",
    "# ba_na_west= nc8na_west.variables['burnedarea'][:]\n",
    "elev_na_west= nc9na_west.variables['elev'][:]\n",
    "gdd0_na_west= nc10na_west.variables['gdd0'][0]\n",
    "ptd_na_west= nc11na_west.variables['thw_depth'][0]\n",
    "lai_na_west= nc13na_west.variables['t_trend'][:]\n",
    "st_na_west= ma.masked_array(nc12na_west.variables['var600'], mask_na_west)\n",
    "\n",
    "# create new variable of state accordind to the results of the optimisation\n",
    "vcf_state_ea_east = np.empty(shape=vcff_ea_east.shape)\n",
    "for i in range(vcff_ea_east.shape[0]):\n",
    "    for j in range(vcff_ea_east.shape[1]):\n",
    "        if vcff_ea_east[i][j]<0: \n",
    "            vcf_state_ea_east[i][j] = 0  # null\n",
    "        elif vcff_ea_east[i][j]<10:\n",
    "            vcf_state_ea_east[i][j] = 1  # bare, the first peak\n",
    "        elif vcff_ea_east[i][j]<20:\n",
    "            vcf_state_ea_east[i][j] = 1  # bare\n",
    "        elif vcff_ea_east[i][j]<45:\n",
    "            vcf_state_ea_east[i][j] = 3  # savanna, the third peak\n",
    "        elif vcff_ea_east[i][j]<100:\n",
    "            vcf_state_ea_east[i][j] = 4  # forest, the fourth peak\n",
    "        else:\n",
    "            vcf_state_ea_east[i][j] = 5  # null\n",
    "\n",
    "\n",
    "            # create new variable of state accordind to the results of the optimisation\n",
    "vcf_state_ea_west = np.empty(shape=vcff_ea_west.shape)\n",
    "for i in range(vcff_ea_west.shape[0]):\n",
    "    for j in range(vcff_ea_west.shape[1]):\n",
    "        if vcff_ea_west[i][j]<0: \n",
    "            vcf_state_ea_west[i][j] = 0  # null\n",
    "        elif vcff_ea_west[i][j]<10:\n",
    "            vcf_state_ea_west[i][j] = 1  # bare, the first peak\n",
    "        elif vcff_ea_west[i][j]<20:\n",
    "            vcf_state_ea_west[i][j] = 1  # bare the second peak\n",
    "        elif vcff_ea_west[i][j]<45:\n",
    "            vcf_state_ea_west[i][j] = 3  # savanna, the third peak\n",
    "        elif vcff_ea_west[i][j]<100:\n",
    "            vcf_state_ea_west[i][j] = 4  # forest, the fourth peak\n",
    "        else:\n",
    "            vcf_state_ea_west[i][j] = 5  # null\n",
    "\n",
    "            \n",
    "vcf_state_na_east = np.empty(shape=vcff_na_east.shape)\n",
    "for i in range(vcff_na_east.shape[0]):\n",
    "    for j in range(vcff_na_east.shape[1]):\n",
    "        if vcff_na_east[i][j]<0: \n",
    "            vcf_state_na_east[i][j] = 0  # null\n",
    "        elif vcff_na_east[i][j]<10:\n",
    "            vcf_state_na_east[i][j] = 1  # bare, the first peak\n",
    "        elif vcff_na_east[i][j]<20:\n",
    "            vcf_state_na_east[i][j] = 1  # sparse savanna, the second peak\n",
    "        elif vcff_na_east[i][j]<45:\n",
    "            vcf_state_na_east[i][j] = 3  # savanna, the third peak\n",
    "        elif vcff_na_east[i][j]<100:\n",
    "            vcf_state_na_east[i][j] = 4  # forest, the fourth peak\n",
    "        else:\n",
    "            vcf_state_na_east[i][j] = 5  # null\n",
    "            \n",
    "            \n",
    "# create new variable of state accordind to the results of the optimisation\n",
    "vcf_state_na_west = np.empty(shape=vcff_na_west.shape)\n",
    "for i in range(vcff_na_west.shape[0]):\n",
    "    for j in range(vcff_na_west.shape[1]):\n",
    "        if vcff_na_west[i][j]<0: \n",
    "            vcf_state_na_west[i][j] = 0  # null\n",
    "        elif vcff_na_west[i][j]<10:\n",
    "            vcf_state_na_west[i][j] = 1  # bare, the first peak\n",
    "        elif vcff_na_west[i][j]<20:\n",
    "            vcf_state_na_west[i][j] = 1  # sparse savanna, the second peak\n",
    "        elif vcff_na_west[i][j]<45:\n",
    "            vcf_state_na_west[i][j] = 3  # savanna, the third peak\n",
    "        elif vcff_na_west[i][j]<100:\n",
    "            vcf_state_na_west[i][j] = 4  # forest, the fourth peak\n",
    "        else:\n",
    "            vcf_state_na_west[i][j] = 5  # null\n",
    "            \n",
    "vcf_state_na_east= ma.masked_array(vcf_state_na_east, mask_na_east)\n",
    "vcf_state_na_west= ma.masked_array(vcf_state_na_west, mask_na_west)\n",
    "vcf_state_ea_east= ma.masked_array(vcf_state_ea_east, mask_ea_east)\n",
    "vcf_state_ea_west= ma.masked_array(vcf_state_ea_west, mask_ea_west)\n",
    "        "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "Let's plot all the variables"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# North Polar Azimuthal Equidistant Projection of Soil Texture\n",
    "fig = plt.figure(figsize=(15,10))\n",
    "#ax = fig.add_subplot(111,frameon=True)\n",
    "fig.suptitle(\"North Polar Azimuthal Equidistant Projection of Soil Texture\")\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=st_ea_west, clevs=np.arange(0,16,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=st_ea_east, clevs=np.arange(0,16,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=st_na_east, clevs=np.arange(0,16,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=st_na_west, clevs=np.arange(0,16,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "\n",
    "# plt.savefig( '/Users/Beniamino/Documents/OneDrive/MPI-M/iPython_Notebooks/Pic/bor_vcf_'+str(picctr)+'.pdf',dpi=600, transparent=False)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# North Polar Azimuthal Equidistant Projection of VCFF\n",
    "fig = plt.figure(figsize=(15,10))\n",
    "#ax = fig.add_subplot(111,frameon=True)\n",
    "fig.suptitle(\"North Polar Azimuthal Equidistant Projection of TCF\")\n",
    "\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=vcff_ea_west, clevs=np.arange(0,90,15), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=vcff_ea_east, clevs=np.arange(0,90,15), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=vcff_na_east, clevs=np.arange(0,90,15), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=vcff_na_west, clevs=np.arange(0,90,15), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "\n",
    "# plt.savefig( '/Users/Beniamino/Documents/OneDrive/MPI-M/iPython_Notebooks/Pic/bor_vcf_'+str(picctr)+'.pdf',dpi=600, transparent=False)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# North Polar Azimuthal Equidistant Projection of Fire Frequency from GFEDv4\n",
    "fig = plt.figure(figsize=(12,12))\n",
    "#ax = fig.add_subplot(111,frameon=True)\n",
    "fig.suptitle(\"North Polar Azimuthal Equidistant Projection of Fire Frequency from GFEDv4\")\n",
    "\n",
    "\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=ff_ea_west, clevs=np.arange(0,5,0.1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=ff_ea_east, clevs=np.arange(0,5,0.1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=ff_na_east, clevs=np.arange(0,5,0.1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=ff_na_west, clevs=np.arange(0,5,0.1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "\n",
    "# plt.savefig( '/Users/Beniamino/Documents/OneDrive/MPI-M/iPython_Notebooks/Pic/bor_vcf_'+str(picctr)+'.pdf',dpi=600, transparent=False)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# North Polar Azimuthal Equidistant Projection of PTD\n",
    "fig = plt.figure(figsize=(12,12))\n",
    "#ax = fig.add_subplot(111,frameon=True)\n",
    "fig.suptitle(\"North Polar Azimuthal Equidistant Projection of PTD\")\n",
    "\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=ptd_ea_west, clevs=np.arange(0,5.5,0.5), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=ptd_ea_east, clevs=np.arange(0,5.5,0.5), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=ptd_na_east, clevs=np.arange(0,5.5,0.5), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=ptd_na_west, clevs=np.arange(0,5.5,0.5), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "\n",
    "#plt.savefig( '/Users/Beniamino/Documents/OneDrive/MPI-M/iPython_Notebooks/Pic/Meeting_Victor/bor_ptd_05.pdf',dpi=600, transparent=False)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# North Polar Azimuthal Equidistant Projection of Mean Daily (6h) TMIN from NCEP_Reanalysis 1998-2010\n",
    "\n",
    "fig = plt.figure(figsize=(12,12))\n",
    "fig.suptitle(\"North Polar Azimuthal Equidistant Projection of Mean Daily (6h) TMIN from NCEP_Reanalysis 1998-2010\")\n",
    "\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=tm_ea_west, clevs=np.arange(-36,18,6), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=tm_ea_east, clevs=np.arange(-36,18,6), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=tm_na_east, clevs=np.arange(-36,18,6), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=tm_na_west, clevs=np.arange(-36,18,6), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "\n",
    "#plt.savefig( '/Users/Beniamino/Documents/OneDrive/MPI-M/iPython_Notebooks/Pic/Meeting_Victor/bor_ptd_05.pdf',dpi=600, transparent=False)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# North Polar Azimuthal Equidistant Projection of MAR from CRU 1998-2010\n",
    "\n",
    "fig = plt.figure(figsize=(12,12))\n",
    "fig.suptitle(\"North Polar Azimuthal Equidistant Projection of MAR from CRU 1998-2010\")\n",
    "\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=pcp_ea_west, clevs=np.arange(0,2000,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=pcp_ea_east, clevs=np.arange(0,2000,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=pcp_na_east, clevs=np.arange(0,2000,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=pcp_na_west, clevs=np.arange(0,2000,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "\n",
    "#plt.savefig( '/Users/Beniamino/Documents/OneDrive/MPI-M/iPython_Notebooks/Pic/Meeting_Victor/bor_ptd_05.pdf',dpi=600, transparent=False)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# North Polar Azimuthal Equidistant Projection of CPC Soil Moisture data provided by the NOAA/OAR/ESRL PSD\n",
    "fig = plt.figure(figsize=(12,12))\n",
    "fig.suptitle(\"North Polar Azimuthal Equidistant Projection of CPC Soil Moisture data provided by the NOAA/OAR/ESRL PSD\")\n",
    "\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=sm_ea_west, clevs=np.arange(0,700,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=sm_ea_east, clevs=np.arange(0,700,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=sm_na_east, clevs=np.arange(0,700,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=sm_na_west, clevs=np.arange(0,700,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "\n",
    "#plt.savefig( '/Users/Beniamino/Documents/OneDrive/MPI-M/iPython_Notebooks/Pic/Meeting_Victor/bor_ptd_05.pdf',dpi=600, transparent=False)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# North Polar Azimuthal Equidistant Projection of PZI (Permafrost Zonation Index)\n",
    "fig = plt.figure(figsize=(12,12))\n",
    "fig.suptitle(\"North Polar Azimuthal Equidistant Projection of PZI (Permafrost Zonation Index)\")\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=pzi_ea_west, clevs=np.arange(0,1.05,0.05), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=pzi_ea_east, clevs=np.arange(0,1.05,0.05), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=pzi_na_east, clevs=np.arange(0,1.05,0.05), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=pzi_na_west, clevs=np.arange(0,1.05,0.05), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "\n",
    "#plt.savefig( '/Users/Beniamino/Documents/OneDrive/MPI-M/iPython_Notebooks/Pic/Meeting_Victor/bor_ptd_05.pdf',dpi=600, transparent=False)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# North Polar Azimuthal Equidistant Projection of Growing Degree Days 0 from NCEP Reanalysis\n",
    "fig = plt.figure(figsize=(12,12))\n",
    "ax = fig.add_subplot(111)\n",
    "ax.set_title(\"North Polar Azimuthal Equidistant Projection of GLC2000\")\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=glc_ea_west, clevs=np.arange(0,22,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=glc_ea_east, clevs=np.arange(0,22,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=glc_na_east, clevs=np.arange(0,22,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=glc_na_west, clevs=np.arange(0,22,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "\n",
    "#plt.savefig( '/Users/Beniamino/Documents/OneDrive/MPI-M/iPython_Notebooks/Pic/Meeting_Victor/bor_ptd_05.pdf',dpi=600, transparent=False)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# North Polar Azimuthal Equidistant Projection of Growing Degree Days 0 from NCEP Reanalysis\n",
    "fig = plt.figure(figsize=(12,12))\n",
    "ax = fig.add_subplot(111)\n",
    "ax.set_title(\"North Polar Azimuthal Equidistant Projection of Growing Degree Days 0 from NCEP Reanalysis at 0.5 degrees\")\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=gdd0_ea_west, clevs=np.arange(0,4250,250), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=gdd0_ea_east, clevs=np.arange(0,4250,250), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=gdd0_na_east, clevs=np.arange(0,4250,250), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=gdd0_na_west, clevs=np.arange(0,4250,250), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "\n",
    "#plt.savefig( '/Users/Beniamino/Documents/OneDrive/MPI-M/iPython_Notebooks/Pic/Meeting_Victor/bor_ptd_05.pdf',dpi=600, transparent=False)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# North Polar Azimuthal Equidistant Projection of Vegetation State\n",
    "fig = plt.figure(figsize=(12,12))\n",
    "#ax = fig.add_subplot(111,frameon=True)\n",
    "fig.suptitle(\"North Polar Azimuthal Equidistant Projection of Vegetation State\")\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=vcf_state_ea_west, clevs=np.array([1,2,3,4]), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=vcf_state_ea_east, clevs=np.array([1,2,3,4]), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=vcf_state_na_east, clevs=np.array([1,2,3,4]), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=vcf_state_na_west, clevs=np.array([1,2,3,4]), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "\n",
    "#plt.savefig( '/Users/Beniamino/Documents/OneDrive/MPI-M/iPython_Notebooks/Pic/Meeting_Victor/bor_ptd_05.pdf',dpi=600, transparent=False)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# Subplots with all\n",
    "fig = plt.figure(figsize=(18,14))\n",
    "\n",
    "ax = fig.add_subplot(341)\n",
    "ax.set_title('TCFF')\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=vcff_ea_west, clevs=np.arange(0,90,15), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=vcff_ea_east, clevs=np.arange(0,90,15), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=vcff_na_east, clevs=np.arange(0,90,15), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=vcff_na_west, clevs=np.arange(0,90,15), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "\n",
    "\n",
    "\n",
    "ax2 = fig.add_subplot(342)\n",
    "ax2.set_title('MAR')\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=pcp_ea_west, clevs=np.arange(0,2000,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=pcp_ea_east, clevs=np.arange(0,2000,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=pcp_na_east, clevs=np.arange(0,2000,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=pcp_na_west, clevs=np.arange(0,2000,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "\n",
    "\n",
    "\n",
    "ax3 = fig.add_subplot(343)\n",
    "ax3.set_title('MSSM')\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=sm_ea_west, clevs=np.arange(0,700,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=sm_ea_east, clevs=np.arange(0,700,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=sm_na_east, clevs=np.arange(0,700,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=sm_na_west, clevs=np.arange(0,700,100), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "\n",
    "\n",
    "\n",
    "ax4 = fig.add_subplot(344)\n",
    "ax4.set_title('MTmin')\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=tm_ea_west, clevs=np.arange(-36,18,6), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=tm_ea_east, clevs=np.arange(-36,18,6), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=tm_na_east, clevs=np.arange(-36,18,6), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=tm_na_west, clevs=np.arange(-36,18,6), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "\n",
    "\n",
    "\n",
    "ax5 = fig.add_subplot(345)\n",
    "ax5.set_title('FF')\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=ff_ea_west, clevs=np.arange(0,5,0.1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=ff_ea_east, clevs=np.arange(0,5,0.1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=ff_na_east, clevs=np.arange(0,5,0.1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=ff_na_west, clevs=np.arange(0,5,0.1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "\n",
    "\n",
    "\n",
    "ax6 = fig.add_subplot(346)\n",
    "ax6.set_title('PZI')\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=pzi_ea_west, clevs=np.arange(0,1.05,0.05), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=pzi_ea_east, clevs=np.arange(0,1.05,0.05), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=pzi_na_east, clevs=np.arange(0,1.05,0.05), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=pzi_na_west, clevs=np.arange(0,1.05,0.05), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "\n",
    "ax7 = fig.add_subplot(347)\n",
    "ax7.set_title('State')\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=vcf_state_ea_west, clevs=np.array([1,2,3,4]), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=vcf_state_ea_east, clevs=np.array([1,2,3,4]), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=vcf_state_na_east, clevs=np.array([1,2,3,4]), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=vcf_state_na_west, clevs=np.array([1,2,3,4]), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "\n",
    "ax8 = fig.add_subplot(348)\n",
    "ax8.set_title('GDD0')\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=gdd0_ea_west, clevs=np.arange(0,4250,250), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=gdd0_ea_east, clevs=np.arange(0,4250,250), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=gdd0_na_east, clevs=np.arange(0,4250,250), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=gdd0_na_west, clevs=np.arange(0,4250,250), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "\n",
    "ax9 = fig.add_subplot(3,4,9)\n",
    "ax9.set_title('ST')\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=st_ea_west, clevs=np.arange(0,16,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=st_ea_east, clevs=np.arange(0,16,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=st_na_east, clevs=np.arange(0,16,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=st_na_west, clevs=np.arange(0,16,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "\n",
    "ax10 = fig.add_subplot(3,4,10)\n",
    "ax10.set_title('PTD')\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=ptd_ea_west, clevs=np.arange(0,5.5,0.5), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=ptd_ea_east, clevs=np.arange(0,5.5,0.5), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=ptd_na_east, clevs=np.arange(0,5.5,0.5), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=ptd_na_west, clevs=np.arange(0,5.5,0.5), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "\n",
    "ax11 = fig.add_subplot(3,4,11)\n",
    "ax11.set_title('GLC')\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_west,lat=lat_ea_west,data=glc_ea_west, clevs=np.arange(0,22,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_ea_east,lat=lat_ea_east,data=glc_ea_east, clevs=np.arange(0,22,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_east,lat=lat_na_east,data=glc_na_east, clevs=np.arange(0,22,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=True)\n",
    "plot_north_polar(fig=fig, lon0=10,lon=lon_na_west,lat=lat_na_west,data=glc_na_west, clevs=np.arange(0,22,1), cmap='viridis', par = np.arange(-90.,91.,30.), mer = np.arange(-180.,181.,30.),cbar=False)\n",
    "\n",
    "#plt.savefig( '/Users/Beniamino/Documents/OneDrive/MPI-M/iPython_Notebooks/Pic/ea+na_bor_complete_'+str(picctr)+'.pdf',dpi=600, transparent=False)\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
