{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Volcanic Forcing in LME\n", "* Wenchang Yang (wenchang@prnceton.edu)\n", "* Department of Geosciences, Princeton University" ] }, { "cell_type": "code", "execution_count": 55, "metadata": { "ExecuteTime": { "end_time": "2019-03-13T21:25:20.849111Z", "start_time": "2019-03-13T21:25:20.841127Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "**2019-03-13T17:25:20.845591**\n", ">>> Importing Python 3.7.1 packages...\n", "[OK]: import sys, os, os.path, datetime, glob\n", "[OK]: import numpy as np-1.16.2\n", "[OK]: import matplotlib as mpl-3.0.3; backend: nbAgg\n", "[OK]: #---import matplotlib.pyplot as plt\n", "[OK]: #---from pylab import *\n", "[OK]: import xarray as xr-0.11.3\n", "[OK]: #---import netCDF4\n", "[OK]: #---import dask\n", "[OK]: #---import bottleneck\n", "[OK]: import pandas as pd-0.24.1\n", "[OK]: from mpl_toolkits.basemap import Basemap\n", " PROJ_LIB = /tigress/wenchang/miniconda3p7/share/proj\n", ">>>Import packages from Wenchang Yang (wython)...\n", "[OK]: import geoplots as gt\n", "[OK]: from geoplots import geoplot, fxyplot, mapplot, xticksyear\n", "[OK]: import geoxarray\n", "[OK]: import filter\n", "[OK]: import xlearn\n", "[OK]: import mysignal as sig\n", "**Done**\n" ] } ], "source": [ "%run -im pythonstartup" ] }, { "cell_type": "code", "execution_count": 28, "metadata": { "ExecuteTime": { "end_time": "2019-03-13T03:04:09.482504Z", "start_time": "2019-03-13T03:04:09.471149Z" } }, "outputs": [], "source": [ "%matplotlib notebook\n", "from cftime import DatetimeNoLeap" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2019-03-12T17:54:45.701019Z", "start_time": "2019-03-12T17:54:45.688626Z" }, "scrolled": true }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "
\n", "

Client

\n", "\n", "
\n", "

Cluster

\n", "
    \n", "
  • Workers: 4
  • \n", "
  • Cores: 16
  • \n", "
  • Memory: 162.00 GB
  • \n", "
\n", "
" ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from dask.distributed import Client\n", "client = Client('127.0.0.1:8982')\n", "client" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "ExecuteTime": { "end_time": "2019-03-12T17:56:58.987435Z", "start_time": "2019-03-12T17:56:58.976599Z" }, "code_folding": [ 1 ] }, "outputs": [], "source": [ "# functions\n", "def extract_volc_info(forcing_file, threshold=1e-6):\n", " '''extract volcanic eruption information'''\n", " ds = xr.open_dataset(forcing_file)\n", " print(forcing_file)\n", "\n", " # cftime_range\n", " s = ds.date[0].astype('int').astype('str').item()\n", " date_start = f'{int(s[:-4]):04d}' + '-' + s[-4:-2]\n", " print(date_start)\n", " s = ds.date[-1].astype('int').astype('str').item()\n", " date_end = f'{int(s[:-4]):04d}' + '-' + s[-4:-2]\n", " print(date_end)\n", " time_noleap = xr.cftime_range(date_start, date_end, freq='MS', calendar='noleap')\n", " # print('time_noleap:', time_noleap)\n", "\n", " # eruption start/end dates\n", " ts = ds.colmass.expand_dims('lon', axis=-1).geo.fldmean() \\\n", " .pipe(lambda x: (x>threshold).astype('int')) \\\n", " .assign_coords(time=time_noleap) \n", " t_erupt_starts = ts.diff(dim='time').pipe(lambda x: x[x==1]).time\n", " t_erupt_ends = ts.diff(dim='time', label='lower').pipe(lambda x: x[x==-1]).time\n", " # print('t_erupt_starts:', t_erupt_starts)\n", " # print('t_erupt_ends:', t_erupt_ends)\n", "\n", " # colmass global/NH-time-mean, global-mean-time-max/argmax(peak date)\n", " colmass_global = []\n", " colmass_nh = []\n", " colmass_peaks = []\n", " t_erupt_peaks = []\n", " for t0,t1 in zip(t_erupt_starts, t_erupt_ends):\n", " da = ds.colmass.assign_coords(time=time_noleap).sel(time=slice(t0, t1)).expand_dims('lon', axis=-1)\n", " g = da.geo.fldmean().sum('time').item()/12 #kg/m^2*year\n", " nh = da.sel(lat=slice(0,90)).geo.fldmean().sum('time').item()/12\n", " p = da.geo.fldmean().max('time').item()\n", " t_p = da.geo.fldmean().pipe(lambda x: x.isel(time=x.argmax('time')).time).item()\n", " colmass_global.append(g)\n", " colmass_nh.append(nh)\n", " colmass_peaks.append(p)\n", " t_erupt_peaks.append(t_p)\n", " # print(t0.item(), t1.item(), g, nh, p, t_p)\n", "\n", " # DataFrame\n", " df = pd.DataFrame({'t_erupt_start': t_erupt_starts,\n", " 't_erupt_peak': t_erupt_peaks,\n", " 't_erupt_end': t_erupt_ends,\n", " 'colmass_global': colmass_global,\n", " 'colmass_nh': colmass_nh,\n", " 'colmass_peak': colmass_peaks})\n", " \n", " df['colmass_sh'] = df['colmass_global'] * 2 - df['colmass_nh']\n", " df['colmass_asy'] = ( df['colmass_nh'] - df['colmass_sh'] )/2/df['colmass_global']\n", " \n", " return df" ] }, { "cell_type": "code", "execution_count": 185, "metadata": { "ExecuteTime": { "end_time": "2019-03-09T03:29:50.612708Z", "start_time": "2019-03-09T03:29:50.522326Z" } }, "outputs": [ { "data": { "text/plain": [ "\n", "Dimensions: (lat: 64, lev: 18, time: 18002)\n", "Coordinates:\n", " * time (time) float32 500.95834 501.0417 501.125 ... 2000.9584 2001.0416\n", " * lev (lev) float32 4.8093 13.073097 32.5591 ... 929.276 970.4459 992.528\n", " * lat (lat) float64 -87.86 -85.1 -82.31 -79.53 ... 79.53 82.31 85.1 87.86\n", "Data variables:\n", " MMRVOLC (time, lev, lat) float64 ...\n", " colmass (time, lat) float32 ...\n", " datesec (time) float64 ...\n", " date (time) float64 ...\n", "Attributes:\n", " title: IVI2LoadingLatHeight501-2000.bin converted to 18 pressure...\n", " reference: Gao,Robock,and Ammann,2008:J. Geophys. Res,doi:10.1029/20...\n", " created_by: hteng: copper.cgd.ucar.edu:/datalocal/ccpa/hteng/volcano/...\n", " creation_date: 2010-05-18\n", " modification: Z2P is based on ccsm4.p2z.nc, derived from b40.1850.track..." ] }, "execution_count": 185, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# data\n", "ifile = '/tigress/wenchang/data/cesm/LME/FORCING/IVI2LoadingLatHeight501-2000_L18_c20100518.nc'\n", "ds = xr.open_dataset(ifile)\n", "ds850 = ds\n", "ds" ] }, { "cell_type": "code", "execution_count": 186, "metadata": { "ExecuteTime": { "end_time": "2019-03-09T03:29:55.288256Z", "start_time": "2019-03-09T03:29:53.587169Z" } }, "outputs": [ { "data": { "text/plain": [ "CFTimeIndex([0500-12-01 00:00:00, 0501-01-01 00:00:00, 0501-02-01 00:00:00,\n", " 0501-03-01 00:00:00, 0501-04-01 00:00:00, 0501-05-01 00:00:00,\n", " 0501-06-01 00:00:00, 0501-07-01 00:00:00, 0501-08-01 00:00:00,\n", " 0501-09-01 00:00:00,\n", " ...\n", " 2000-04-01 00:00:00, 2000-05-01 00:00:00, 2000-06-01 00:00:00,\n", " 2000-07-01 00:00:00, 2000-08-01 00:00:00, 2000-09-01 00:00:00,\n", " 2000-10-01 00:00:00, 2000-11-01 00:00:00, 2000-12-01 00:00:00,\n", " 2001-01-01 00:00:00],\n", " dtype='object', length=18002)" ] }, "execution_count": 186, "metadata": {}, "output_type": "execute_result" } ], "source": [ "time_noleap = xr.cftime_range('0500-12', '2001-01', freq='MS', calendar='noleap')#.shift(14, 'D')\n", "time_noleap" ] }, { "cell_type": "code", "execution_count": 26, "metadata": { "ExecuteTime": { "end_time": "2019-03-08T19:37:45.143991Z", "start_time": "2019-03-08T19:37:44.846136Z" } }, "outputs": [ { "data": { "application/javascript": [ "/* Put everything inside the global mpl namespace */\n", "window.mpl = {};\n", "\n", "\n", "mpl.get_websocket_type = function() {\n", " if (typeof(WebSocket) !== 'undefined') {\n", " return WebSocket;\n", " } else if (typeof(MozWebSocket) !== 'undefined') {\n", " return MozWebSocket;\n", " } else {\n", " alert('Your browser does not have WebSocket support.' +\n", " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", " 'Firefox 4 and 5 are also supported but you ' +\n", " 'have to enable WebSockets in about:config.');\n", " };\n", "}\n", "\n", "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", " this.id = figure_id;\n", "\n", " this.ws = websocket;\n", "\n", " this.supports_binary = (this.ws.binaryType != undefined);\n", "\n", " if (!this.supports_binary) {\n", " var warnings = document.getElementById(\"mpl-warnings\");\n", " if (warnings) {\n", " warnings.style.display = 'block';\n", " warnings.textContent = (\n", " \"This browser does not support binary websocket messages. \" +\n", " \"Performance may be slow.\");\n", " }\n", " }\n", "\n", " this.imageObj = new Image();\n", "\n", " this.context = undefined;\n", " this.message = undefined;\n", " this.canvas = undefined;\n", " this.rubberband_canvas = undefined;\n", " this.rubberband_context = undefined;\n", " this.format_dropdown = undefined;\n", "\n", " this.image_mode = 'full';\n", "\n", " this.root = $('
');\n", " this._root_extra_style(this.root)\n", " this.root.attr('style', 'display: inline-block');\n", "\n", " $(parent_element).append(this.root);\n", "\n", " this._init_header(this);\n", " this._init_canvas(this);\n", " this._init_toolbar(this);\n", "\n", " var fig = this;\n", "\n", " this.waiting = false;\n", "\n", " this.ws.onopen = function () {\n", " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", " fig.send_message(\"send_image_mode\", {});\n", " if (mpl.ratio != 1) {\n", " fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n", " }\n", " fig.send_message(\"refresh\", {});\n", " }\n", "\n", " this.imageObj.onload = function() {\n", " if (fig.image_mode == 'full') {\n", " // Full images could contain transparency (where diff images\n", " // almost always do), so we need to clear the canvas so that\n", " // there is no ghosting.\n", " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", " }\n", " fig.context.drawImage(fig.imageObj, 0, 0);\n", " };\n", "\n", " this.imageObj.onunload = function() {\n", " fig.ws.close();\n", " }\n", "\n", " this.ws.onmessage = this._make_on_message_function(this);\n", "\n", " this.ondownload = ondownload;\n", "}\n", "\n", "mpl.figure.prototype._init_header = function() {\n", " var titlebar = $(\n", " '
');\n", " var titletext = $(\n", " '
');\n", " titlebar.append(titletext)\n", " this.root.append(titlebar);\n", " this.header = titletext[0];\n", "}\n", "\n", "\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "\n", "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "mpl.figure.prototype._init_canvas = function() {\n", " var fig = this;\n", "\n", " var canvas_div = $('
');\n", "\n", " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", "\n", " function canvas_keyboard_event(event) {\n", " return fig.key_event(event, event['data']);\n", " }\n", "\n", " canvas_div.keydown('key_press', canvas_keyboard_event);\n", " canvas_div.keyup('key_release', canvas_keyboard_event);\n", " this.canvas_div = canvas_div\n", " this._canvas_extra_style(canvas_div)\n", " this.root.append(canvas_div);\n", "\n", " var canvas = $('');\n", " canvas.addClass('mpl-canvas');\n", " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", "\n", " this.canvas = canvas[0];\n", " this.context = canvas[0].getContext(\"2d\");\n", "\n", " var backingStore = this.context.backingStorePixelRatio ||\n", "\tthis.context.webkitBackingStorePixelRatio ||\n", "\tthis.context.mozBackingStorePixelRatio ||\n", "\tthis.context.msBackingStorePixelRatio ||\n", "\tthis.context.oBackingStorePixelRatio ||\n", "\tthis.context.backingStorePixelRatio || 1;\n", "\n", " mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n", "\n", " var rubberband = $('');\n", " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", "\n", " var pass_mouse_events = true;\n", "\n", " canvas_div.resizable({\n", " start: function(event, ui) {\n", " pass_mouse_events = false;\n", " },\n", " resize: function(event, ui) {\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " stop: function(event, ui) {\n", " pass_mouse_events = true;\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " });\n", "\n", " function mouse_event_fn(event) {\n", " if (pass_mouse_events)\n", " return fig.mouse_event(event, event['data']);\n", " }\n", "\n", " rubberband.mousedown('button_press', mouse_event_fn);\n", " rubberband.mouseup('button_release', mouse_event_fn);\n", " // Throttle sequential mouse events to 1 every 20ms.\n", " rubberband.mousemove('motion_notify', mouse_event_fn);\n", "\n", " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", "\n", " canvas_div.on(\"wheel\", function (event) {\n", " event = event.originalEvent;\n", " event['data'] = 'scroll'\n", " if (event.deltaY < 0) {\n", " event.step = 1;\n", " } else {\n", " event.step = -1;\n", " }\n", " mouse_event_fn(event);\n", " });\n", "\n", " canvas_div.append(canvas);\n", " canvas_div.append(rubberband);\n", "\n", " this.rubberband = rubberband;\n", " this.rubberband_canvas = rubberband[0];\n", " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", " this.rubberband_context.strokeStyle = \"#000000\";\n", "\n", " this._resize_canvas = function(width, height) {\n", " // Keep the size of the canvas, canvas container, and rubber band\n", " // canvas in synch.\n", " canvas_div.css('width', width)\n", " canvas_div.css('height', height)\n", "\n", " canvas.attr('width', width * mpl.ratio);\n", " canvas.attr('height', height * mpl.ratio);\n", " canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n", "\n", " rubberband.attr('width', width);\n", " rubberband.attr('height', height);\n", " }\n", "\n", " // Set the figure to an initial 600x600px, this will subsequently be updated\n", " // upon first draw.\n", " this._resize_canvas(600, 600);\n", "\n", " // Disable right mouse context menu.\n", " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", " return false;\n", " });\n", "\n", " function set_focus () {\n", " canvas.focus();\n", " canvas_div.focus();\n", " }\n", "\n", " window.setTimeout(set_focus, 100);\n", "}\n", "\n", "mpl.figure.prototype._init_toolbar = function() {\n", " var fig = this;\n", "\n", " var nav_element = $('
')\n", " nav_element.attr('style', 'width: 100%');\n", " this.root.append(nav_element);\n", "\n", " // Define a callback function for later on.\n", " function toolbar_event(event) {\n", " return fig.toolbar_button_onclick(event['data']);\n", " }\n", " function toolbar_mouse_event(event) {\n", " return fig.toolbar_button_onmouseover(event['data']);\n", " }\n", "\n", " for(var toolbar_ind in mpl.toolbar_items) {\n", " var name = mpl.toolbar_items[toolbar_ind][0];\n", " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", " var image = mpl.toolbar_items[toolbar_ind][2];\n", " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", "\n", " if (!name) {\n", " // put a spacer in here.\n", " continue;\n", " }\n", " var button = $('');\n", " button.click(method_name, toolbar_event);\n", " button.mouseover(tooltip, toolbar_mouse_event);\n", " nav_element.append(button);\n", " }\n", "\n", " // Add the status bar.\n", " var status_bar = $('');\n", " nav_element.append(status_bar);\n", " this.message = status_bar[0];\n", "\n", " // Add the close button to the window.\n", " var buttongrp = $('
');\n", " var button = $('');\n", " button.click(function (evt) { fig.handle_close(fig, {}); } );\n", " button.mouseover('Stop Interaction', toolbar_mouse_event);\n", " buttongrp.append(button);\n", " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n", " titlebar.prepend(buttongrp);\n", "}\n", "\n", "mpl.figure.prototype._root_extra_style = function(el){\n", " var fig = this\n", " el.on(\"remove\", function(){\n", "\tfig.close_ws(fig, {});\n", " });\n", "}\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(el){\n", " // this is important to make the div 'focusable\n", " el.attr('tabindex', 0)\n", " // reach out to IPython and tell the keyboard manager to turn it's self\n", " // off when our div gets focus\n", "\n", " // location in version 3\n", " if (IPython.notebook.keyboard_manager) {\n", " IPython.notebook.keyboard_manager.register_events(el);\n", " }\n", " else {\n", " // location in version 2\n", " IPython.keyboard_manager.register_events(el);\n", " }\n", "\n", "}\n", "\n", "mpl.figure.prototype._key_event_extra = function(event, name) {\n", " var manager = IPython.notebook.keyboard_manager;\n", " if (!manager)\n", " manager = IPython.keyboard_manager;\n", "\n", " // Check for shift+enter\n", " if (event.shiftKey && event.which == 13) {\n", " this.canvas_div.blur();\n", " event.shiftKey = false;\n", " // Send a \"J\" for go to next cell\n", " event.which = 74;\n", " event.keyCode = 74;\n", " manager.command_mode();\n", " manager.handle_keydown(event);\n", " }\n", "}\n", "\n", "mpl.figure.prototype.handle_save = function(fig, msg) {\n", " fig.ondownload(fig, null);\n", "}\n", "\n", "\n", "mpl.find_output_cell = function(html_output) {\n", " // Return the cell and output element which can be found *uniquely* in the notebook.\n", " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n", " // IPython event is triggered only after the cells have been serialised, which for\n", " // our purposes (turning an active figure into a static one), is too late.\n", " var cells = IPython.notebook.get_cells();\n", " var ncells = cells.length;\n", " for (var i=0; i= 3 moved mimebundle to data attribute of output\n", " data = data.data;\n", " }\n", " if (data['text/html'] == html_output) {\n", " return [cell, data, j];\n", " }\n", " }\n", " }\n", " }\n", "}\n", "\n", "// Register the function which deals with the matplotlib target/channel.\n", "// The kernel may be null if the page has been refreshed.\n", "if (IPython.notebook.kernel != null) {\n", " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n", "}\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig_colmass()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "500-850" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "ExecuteTime": { "end_time": "2019-03-06T20:13:25.252952Z", "start_time": "2019-03-06T20:13:24.321268Z" } }, "outputs": [ { "data": { "application/javascript": [ "/* Put everything inside the global mpl namespace */\n", "window.mpl = {};\n", "\n", "\n", "mpl.get_websocket_type = function() {\n", " if (typeof(WebSocket) !== 'undefined') {\n", " return WebSocket;\n", " } else if (typeof(MozWebSocket) !== 'undefined') {\n", " return MozWebSocket;\n", " } else {\n", " alert('Your browser does not have WebSocket support.' +\n", " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", " 'Firefox 4 and 5 are also supported but you ' +\n", " 'have to enable WebSockets in about:config.');\n", " };\n", "}\n", "\n", "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", " this.id = figure_id;\n", "\n", " this.ws = websocket;\n", "\n", " this.supports_binary = (this.ws.binaryType != undefined);\n", "\n", " if (!this.supports_binary) {\n", " var warnings = document.getElementById(\"mpl-warnings\");\n", " if (warnings) {\n", " warnings.style.display = 'block';\n", " warnings.textContent = (\n", " \"This browser does not support binary websocket messages. \" +\n", " \"Performance may be slow.\");\n", " }\n", " }\n", "\n", " this.imageObj = new Image();\n", "\n", " this.context = undefined;\n", " this.message = undefined;\n", " this.canvas = undefined;\n", " this.rubberband_canvas = undefined;\n", " this.rubberband_context = undefined;\n", " this.format_dropdown = undefined;\n", "\n", " this.image_mode = 'full';\n", "\n", " this.root = $('
');\n", " this._root_extra_style(this.root)\n", " this.root.attr('style', 'display: inline-block');\n", "\n", " $(parent_element).append(this.root);\n", "\n", " this._init_header(this);\n", " this._init_canvas(this);\n", " this._init_toolbar(this);\n", "\n", " var fig = this;\n", "\n", " this.waiting = false;\n", "\n", " this.ws.onopen = function () {\n", " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", " fig.send_message(\"send_image_mode\", {});\n", " if (mpl.ratio != 1) {\n", " fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n", " }\n", " fig.send_message(\"refresh\", {});\n", " }\n", "\n", " this.imageObj.onload = function() {\n", " if (fig.image_mode == 'full') {\n", " // Full images could contain transparency (where diff images\n", " // almost always do), so we need to clear the canvas so that\n", " // there is no ghosting.\n", " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", " }\n", " fig.context.drawImage(fig.imageObj, 0, 0);\n", " };\n", "\n", " this.imageObj.onunload = function() {\n", " fig.ws.close();\n", " }\n", "\n", " this.ws.onmessage = this._make_on_message_function(this);\n", "\n", " this.ondownload = ondownload;\n", "}\n", "\n", "mpl.figure.prototype._init_header = function() {\n", " var titlebar = $(\n", " '
');\n", " var titletext = $(\n", " '
');\n", " titlebar.append(titletext)\n", " this.root.append(titlebar);\n", " this.header = titletext[0];\n", "}\n", "\n", "\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "\n", "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "mpl.figure.prototype._init_canvas = function() {\n", " var fig = this;\n", "\n", " var canvas_div = $('
');\n", "\n", " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", "\n", " function canvas_keyboard_event(event) {\n", " return fig.key_event(event, event['data']);\n", " }\n", "\n", " canvas_div.keydown('key_press', canvas_keyboard_event);\n", " canvas_div.keyup('key_release', canvas_keyboard_event);\n", " this.canvas_div = canvas_div\n", " this._canvas_extra_style(canvas_div)\n", " this.root.append(canvas_div);\n", "\n", " var canvas = $('');\n", " canvas.addClass('mpl-canvas');\n", " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", "\n", " this.canvas = canvas[0];\n", " this.context = canvas[0].getContext(\"2d\");\n", "\n", " var backingStore = this.context.backingStorePixelRatio ||\n", "\tthis.context.webkitBackingStorePixelRatio ||\n", "\tthis.context.mozBackingStorePixelRatio ||\n", "\tthis.context.msBackingStorePixelRatio ||\n", "\tthis.context.oBackingStorePixelRatio ||\n", "\tthis.context.backingStorePixelRatio || 1;\n", "\n", " mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n", "\n", " var rubberband = $('');\n", " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", "\n", " var pass_mouse_events = true;\n", "\n", " canvas_div.resizable({\n", " start: function(event, ui) {\n", " pass_mouse_events = false;\n", " },\n", " resize: function(event, ui) {\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " stop: function(event, ui) {\n", " pass_mouse_events = true;\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " });\n", "\n", " function mouse_event_fn(event) {\n", " if (pass_mouse_events)\n", " return fig.mouse_event(event, event['data']);\n", " }\n", "\n", " rubberband.mousedown('button_press', mouse_event_fn);\n", " rubberband.mouseup('button_release', mouse_event_fn);\n", " // Throttle sequential mouse events to 1 every 20ms.\n", " rubberband.mousemove('motion_notify', mouse_event_fn);\n", "\n", " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", "\n", " canvas_div.on(\"wheel\", function (event) {\n", " event = event.originalEvent;\n", " event['data'] = 'scroll'\n", " if (event.deltaY < 0) {\n", " event.step = 1;\n", " } else {\n", " event.step = -1;\n", " }\n", " mouse_event_fn(event);\n", " });\n", "\n", " canvas_div.append(canvas);\n", " canvas_div.append(rubberband);\n", "\n", " this.rubberband = rubberband;\n", " this.rubberband_canvas = rubberband[0];\n", " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", " this.rubberband_context.strokeStyle = \"#000000\";\n", "\n", " this._resize_canvas = function(width, height) {\n", " // Keep the size of the canvas, canvas container, and rubber band\n", " // canvas in synch.\n", " canvas_div.css('width', width)\n", " canvas_div.css('height', height)\n", "\n", " canvas.attr('width', width * mpl.ratio);\n", " canvas.attr('height', height * mpl.ratio);\n", " canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n", "\n", " rubberband.attr('width', width);\n", " rubberband.attr('height', height);\n", " }\n", "\n", " // Set the figure to an initial 600x600px, this will subsequently be updated\n", " // upon first draw.\n", " this._resize_canvas(600, 600);\n", "\n", " // Disable right mouse context menu.\n", " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", " return false;\n", " });\n", "\n", " function set_focus () {\n", " canvas.focus();\n", " canvas_div.focus();\n", " }\n", "\n", " window.setTimeout(set_focus, 100);\n", "}\n", "\n", "mpl.figure.prototype._init_toolbar = function() {\n", " var fig = this;\n", "\n", " var nav_element = $('
')\n", " nav_element.attr('style', 'width: 100%');\n", " this.root.append(nav_element);\n", "\n", " // Define a callback function for later on.\n", " function toolbar_event(event) {\n", " return fig.toolbar_button_onclick(event['data']);\n", " }\n", " function toolbar_mouse_event(event) {\n", " return fig.toolbar_button_onmouseover(event['data']);\n", " }\n", "\n", " for(var toolbar_ind in mpl.toolbar_items) {\n", " var name = mpl.toolbar_items[toolbar_ind][0];\n", " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", " var image = mpl.toolbar_items[toolbar_ind][2];\n", " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", "\n", " if (!name) {\n", " // put a spacer in here.\n", " continue;\n", " }\n", " var button = $('');\n", " button.click(method_name, toolbar_event);\n", " button.mouseover(tooltip, toolbar_mouse_event);\n", " nav_element.append(button);\n", " }\n", "\n", " // Add the status bar.\n", " var status_bar = $('');\n", " nav_element.append(status_bar);\n", " this.message = status_bar[0];\n", "\n", " // Add the close button to the window.\n", " var buttongrp = $('
');\n", " var button = $('');\n", " button.click(function (evt) { fig.handle_close(fig, {}); } );\n", " button.mouseover('Stop Interaction', toolbar_mouse_event);\n", " buttongrp.append(button);\n", " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n", " titlebar.prepend(buttongrp);\n", "}\n", "\n", "mpl.figure.prototype._root_extra_style = function(el){\n", " var fig = this\n", " el.on(\"remove\", function(){\n", "\tfig.close_ws(fig, {});\n", " });\n", "}\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(el){\n", " // this is important to make the div 'focusable\n", " el.attr('tabindex', 0)\n", " // reach out to IPython and tell the keyboard manager to turn it's self\n", " // off when our div gets focus\n", "\n", " // location in version 3\n", " if (IPython.notebook.keyboard_manager) {\n", " IPython.notebook.keyboard_manager.register_events(el);\n", " }\n", " else {\n", " // location in version 2\n", " IPython.keyboard_manager.register_events(el);\n", " }\n", "\n", "}\n", "\n", "mpl.figure.prototype._key_event_extra = function(event, name) {\n", " var manager = IPython.notebook.keyboard_manager;\n", " if (!manager)\n", " manager = IPython.keyboard_manager;\n", "\n", " // Check for shift+enter\n", " if (event.shiftKey && event.which == 13) {\n", " this.canvas_div.blur();\n", " event.shiftKey = false;\n", " // Send a \"J\" for go to next cell\n", " event.which = 74;\n", " event.keyCode = 74;\n", " manager.command_mode();\n", " manager.handle_keydown(event);\n", " }\n", "}\n", "\n", "mpl.figure.prototype.handle_save = function(fig, msg) {\n", " fig.ondownload(fig, null);\n", "}\n", "\n", "\n", "mpl.find_output_cell = function(html_output) {\n", " // Return the cell and output element which can be found *uniquely* in the notebook.\n", " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n", " // IPython event is triggered only after the cells have been serialised, which for\n", " // our purposes (turning an active figure into a static one), is too late.\n", " var cells = IPython.notebook.get_cells();\n", " var ncells = cells.length;\n", " for (var i=0; i= 3 moved mimebundle to data attribute of output\n", " data = data.data;\n", " }\n", " if (data['text/html'] == html_output) {\n", " return [cell, data, j];\n", " }\n", " }\n", " }\n", " }\n", "}\n", "\n", "// Register the function which deals with the matplotlib target/channel.\n", "// The kernel may be null if the page has been refreshed.\n", "if (IPython.notebook.kernel != null) {\n", " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n", "}\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig_colmass()\n", "\n", "plt.xlim(850, 1850)\n", "plt.xticks(range(850, 1851, 100));" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "850-1350" ] }, { "cell_type": "code", "execution_count": 38, "metadata": { "ExecuteTime": { "end_time": "2019-03-04T22:16:12.563335Z", "start_time": "2019-03-04T22:16:11.932962Z" } }, "outputs": [ { "data": { "application/javascript": [ "/* Put everything inside the global mpl namespace */\n", "window.mpl = {};\n", "\n", "\n", "mpl.get_websocket_type = function() {\n", " if (typeof(WebSocket) !== 'undefined') {\n", " return WebSocket;\n", " } else if (typeof(MozWebSocket) !== 'undefined') {\n", " return MozWebSocket;\n", " } else {\n", " alert('Your browser does not have WebSocket support.' +\n", " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", " 'Firefox 4 and 5 are also supported but you ' +\n", " 'have to enable WebSockets in about:config.');\n", " };\n", "}\n", "\n", "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", " this.id = figure_id;\n", "\n", " this.ws = websocket;\n", "\n", " this.supports_binary = (this.ws.binaryType != undefined);\n", "\n", " if (!this.supports_binary) {\n", " var warnings = document.getElementById(\"mpl-warnings\");\n", " if (warnings) {\n", " warnings.style.display = 'block';\n", " warnings.textContent = (\n", " \"This browser does not support binary websocket messages. \" +\n", " \"Performance may be slow.\");\n", " }\n", " }\n", "\n", " this.imageObj = new Image();\n", "\n", " this.context = undefined;\n", " this.message = undefined;\n", " this.canvas = undefined;\n", " this.rubberband_canvas = undefined;\n", " this.rubberband_context = undefined;\n", " this.format_dropdown = undefined;\n", "\n", " this.image_mode = 'full';\n", "\n", " this.root = $('
');\n", " this._root_extra_style(this.root)\n", " this.root.attr('style', 'display: inline-block');\n", "\n", " $(parent_element).append(this.root);\n", "\n", " this._init_header(this);\n", " this._init_canvas(this);\n", " this._init_toolbar(this);\n", "\n", " var fig = this;\n", "\n", " this.waiting = false;\n", "\n", " this.ws.onopen = function () {\n", " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", " fig.send_message(\"send_image_mode\", {});\n", " if (mpl.ratio != 1) {\n", " fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n", " }\n", " fig.send_message(\"refresh\", {});\n", " }\n", "\n", " this.imageObj.onload = function() {\n", " if (fig.image_mode == 'full') {\n", " // Full images could contain transparency (where diff images\n", " // almost always do), so we need to clear the canvas so that\n", " // there is no ghosting.\n", " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", " }\n", " fig.context.drawImage(fig.imageObj, 0, 0);\n", " };\n", "\n", " this.imageObj.onunload = function() {\n", " fig.ws.close();\n", " }\n", "\n", " this.ws.onmessage = this._make_on_message_function(this);\n", "\n", " this.ondownload = ondownload;\n", "}\n", "\n", "mpl.figure.prototype._init_header = function() {\n", " var titlebar = $(\n", " '
');\n", " var titletext = $(\n", " '
');\n", " titlebar.append(titletext)\n", " this.root.append(titlebar);\n", " this.header = titletext[0];\n", "}\n", "\n", "\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "\n", "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "mpl.figure.prototype._init_canvas = function() {\n", " var fig = this;\n", "\n", " var canvas_div = $('
');\n", "\n", " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", "\n", " function canvas_keyboard_event(event) {\n", " return fig.key_event(event, event['data']);\n", " }\n", "\n", " canvas_div.keydown('key_press', canvas_keyboard_event);\n", " canvas_div.keyup('key_release', canvas_keyboard_event);\n", " this.canvas_div = canvas_div\n", " this._canvas_extra_style(canvas_div)\n", " this.root.append(canvas_div);\n", "\n", " var canvas = $('');\n", " canvas.addClass('mpl-canvas');\n", " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", "\n", " this.canvas = canvas[0];\n", " this.context = canvas[0].getContext(\"2d\");\n", "\n", " var backingStore = this.context.backingStorePixelRatio ||\n", "\tthis.context.webkitBackingStorePixelRatio ||\n", "\tthis.context.mozBackingStorePixelRatio ||\n", "\tthis.context.msBackingStorePixelRatio ||\n", "\tthis.context.oBackingStorePixelRatio ||\n", "\tthis.context.backingStorePixelRatio || 1;\n", "\n", " mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n", "\n", " var rubberband = $('');\n", " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", "\n", " var pass_mouse_events = true;\n", "\n", " canvas_div.resizable({\n", " start: function(event, ui) {\n", " pass_mouse_events = false;\n", " },\n", " resize: function(event, ui) {\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " stop: function(event, ui) {\n", " pass_mouse_events = true;\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " });\n", "\n", " function mouse_event_fn(event) {\n", " if (pass_mouse_events)\n", " return fig.mouse_event(event, event['data']);\n", " }\n", "\n", " rubberband.mousedown('button_press', mouse_event_fn);\n", " rubberband.mouseup('button_release', mouse_event_fn);\n", " // Throttle sequential mouse events to 1 every 20ms.\n", " rubberband.mousemove('motion_notify', mouse_event_fn);\n", "\n", " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", "\n", " canvas_div.on(\"wheel\", function (event) {\n", " event = event.originalEvent;\n", " event['data'] = 'scroll'\n", " if (event.deltaY < 0) {\n", " event.step = 1;\n", " } else {\n", " event.step = -1;\n", " }\n", " mouse_event_fn(event);\n", " });\n", "\n", " canvas_div.append(canvas);\n", " canvas_div.append(rubberband);\n", "\n", " this.rubberband = rubberband;\n", " this.rubberband_canvas = rubberband[0];\n", " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", " this.rubberband_context.strokeStyle = \"#000000\";\n", "\n", " this._resize_canvas = function(width, height) {\n", " // Keep the size of the canvas, canvas container, and rubber band\n", " // canvas in synch.\n", " canvas_div.css('width', width)\n", " canvas_div.css('height', height)\n", "\n", " canvas.attr('width', width * mpl.ratio);\n", " canvas.attr('height', height * mpl.ratio);\n", " canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n", "\n", " rubberband.attr('width', width);\n", " rubberband.attr('height', height);\n", " }\n", "\n", " // Set the figure to an initial 600x600px, this will subsequently be updated\n", " // upon first draw.\n", " this._resize_canvas(600, 600);\n", "\n", " // Disable right mouse context menu.\n", " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", " return false;\n", " });\n", "\n", " function set_focus () {\n", " canvas.focus();\n", " canvas_div.focus();\n", " }\n", "\n", " window.setTimeout(set_focus, 100);\n", "}\n", "\n", "mpl.figure.prototype._init_toolbar = function() {\n", " var fig = this;\n", "\n", " var nav_element = $('
')\n", " nav_element.attr('style', 'width: 100%');\n", " this.root.append(nav_element);\n", "\n", " // Define a callback function for later on.\n", " function toolbar_event(event) {\n", " return fig.toolbar_button_onclick(event['data']);\n", " }\n", " function toolbar_mouse_event(event) {\n", " return fig.toolbar_button_onmouseover(event['data']);\n", " }\n", "\n", " for(var toolbar_ind in mpl.toolbar_items) {\n", " var name = mpl.toolbar_items[toolbar_ind][0];\n", " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", " var image = mpl.toolbar_items[toolbar_ind][2];\n", " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", "\n", " if (!name) {\n", " // put a spacer in here.\n", " continue;\n", " }\n", " var button = $('');\n", " button.click(method_name, toolbar_event);\n", " button.mouseover(tooltip, toolbar_mouse_event);\n", " nav_element.append(button);\n", " }\n", "\n", " // Add the status bar.\n", " var status_bar = $('');\n", " nav_element.append(status_bar);\n", " this.message = status_bar[0];\n", "\n", " // Add the close button to the window.\n", " var buttongrp = $('
');\n", " var button = $('');\n", " button.click(function (evt) { fig.handle_close(fig, {}); } );\n", " button.mouseover('Stop Interaction', toolbar_mouse_event);\n", " buttongrp.append(button);\n", " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n", " titlebar.prepend(buttongrp);\n", "}\n", "\n", "mpl.figure.prototype._root_extra_style = function(el){\n", " var fig = this\n", " el.on(\"remove\", function(){\n", "\tfig.close_ws(fig, {});\n", " });\n", "}\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(el){\n", " // this is important to make the div 'focusable\n", " el.attr('tabindex', 0)\n", " // reach out to IPython and tell the keyboard manager to turn it's self\n", " // off when our div gets focus\n", "\n", " // location in version 3\n", " if (IPython.notebook.keyboard_manager) {\n", " IPython.notebook.keyboard_manager.register_events(el);\n", " }\n", " else {\n", " // location in version 2\n", " IPython.keyboard_manager.register_events(el);\n", " }\n", "\n", "}\n", "\n", "mpl.figure.prototype._key_event_extra = function(event, name) {\n", " var manager = IPython.notebook.keyboard_manager;\n", " if (!manager)\n", " manager = IPython.keyboard_manager;\n", "\n", " // Check for shift+enter\n", " if (event.shiftKey && event.which == 13) {\n", " this.canvas_div.blur();\n", " event.shiftKey = false;\n", " // Send a \"J\" for go to next cell\n", " event.which = 74;\n", " event.keyCode = 74;\n", " manager.command_mode();\n", " manager.handle_keydown(event);\n", " }\n", "}\n", "\n", "mpl.figure.prototype.handle_save = function(fig, msg) {\n", " fig.ondownload(fig, null);\n", "}\n", "\n", "\n", "mpl.find_output_cell = function(html_output) {\n", " // Return the cell and output element which can be found *uniquely* in the notebook.\n", " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n", " // IPython event is triggered only after the cells have been serialised, which for\n", " // our purposes (turning an active figure into a static one), is too late.\n", " var cells = IPython.notebook.get_cells();\n", " var ncells = cells.length;\n", " for (var i=0; i= 3 moved mimebundle to data attribute of output\n", " data = data.data;\n", " }\n", " if (data['text/html'] == html_output) {\n", " return [cell, data, j];\n", " }\n", " }\n", " }\n", " }\n", "}\n", "\n", "// Register the function which deals with the matplotlib target/channel.\n", "// The kernel may be null if the page has been refreshed.\n", "if (IPython.notebook.kernel != null) {\n", " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n", "}\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "year = 1350\n", "fig_colmass()\n", "\n", "plt.xlim(year, year+500)\n", "plt.xticks(range(year, year+501, 50));" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1850-2000" ] }, { "cell_type": "code", "execution_count": 24, "metadata": { "ExecuteTime": { "end_time": "2019-03-04T20:15:19.239820Z", "start_time": "2019-03-04T20:15:18.536215Z" } }, "outputs": [ { "data": { "application/javascript": [ "/* Put everything inside the global mpl namespace */\n", "window.mpl = {};\n", "\n", "\n", "mpl.get_websocket_type = function() {\n", " if (typeof(WebSocket) !== 'undefined') {\n", " return WebSocket;\n", " } else if (typeof(MozWebSocket) !== 'undefined') {\n", " return MozWebSocket;\n", " } else {\n", " alert('Your browser does not have WebSocket support.' +\n", " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", " 'Firefox 4 and 5 are also supported but you ' +\n", " 'have to enable WebSockets in about:config.');\n", " };\n", "}\n", "\n", "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", " this.id = figure_id;\n", "\n", " this.ws = websocket;\n", "\n", " this.supports_binary = (this.ws.binaryType != undefined);\n", "\n", " if (!this.supports_binary) {\n", " var warnings = document.getElementById(\"mpl-warnings\");\n", " if (warnings) {\n", " warnings.style.display = 'block';\n", " warnings.textContent = (\n", " \"This browser does not support binary websocket messages. \" +\n", " \"Performance may be slow.\");\n", " }\n", " }\n", "\n", " this.imageObj = new Image();\n", "\n", " this.context = undefined;\n", " this.message = undefined;\n", " this.canvas = undefined;\n", " this.rubberband_canvas = undefined;\n", " this.rubberband_context = undefined;\n", " this.format_dropdown = undefined;\n", "\n", " this.image_mode = 'full';\n", "\n", " this.root = $('
');\n", " this._root_extra_style(this.root)\n", " this.root.attr('style', 'display: inline-block');\n", "\n", " $(parent_element).append(this.root);\n", "\n", " this._init_header(this);\n", " this._init_canvas(this);\n", " this._init_toolbar(this);\n", "\n", " var fig = this;\n", "\n", " this.waiting = false;\n", "\n", " this.ws.onopen = function () {\n", " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", " fig.send_message(\"send_image_mode\", {});\n", " if (mpl.ratio != 1) {\n", " fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n", " }\n", " fig.send_message(\"refresh\", {});\n", " }\n", "\n", " this.imageObj.onload = function() {\n", " if (fig.image_mode == 'full') {\n", " // Full images could contain transparency (where diff images\n", " // almost always do), so we need to clear the canvas so that\n", " // there is no ghosting.\n", " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", " }\n", " fig.context.drawImage(fig.imageObj, 0, 0);\n", " };\n", "\n", " this.imageObj.onunload = function() {\n", " fig.ws.close();\n", " }\n", "\n", " this.ws.onmessage = this._make_on_message_function(this);\n", "\n", " this.ondownload = ondownload;\n", "}\n", "\n", "mpl.figure.prototype._init_header = function() {\n", " var titlebar = $(\n", " '
');\n", " var titletext = $(\n", " '
');\n", " titlebar.append(titletext)\n", " this.root.append(titlebar);\n", " this.header = titletext[0];\n", "}\n", "\n", "\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "\n", "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "mpl.figure.prototype._init_canvas = function() {\n", " var fig = this;\n", "\n", " var canvas_div = $('
');\n", "\n", " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", "\n", " function canvas_keyboard_event(event) {\n", " return fig.key_event(event, event['data']);\n", " }\n", "\n", " canvas_div.keydown('key_press', canvas_keyboard_event);\n", " canvas_div.keyup('key_release', canvas_keyboard_event);\n", " this.canvas_div = canvas_div\n", " this._canvas_extra_style(canvas_div)\n", " this.root.append(canvas_div);\n", "\n", " var canvas = $('');\n", " canvas.addClass('mpl-canvas');\n", " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", "\n", " this.canvas = canvas[0];\n", " this.context = canvas[0].getContext(\"2d\");\n", "\n", " var backingStore = this.context.backingStorePixelRatio ||\n", "\tthis.context.webkitBackingStorePixelRatio ||\n", "\tthis.context.mozBackingStorePixelRatio ||\n", "\tthis.context.msBackingStorePixelRatio ||\n", "\tthis.context.oBackingStorePixelRatio ||\n", "\tthis.context.backingStorePixelRatio || 1;\n", "\n", " mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n", "\n", " var rubberband = $('');\n", " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", "\n", " var pass_mouse_events = true;\n", "\n", " canvas_div.resizable({\n", " start: function(event, ui) {\n", " pass_mouse_events = false;\n", " },\n", " resize: function(event, ui) {\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " stop: function(event, ui) {\n", " pass_mouse_events = true;\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " });\n", "\n", " function mouse_event_fn(event) {\n", " if (pass_mouse_events)\n", " return fig.mouse_event(event, event['data']);\n", " }\n", "\n", " rubberband.mousedown('button_press', mouse_event_fn);\n", " rubberband.mouseup('button_release', mouse_event_fn);\n", " // Throttle sequential mouse events to 1 every 20ms.\n", " rubberband.mousemove('motion_notify', mouse_event_fn);\n", "\n", " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", "\n", " canvas_div.on(\"wheel\", function (event) {\n", " event = event.originalEvent;\n", " event['data'] = 'scroll'\n", " if (event.deltaY < 0) {\n", " event.step = 1;\n", " } else {\n", " event.step = -1;\n", " }\n", " mouse_event_fn(event);\n", " });\n", "\n", " canvas_div.append(canvas);\n", " canvas_div.append(rubberband);\n", "\n", " this.rubberband = rubberband;\n", " this.rubberband_canvas = rubberband[0];\n", " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", " this.rubberband_context.strokeStyle = \"#000000\";\n", "\n", " this._resize_canvas = function(width, height) {\n", " // Keep the size of the canvas, canvas container, and rubber band\n", " // canvas in synch.\n", " canvas_div.css('width', width)\n", " canvas_div.css('height', height)\n", "\n", " canvas.attr('width', width * mpl.ratio);\n", " canvas.attr('height', height * mpl.ratio);\n", " canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n", "\n", " rubberband.attr('width', width);\n", " rubberband.attr('height', height);\n", " }\n", "\n", " // Set the figure to an initial 600x600px, this will subsequently be updated\n", " // upon first draw.\n", " this._resize_canvas(600, 600);\n", "\n", " // Disable right mouse context menu.\n", " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", " return false;\n", " });\n", "\n", " function set_focus () {\n", " canvas.focus();\n", " canvas_div.focus();\n", " }\n", "\n", " window.setTimeout(set_focus, 100);\n", "}\n", "\n", "mpl.figure.prototype._init_toolbar = function() {\n", " var fig = this;\n", "\n", " var nav_element = $('
')\n", " nav_element.attr('style', 'width: 100%');\n", " this.root.append(nav_element);\n", "\n", " // Define a callback function for later on.\n", " function toolbar_event(event) {\n", " return fig.toolbar_button_onclick(event['data']);\n", " }\n", " function toolbar_mouse_event(event) {\n", " return fig.toolbar_button_onmouseover(event['data']);\n", " }\n", "\n", " for(var toolbar_ind in mpl.toolbar_items) {\n", " var name = mpl.toolbar_items[toolbar_ind][0];\n", " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", " var image = mpl.toolbar_items[toolbar_ind][2];\n", " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", "\n", " if (!name) {\n", " // put a spacer in here.\n", " continue;\n", " }\n", " var button = $('');\n", " button.click(method_name, toolbar_event);\n", " button.mouseover(tooltip, toolbar_mouse_event);\n", " nav_element.append(button);\n", " }\n", "\n", " // Add the status bar.\n", " var status_bar = $('');\n", " nav_element.append(status_bar);\n", " this.message = status_bar[0];\n", "\n", " // Add the close button to the window.\n", " var buttongrp = $('
');\n", " var button = $('');\n", " button.click(function (evt) { fig.handle_close(fig, {}); } );\n", " button.mouseover('Stop Interaction', toolbar_mouse_event);\n", " buttongrp.append(button);\n", " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n", " titlebar.prepend(buttongrp);\n", "}\n", "\n", "mpl.figure.prototype._root_extra_style = function(el){\n", " var fig = this\n", " el.on(\"remove\", function(){\n", "\tfig.close_ws(fig, {});\n", " });\n", "}\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(el){\n", " // this is important to make the div 'focusable\n", " el.attr('tabindex', 0)\n", " // reach out to IPython and tell the keyboard manager to turn it's self\n", " // off when our div gets focus\n", "\n", " // location in version 3\n", " if (IPython.notebook.keyboard_manager) {\n", " IPython.notebook.keyboard_manager.register_events(el);\n", " }\n", " else {\n", " // location in version 2\n", " IPython.keyboard_manager.register_events(el);\n", " }\n", "\n", "}\n", "\n", "mpl.figure.prototype._key_event_extra = function(event, name) {\n", " var manager = IPython.notebook.keyboard_manager;\n", " if (!manager)\n", " manager = IPython.keyboard_manager;\n", "\n", " // Check for shift+enter\n", " if (event.shiftKey && event.which == 13) {\n", " this.canvas_div.blur();\n", " event.shiftKey = false;\n", " // Send a \"J\" for go to next cell\n", " event.which = 74;\n", " event.keyCode = 74;\n", " manager.command_mode();\n", " manager.handle_keydown(event);\n", " }\n", "}\n", "\n", "mpl.figure.prototype.handle_save = function(fig, msg) {\n", " fig.ondownload(fig, null);\n", "}\n", "\n", "\n", "mpl.find_output_cell = function(html_output) {\n", " // Return the cell and output element which can be found *uniquely* in the notebook.\n", " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n", " // IPython event is triggered only after the cells have been serialised, which for\n", " // our purposes (turning an active figure into a static one), is too late.\n", " var cells = IPython.notebook.get_cells();\n", " var ncells = cells.length;\n", " for (var i=0; i= 3 moved mimebundle to data attribute of output\n", " data = data.data;\n", " }\n", " if (data['text/html'] == html_output) {\n", " return [cell, data, j];\n", " }\n", " }\n", " }\n", " }\n", "}\n", "\n", "// Register the function which deals with the matplotlib target/channel.\n", "// The kernel may be null if the page has been refreshed.\n", "if (IPython.notebook.kernel != null) {\n", " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n", "}\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "year = 1850\n", "fig_colmass(1850)\n", "\n", "plt.xlim(year, year+150)\n", "plt.xticks(range(year, year+151, 10));" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Extract volcanic information" ] }, { "cell_type": "code", "execution_count": 56, "metadata": { "ExecuteTime": { "end_time": "2019-03-13T21:25:33.140113Z", "start_time": "2019-03-13T21:25:27.453317Z" }, "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/tigress/wenchang/data/cesm/LME/FORCING/IVI2LoadingLatHeight501-2000_L18_c20100518.nc\n", "0500-12\n", "2001-01\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
t_erupt_startt_erupt_peakt_erupt_endcolmass_globalcolmass_nhcolmass_peakcolmass_shcolmass_asy
00529-04-01 00:00:000529-08-01 00:00:000532-08-01 00:00:000.0001132.026442e-040.0001252.315369e-050.794917
10541-04-01 00:00:000541-08-01 00:00:000544-05-01 00:00:000.0001043.263668e-050.0001181.744260e-04-0.684765
20567-04-01 00:00:000567-08-01 00:00:000569-09-01 00:00:000.0000224.356267e-050.0000255.477810e-070.975163
30577-04-01 00:00:000577-08-01 00:00:000580-03-01 00:00:000.0000712.227172e-050.0000811.189075e-04-0.684490
40589-05-01 00:00:000589-08-01 00:00:000590-09-01 00:00:000.0000047.833807e-060.0000051.024969e-070.974170
50619-04-01 00:00:000619-08-01 00:00:000621-10-01 00:00:000.0000275.388382e-050.0000316.764060e-070.975205
60664-04-01 00:00:000664-08-01 00:00:000667-02-01 00:00:000.0000523.901986e-050.0000596.480486e-05-0.248351
70738-04-01 00:00:000738-08-01 00:00:000741-04-01 00:00:000.0000924.108671e-050.0001051.433544e-04-0.554473
80744-04-01 00:00:000744-08-01 00:00:000746-05-01 00:00:000.0000132.534226e-050.0000153.226538e-070.974856
90747-04-01 00:00:000747-08-01 00:00:000749-06-01 00:00:000.0000206.463222e-060.0000243.408199e-05-0.681184
100854-04-01 00:00:000854-08-01 00:00:000856-12-01 00:00:000.0000434.501645e-050.0000494.152421e-050.040354
110870-04-01 00:00:000870-08-01 00:00:000872-12-01 00:00:000.0000435.408524e-050.0000493.194513e-050.257352
120877-05-01 00:00:000877-08-01 00:00:000878-12-01 00:00:000.0000071.299239e-050.0000081.661124e-070.974752
130893-05-01 00:00:000893-08-01 00:00:000894-09-01 00:00:000.0000048.209603e-060.0000051.074138e-070.974170
140898-05-01 00:00:000898-08-01 00:00:000900-01-01 00:00:000.0000071.459036e-050.0000091.854664e-070.974896
150901-04-01 00:00:000901-08-01 00:00:000903-12-01 00:00:000.0000405.558245e-050.0000452.413676e-050.394456
160929-04-01 00:00:000929-08-01 00:00:000931-06-01 00:00:000.0000206.319425e-060.0000233.332373e-05-0.681185
170933-04-01 00:00:000933-08-01 00:00:000936-02-01 00:00:000.0000531.053543e-040.0000591.316601e-060.975315
180939-05-01 00:00:000939-08-01 00:00:000940-05-01 00:00:000.0000038.441268e-070.0000044.183065e-06-0.664176
190945-04-01 00:00:000945-08-01 00:00:000946-11-01 00:00:000.0000072.192159e-060.0000081.103105e-05-0.668438
200961-04-01 00:00:000961-08-01 00:00:000963-10-01 00:00:000.0000322.148286e-050.0000374.305554e-05-0.334261
210987-04-01 00:00:000987-08-01 00:00:000989-05-01 00:00:000.0000132.653378e-050.0000153.335095e-070.975174
221001-04-01 00:00:001001-08-01 00:00:001003-12-01 00:00:000.0000424.596448e-050.0000483.780502e-050.097404
231018-04-01 00:00:001018-08-01 00:00:001020-04-01 00:00:000.0000112.252248e-050.0000132.878802e-070.974759
241030-04-01 00:00:001030-08-01 00:00:001032-04-01 00:00:000.0000144.493319e-060.0000172.357978e-05-0.679884
251040-05-01 00:00:001040-08-01 00:00:001041-10-01 00:00:000.0000048.175199e-060.0000051.050989e-070.974615
261050-04-01 00:00:001050-08-01 00:00:001051-11-01 00:00:000.0000062.048224e-060.0000081.046166e-05-0.672543
271060-05-01 00:00:001060-08-01 00:00:001061-09-01 00:00:000.0000047.429114e-060.0000059.720203e-080.974170
281081-04-01 00:00:001081-08-01 00:00:001083-11-01 00:00:000.0000345.014625e-050.0000391.851391e-050.460709
291094-04-01 00:00:001094-08-01 00:00:001096-03-01 00:00:000.0000123.735065e-060.0000141.953655e-05-0.679003
...........................
601526-05-01 00:00:001526-08-01 00:00:001527-11-01 00:00:000.0000051.060070e-050.0000071.364122e-070.974591
611534-06-01 00:00:001534-10-01 00:00:001536-03-01 00:00:000.0000092.869441e-060.0000111.478345e-05-0.674904
621584-04-01 00:00:001584-08-01 00:00:001586-12-01 00:00:000.0000407.988886e-050.0000451.000327e-060.975267
631593-04-01 00:00:001593-08-01 00:00:001595-07-01 00:00:000.0000237.235609e-060.0000273.823186e-05-0.681724
641600-02-01 00:00:001600-06-01 00:00:001603-04-01 00:00:000.0001031.617934e-040.0001144.496620e-050.565039
651619-04-01 00:00:001619-08-01 00:00:001621-03-01 00:00:000.0000123.922569e-060.0000152.051730e-05-0.679002
661641-01-01 00:00:001641-05-01 00:00:001644-03-01 00:00:000.0001001.265452e-040.0001107.393494e-050.262421
671673-05-01 00:00:001673-09-01 00:00:001675-11-01 00:00:000.0000342.825870e-050.0000393.973589e-05-0.168796
681693-06-01 00:00:001693-10-01 00:00:001696-04-01 00:00:000.0000652.072703e-050.0000751.098490e-04-0.682529
691711-04-01 00:00:001711-08-01 00:00:001713-02-01 00:00:000.0000092.883126e-060.0000111.501112e-05-0.677759
701719-04-01 00:00:001719-08-01 00:00:001722-02-01 00:00:000.0000531.043603e-040.0000591.304180e-060.975315
711729-08-01 00:00:001729-12-01 00:00:001731-11-01 00:00:000.0000203.951664e-050.0000214.906217e-070.975473
721738-08-01 00:00:001738-12-01 00:00:001740-04-01 00:00:000.0000082.473585e-060.0000091.261453e-05-0.672115
731755-10-01 00:00:001756-02-01 00:00:001757-10-01 00:00:000.0000132.577917e-050.0000143.218071e-070.975341
741761-09-01 00:00:001762-01-01 00:00:001765-03-01 00:00:000.0001583.118259e-040.0001663.835303e-060.975700
751794-04-01 00:00:001794-07-01 00:00:001795-07-01 00:00:000.0000041.287637e-060.0000056.602085e-06-0.673591
761796-04-01 00:00:001796-08-01 00:00:001798-03-01 00:00:000.0000112.117954e-050.0000122.718477e-070.974655
771809-04-01 00:00:001809-08-01 00:00:001812-07-01 00:00:000.0001111.132430e-040.0001241.077773e-040.024729
781815-04-01 00:00:001815-08-01 00:00:001818-11-01 00:00:000.0002242.362341e-040.0002522.119986e-040.054069
791831-04-01 00:00:001831-08-01 00:00:001833-10-01 00:00:000.0000285.585518e-050.0000327.011525e-070.975205
801835-01-01 00:00:001835-05-01 00:00:001838-01-01 00:00:000.0000789.857815e-050.0000865.721119e-050.265531
811861-12-01 00:00:001862-04-01 00:00:001863-10-01 00:00:000.0000103.175462e-060.0000121.623796e-05-0.672859
821883-05-01 00:00:001883-09-01 00:00:001886-02-01 00:00:000.0000454.473754e-050.0000504.511664e-05-0.004219
831886-08-01 00:00:001886-12-01 00:00:001888-01-01 00:00:000.0000041.394950e-060.0000056.943251e-06-0.665407
841902-10-01 00:00:001903-02-01 00:00:001904-07-01 00:00:000.0000092.819365e-060.0000111.435302e-05-0.671640
851911-06-01 00:00:001911-10-01 00:00:001913-09-01 00:00:000.0000183.574544e-050.0000194.508745e-070.975087
861925-02-01 00:00:001925-06-01 00:00:001927-01-01 00:00:000.0000112.106193e-050.0000122.664004e-070.975019
871963-02-01 00:00:001963-06-01 00:00:001965-09-01 00:00:000.0000393.353101e-050.0000444.496449e-05-0.145658
881976-02-01 00:00:001976-05-01 00:00:001977-10-01 00:00:000.0000071.458572e-050.0000091.831574e-070.975197
891991-04-01 00:00:001991-08-01 00:00:001994-03-01 00:00:000.0000626.124807e-050.0000706.191395e-05-0.005407
\n", "

90 rows × 8 columns

\n", "
" ], "text/plain": [ " t_erupt_start t_erupt_peak t_erupt_end \\\n", "0 0529-04-01 00:00:00 0529-08-01 00:00:00 0532-08-01 00:00:00 \n", "1 0541-04-01 00:00:00 0541-08-01 00:00:00 0544-05-01 00:00:00 \n", "2 0567-04-01 00:00:00 0567-08-01 00:00:00 0569-09-01 00:00:00 \n", "3 0577-04-01 00:00:00 0577-08-01 00:00:00 0580-03-01 00:00:00 \n", "4 0589-05-01 00:00:00 0589-08-01 00:00:00 0590-09-01 00:00:00 \n", "5 0619-04-01 00:00:00 0619-08-01 00:00:00 0621-10-01 00:00:00 \n", "6 0664-04-01 00:00:00 0664-08-01 00:00:00 0667-02-01 00:00:00 \n", "7 0738-04-01 00:00:00 0738-08-01 00:00:00 0741-04-01 00:00:00 \n", "8 0744-04-01 00:00:00 0744-08-01 00:00:00 0746-05-01 00:00:00 \n", "9 0747-04-01 00:00:00 0747-08-01 00:00:00 0749-06-01 00:00:00 \n", "10 0854-04-01 00:00:00 0854-08-01 00:00:00 0856-12-01 00:00:00 \n", "11 0870-04-01 00:00:00 0870-08-01 00:00:00 0872-12-01 00:00:00 \n", "12 0877-05-01 00:00:00 0877-08-01 00:00:00 0878-12-01 00:00:00 \n", "13 0893-05-01 00:00:00 0893-08-01 00:00:00 0894-09-01 00:00:00 \n", "14 0898-05-01 00:00:00 0898-08-01 00:00:00 0900-01-01 00:00:00 \n", "15 0901-04-01 00:00:00 0901-08-01 00:00:00 0903-12-01 00:00:00 \n", "16 0929-04-01 00:00:00 0929-08-01 00:00:00 0931-06-01 00:00:00 \n", "17 0933-04-01 00:00:00 0933-08-01 00:00:00 0936-02-01 00:00:00 \n", "18 0939-05-01 00:00:00 0939-08-01 00:00:00 0940-05-01 00:00:00 \n", "19 0945-04-01 00:00:00 0945-08-01 00:00:00 0946-11-01 00:00:00 \n", "20 0961-04-01 00:00:00 0961-08-01 00:00:00 0963-10-01 00:00:00 \n", "21 0987-04-01 00:00:00 0987-08-01 00:00:00 0989-05-01 00:00:00 \n", "22 1001-04-01 00:00:00 1001-08-01 00:00:00 1003-12-01 00:00:00 \n", "23 1018-04-01 00:00:00 1018-08-01 00:00:00 1020-04-01 00:00:00 \n", "24 1030-04-01 00:00:00 1030-08-01 00:00:00 1032-04-01 00:00:00 \n", "25 1040-05-01 00:00:00 1040-08-01 00:00:00 1041-10-01 00:00:00 \n", "26 1050-04-01 00:00:00 1050-08-01 00:00:00 1051-11-01 00:00:00 \n", "27 1060-05-01 00:00:00 1060-08-01 00:00:00 1061-09-01 00:00:00 \n", "28 1081-04-01 00:00:00 1081-08-01 00:00:00 1083-11-01 00:00:00 \n", "29 1094-04-01 00:00:00 1094-08-01 00:00:00 1096-03-01 00:00:00 \n", ".. ... ... ... \n", "60 1526-05-01 00:00:00 1526-08-01 00:00:00 1527-11-01 00:00:00 \n", "61 1534-06-01 00:00:00 1534-10-01 00:00:00 1536-03-01 00:00:00 \n", "62 1584-04-01 00:00:00 1584-08-01 00:00:00 1586-12-01 00:00:00 \n", "63 1593-04-01 00:00:00 1593-08-01 00:00:00 1595-07-01 00:00:00 \n", "64 1600-02-01 00:00:00 1600-06-01 00:00:00 1603-04-01 00:00:00 \n", "65 1619-04-01 00:00:00 1619-08-01 00:00:00 1621-03-01 00:00:00 \n", "66 1641-01-01 00:00:00 1641-05-01 00:00:00 1644-03-01 00:00:00 \n", "67 1673-05-01 00:00:00 1673-09-01 00:00:00 1675-11-01 00:00:00 \n", "68 1693-06-01 00:00:00 1693-10-01 00:00:00 1696-04-01 00:00:00 \n", "69 1711-04-01 00:00:00 1711-08-01 00:00:00 1713-02-01 00:00:00 \n", "70 1719-04-01 00:00:00 1719-08-01 00:00:00 1722-02-01 00:00:00 \n", "71 1729-08-01 00:00:00 1729-12-01 00:00:00 1731-11-01 00:00:00 \n", "72 1738-08-01 00:00:00 1738-12-01 00:00:00 1740-04-01 00:00:00 \n", "73 1755-10-01 00:00:00 1756-02-01 00:00:00 1757-10-01 00:00:00 \n", "74 1761-09-01 00:00:00 1762-01-01 00:00:00 1765-03-01 00:00:00 \n", "75 1794-04-01 00:00:00 1794-07-01 00:00:00 1795-07-01 00:00:00 \n", "76 1796-04-01 00:00:00 1796-08-01 00:00:00 1798-03-01 00:00:00 \n", "77 1809-04-01 00:00:00 1809-08-01 00:00:00 1812-07-01 00:00:00 \n", "78 1815-04-01 00:00:00 1815-08-01 00:00:00 1818-11-01 00:00:00 \n", "79 1831-04-01 00:00:00 1831-08-01 00:00:00 1833-10-01 00:00:00 \n", "80 1835-01-01 00:00:00 1835-05-01 00:00:00 1838-01-01 00:00:00 \n", "81 1861-12-01 00:00:00 1862-04-01 00:00:00 1863-10-01 00:00:00 \n", "82 1883-05-01 00:00:00 1883-09-01 00:00:00 1886-02-01 00:00:00 \n", "83 1886-08-01 00:00:00 1886-12-01 00:00:00 1888-01-01 00:00:00 \n", "84 1902-10-01 00:00:00 1903-02-01 00:00:00 1904-07-01 00:00:00 \n", "85 1911-06-01 00:00:00 1911-10-01 00:00:00 1913-09-01 00:00:00 \n", "86 1925-02-01 00:00:00 1925-06-01 00:00:00 1927-01-01 00:00:00 \n", "87 1963-02-01 00:00:00 1963-06-01 00:00:00 1965-09-01 00:00:00 \n", "88 1976-02-01 00:00:00 1976-05-01 00:00:00 1977-10-01 00:00:00 \n", "89 1991-04-01 00:00:00 1991-08-01 00:00:00 1994-03-01 00:00:00 \n", "\n", " colmass_global colmass_nh colmass_peak colmass_sh colmass_asy \n", "0 0.000113 2.026442e-04 0.000125 2.315369e-05 0.794917 \n", "1 0.000104 3.263668e-05 0.000118 1.744260e-04 -0.684765 \n", "2 0.000022 4.356267e-05 0.000025 5.477810e-07 0.975163 \n", "3 0.000071 2.227172e-05 0.000081 1.189075e-04 -0.684490 \n", "4 0.000004 7.833807e-06 0.000005 1.024969e-07 0.974170 \n", "5 0.000027 5.388382e-05 0.000031 6.764060e-07 0.975205 \n", "6 0.000052 3.901986e-05 0.000059 6.480486e-05 -0.248351 \n", "7 0.000092 4.108671e-05 0.000105 1.433544e-04 -0.554473 \n", "8 0.000013 2.534226e-05 0.000015 3.226538e-07 0.974856 \n", "9 0.000020 6.463222e-06 0.000024 3.408199e-05 -0.681184 \n", "10 0.000043 4.501645e-05 0.000049 4.152421e-05 0.040354 \n", "11 0.000043 5.408524e-05 0.000049 3.194513e-05 0.257352 \n", "12 0.000007 1.299239e-05 0.000008 1.661124e-07 0.974752 \n", "13 0.000004 8.209603e-06 0.000005 1.074138e-07 0.974170 \n", "14 0.000007 1.459036e-05 0.000009 1.854664e-07 0.974896 \n", "15 0.000040 5.558245e-05 0.000045 2.413676e-05 0.394456 \n", "16 0.000020 6.319425e-06 0.000023 3.332373e-05 -0.681185 \n", "17 0.000053 1.053543e-04 0.000059 1.316601e-06 0.975315 \n", "18 0.000003 8.441268e-07 0.000004 4.183065e-06 -0.664176 \n", "19 0.000007 2.192159e-06 0.000008 1.103105e-05 -0.668438 \n", "20 0.000032 2.148286e-05 0.000037 4.305554e-05 -0.334261 \n", "21 0.000013 2.653378e-05 0.000015 3.335095e-07 0.975174 \n", "22 0.000042 4.596448e-05 0.000048 3.780502e-05 0.097404 \n", "23 0.000011 2.252248e-05 0.000013 2.878802e-07 0.974759 \n", "24 0.000014 4.493319e-06 0.000017 2.357978e-05 -0.679884 \n", "25 0.000004 8.175199e-06 0.000005 1.050989e-07 0.974615 \n", "26 0.000006 2.048224e-06 0.000008 1.046166e-05 -0.672543 \n", "27 0.000004 7.429114e-06 0.000005 9.720203e-08 0.974170 \n", "28 0.000034 5.014625e-05 0.000039 1.851391e-05 0.460709 \n", "29 0.000012 3.735065e-06 0.000014 1.953655e-05 -0.679003 \n", ".. ... ... ... ... ... \n", "60 0.000005 1.060070e-05 0.000007 1.364122e-07 0.974591 \n", "61 0.000009 2.869441e-06 0.000011 1.478345e-05 -0.674904 \n", "62 0.000040 7.988886e-05 0.000045 1.000327e-06 0.975267 \n", "63 0.000023 7.235609e-06 0.000027 3.823186e-05 -0.681724 \n", "64 0.000103 1.617934e-04 0.000114 4.496620e-05 0.565039 \n", "65 0.000012 3.922569e-06 0.000015 2.051730e-05 -0.679002 \n", "66 0.000100 1.265452e-04 0.000110 7.393494e-05 0.262421 \n", "67 0.000034 2.825870e-05 0.000039 3.973589e-05 -0.168796 \n", "68 0.000065 2.072703e-05 0.000075 1.098490e-04 -0.682529 \n", "69 0.000009 2.883126e-06 0.000011 1.501112e-05 -0.677759 \n", "70 0.000053 1.043603e-04 0.000059 1.304180e-06 0.975315 \n", "71 0.000020 3.951664e-05 0.000021 4.906217e-07 0.975473 \n", "72 0.000008 2.473585e-06 0.000009 1.261453e-05 -0.672115 \n", "73 0.000013 2.577917e-05 0.000014 3.218071e-07 0.975341 \n", "74 0.000158 3.118259e-04 0.000166 3.835303e-06 0.975700 \n", "75 0.000004 1.287637e-06 0.000005 6.602085e-06 -0.673591 \n", "76 0.000011 2.117954e-05 0.000012 2.718477e-07 0.974655 \n", "77 0.000111 1.132430e-04 0.000124 1.077773e-04 0.024729 \n", "78 0.000224 2.362341e-04 0.000252 2.119986e-04 0.054069 \n", "79 0.000028 5.585518e-05 0.000032 7.011525e-07 0.975205 \n", "80 0.000078 9.857815e-05 0.000086 5.721119e-05 0.265531 \n", "81 0.000010 3.175462e-06 0.000012 1.623796e-05 -0.672859 \n", "82 0.000045 4.473754e-05 0.000050 4.511664e-05 -0.004219 \n", "83 0.000004 1.394950e-06 0.000005 6.943251e-06 -0.665407 \n", "84 0.000009 2.819365e-06 0.000011 1.435302e-05 -0.671640 \n", "85 0.000018 3.574544e-05 0.000019 4.508745e-07 0.975087 \n", "86 0.000011 2.106193e-05 0.000012 2.664004e-07 0.975019 \n", "87 0.000039 3.353101e-05 0.000044 4.496449e-05 -0.145658 \n", "88 0.000007 1.458572e-05 0.000009 1.831574e-07 0.975197 \n", "89 0.000062 6.124807e-05 0.000070 6.191395e-05 -0.005407 \n", "\n", "[90 rows x 8 columns]" ] }, "execution_count": 56, "metadata": {}, "output_type": "execute_result" } ], "source": [ "forcing_file = '/tigress/wenchang/data/cesm/LME/FORCING/IVI2LoadingLatHeight501-2000_L18_c20100518.nc'\n", "ofile = 'eruptions_pre1850.csv'\n", "df = extract_volc_info(forcing_file, threshold=1e-6)\n", "df.to_csv(ofile)\n", "# df = pd.read_csv(ofile, index_col=0)\n", "df500 = df\n", "df" ] }, { "cell_type": "code", "execution_count": 266, "metadata": { "ExecuteTime": { "end_time": "2019-03-09T14:53:45.037223Z", "start_time": "2019-03-09T14:53:41.706210Z" }, "code_folding": [ 0 ] }, "outputs": [ { "data": { "application/javascript": [ "/* Put everything inside the global mpl namespace */\n", "window.mpl = {};\n", "\n", "\n", "mpl.get_websocket_type = function() {\n", " if (typeof(WebSocket) !== 'undefined') {\n", " return WebSocket;\n", " } else if (typeof(MozWebSocket) !== 'undefined') {\n", " return MozWebSocket;\n", " } else {\n", " alert('Your browser does not have WebSocket support.' +\n", " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", " 'Firefox 4 and 5 are also supported but you ' +\n", " 'have to enable WebSockets in about:config.');\n", " };\n", "}\n", "\n", "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", " this.id = figure_id;\n", "\n", " this.ws = websocket;\n", "\n", " this.supports_binary = (this.ws.binaryType != undefined);\n", "\n", " if (!this.supports_binary) {\n", " var warnings = document.getElementById(\"mpl-warnings\");\n", " if (warnings) {\n", " warnings.style.display = 'block';\n", " warnings.textContent = (\n", " \"This browser does not support binary websocket messages. \" +\n", " \"Performance may be slow.\");\n", " }\n", " }\n", "\n", " this.imageObj = new Image();\n", "\n", " this.context = undefined;\n", " this.message = undefined;\n", " this.canvas = undefined;\n", " this.rubberband_canvas = undefined;\n", " this.rubberband_context = undefined;\n", " this.format_dropdown = undefined;\n", "\n", " this.image_mode = 'full';\n", "\n", " this.root = $('
');\n", " this._root_extra_style(this.root)\n", " this.root.attr('style', 'display: inline-block');\n", "\n", " $(parent_element).append(this.root);\n", "\n", " this._init_header(this);\n", " this._init_canvas(this);\n", " this._init_toolbar(this);\n", "\n", " var fig = this;\n", "\n", " this.waiting = false;\n", "\n", " this.ws.onopen = function () {\n", " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", " fig.send_message(\"send_image_mode\", {});\n", " if (mpl.ratio != 1) {\n", " fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n", " }\n", " fig.send_message(\"refresh\", {});\n", " }\n", "\n", " this.imageObj.onload = function() {\n", " if (fig.image_mode == 'full') {\n", " // Full images could contain transparency (where diff images\n", " // almost always do), so we need to clear the canvas so that\n", " // there is no ghosting.\n", " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", " }\n", " fig.context.drawImage(fig.imageObj, 0, 0);\n", " };\n", "\n", " this.imageObj.onunload = function() {\n", " fig.ws.close();\n", " }\n", "\n", " this.ws.onmessage = this._make_on_message_function(this);\n", "\n", " this.ondownload = ondownload;\n", "}\n", "\n", "mpl.figure.prototype._init_header = function() {\n", " var titlebar = $(\n", " '
');\n", " var titletext = $(\n", " '
');\n", " titlebar.append(titletext)\n", " this.root.append(titlebar);\n", " this.header = titletext[0];\n", "}\n", "\n", "\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "\n", "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "mpl.figure.prototype._init_canvas = function() {\n", " var fig = this;\n", "\n", " var canvas_div = $('
');\n", "\n", " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", "\n", " function canvas_keyboard_event(event) {\n", " return fig.key_event(event, event['data']);\n", " }\n", "\n", " canvas_div.keydown('key_press', canvas_keyboard_event);\n", " canvas_div.keyup('key_release', canvas_keyboard_event);\n", " this.canvas_div = canvas_div\n", " this._canvas_extra_style(canvas_div)\n", " this.root.append(canvas_div);\n", "\n", " var canvas = $('');\n", " canvas.addClass('mpl-canvas');\n", " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", "\n", " this.canvas = canvas[0];\n", " this.context = canvas[0].getContext(\"2d\");\n", "\n", " var backingStore = this.context.backingStorePixelRatio ||\n", "\tthis.context.webkitBackingStorePixelRatio ||\n", "\tthis.context.mozBackingStorePixelRatio ||\n", "\tthis.context.msBackingStorePixelRatio ||\n", "\tthis.context.oBackingStorePixelRatio ||\n", "\tthis.context.backingStorePixelRatio || 1;\n", "\n", " mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n", "\n", " var rubberband = $('');\n", " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", "\n", " var pass_mouse_events = true;\n", "\n", " canvas_div.resizable({\n", " start: function(event, ui) {\n", " pass_mouse_events = false;\n", " },\n", " resize: function(event, ui) {\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " stop: function(event, ui) {\n", " pass_mouse_events = true;\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " });\n", "\n", " function mouse_event_fn(event) {\n", " if (pass_mouse_events)\n", " return fig.mouse_event(event, event['data']);\n", " }\n", "\n", " rubberband.mousedown('button_press', mouse_event_fn);\n", " rubberband.mouseup('button_release', mouse_event_fn);\n", " // Throttle sequential mouse events to 1 every 20ms.\n", " rubberband.mousemove('motion_notify', mouse_event_fn);\n", "\n", " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", "\n", " canvas_div.on(\"wheel\", function (event) {\n", " event = event.originalEvent;\n", " event['data'] = 'scroll'\n", " if (event.deltaY < 0) {\n", " event.step = 1;\n", " } else {\n", " event.step = -1;\n", " }\n", " mouse_event_fn(event);\n", " });\n", "\n", " canvas_div.append(canvas);\n", " canvas_div.append(rubberband);\n", "\n", " this.rubberband = rubberband;\n", " this.rubberband_canvas = rubberband[0];\n", " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", " this.rubberband_context.strokeStyle = \"#000000\";\n", "\n", " this._resize_canvas = function(width, height) {\n", " // Keep the size of the canvas, canvas container, and rubber band\n", " // canvas in synch.\n", " canvas_div.css('width', width)\n", " canvas_div.css('height', height)\n", "\n", " canvas.attr('width', width * mpl.ratio);\n", " canvas.attr('height', height * mpl.ratio);\n", " canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n", "\n", " rubberband.attr('width', width);\n", " rubberband.attr('height', height);\n", " }\n", "\n", " // Set the figure to an initial 600x600px, this will subsequently be updated\n", " // upon first draw.\n", " this._resize_canvas(600, 600);\n", "\n", " // Disable right mouse context menu.\n", " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", " return false;\n", " });\n", "\n", " function set_focus () {\n", " canvas.focus();\n", " canvas_div.focus();\n", " }\n", "\n", " window.setTimeout(set_focus, 100);\n", "}\n", "\n", "mpl.figure.prototype._init_toolbar = function() {\n", " var fig = this;\n", "\n", " var nav_element = $('
')\n", " nav_element.attr('style', 'width: 100%');\n", " this.root.append(nav_element);\n", "\n", " // Define a callback function for later on.\n", " function toolbar_event(event) {\n", " return fig.toolbar_button_onclick(event['data']);\n", " }\n", " function toolbar_mouse_event(event) {\n", " return fig.toolbar_button_onmouseover(event['data']);\n", " }\n", "\n", " for(var toolbar_ind in mpl.toolbar_items) {\n", " var name = mpl.toolbar_items[toolbar_ind][0];\n", " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", " var image = mpl.toolbar_items[toolbar_ind][2];\n", " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", "\n", " if (!name) {\n", " // put a spacer in here.\n", " continue;\n", " }\n", " var button = $('');\n", " button.click(method_name, toolbar_event);\n", " button.mouseover(tooltip, toolbar_mouse_event);\n", " nav_element.append(button);\n", " }\n", "\n", " // Add the status bar.\n", " var status_bar = $('');\n", " nav_element.append(status_bar);\n", " this.message = status_bar[0];\n", "\n", " // Add the close button to the window.\n", " var buttongrp = $('
');\n", " var button = $('');\n", " button.click(function (evt) { fig.handle_close(fig, {}); } );\n", " button.mouseover('Stop Interaction', toolbar_mouse_event);\n", " buttongrp.append(button);\n", " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n", " titlebar.prepend(buttongrp);\n", "}\n", "\n", "mpl.figure.prototype._root_extra_style = function(el){\n", " var fig = this\n", " el.on(\"remove\", function(){\n", "\tfig.close_ws(fig, {});\n", " });\n", "}\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(el){\n", " // this is important to make the div 'focusable\n", " el.attr('tabindex', 0)\n", " // reach out to IPython and tell the keyboard manager to turn it's self\n", " // off when our div gets focus\n", "\n", " // location in version 3\n", " if (IPython.notebook.keyboard_manager) {\n", " IPython.notebook.keyboard_manager.register_events(el);\n", " }\n", " else {\n", " // location in version 2\n", " IPython.keyboard_manager.register_events(el);\n", " }\n", "\n", "}\n", "\n", "mpl.figure.prototype._key_event_extra = function(event, name) {\n", " var manager = IPython.notebook.keyboard_manager;\n", " if (!manager)\n", " manager = IPython.keyboard_manager;\n", "\n", " // Check for shift+enter\n", " if (event.shiftKey && event.which == 13) {\n", " this.canvas_div.blur();\n", " event.shiftKey = false;\n", " // Send a \"J\" for go to next cell\n", " event.which = 74;\n", " event.keyCode = 74;\n", " manager.command_mode();\n", " manager.handle_keydown(event);\n", " }\n", "}\n", "\n", "mpl.figure.prototype.handle_save = function(fig, msg) {\n", " fig.ondownload(fig, null);\n", "}\n", "\n", "\n", "mpl.find_output_cell = function(html_output) {\n", " // Return the cell and output element which can be found *uniquely* in the notebook.\n", " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n", " // IPython event is triggered only after the cells have been serialised, which for\n", " // our purposes (turning an active figure into a static one), is too late.\n", " var cells = IPython.notebook.get_cells();\n", " var ncells = cells.length;\n", " for (var i=0; i= 3 moved mimebundle to data attribute of output\n", " data = data.data;\n", " }\n", " if (data['text/html'] == html_output) {\n", " return [cell, data, j];\n", " }\n", " }\n", " }\n", " }\n", "}\n", "\n", "// Register the function which deals with the matplotlib target/channel.\n", "// The kernel may be null if the page has been refreshed.\n", "if (IPython.notebook.kernel != null) {\n", " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n", "}\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# \n", "time_noleap = xr.cftime_range('0500-12', '2001-01', freq='MS', calendar='noleap')\n", "ts = xr.open_dataset(forcing_file).colmass.expand_dims('lon', axis=-1).geo.fldmean().assign_coords(time=time_noleap)\n", "for t0,t1,p in zip(xr.CFTimeIndex(df['t_erupt_start']).shift(-1, 'MS'), df['t_erupt_end'], df['colmass_peak']):\n", " if p<1e-5:\n", " color = 'gray'\n", " alpha = 0.5\n", " else:\n", " color = None\n", " alpha = 1\n", " plt.plot( ts.sel(time=slice(t0,t1))/p , label=t0.year, color=color, alpha=alpha, lw=1)\n", "# plt.legend(ncol=2)\n", "\n", "plt.xlabel('Months since eruption')\n", "plt.ylabel('colmass[normalized by peak value]')\n", "plt.tight_layout()" ] }, { "cell_type": "code", "execution_count": 57, "metadata": { "ExecuteTime": { "end_time": "2019-03-13T21:27:44.240911Z", "start_time": "2019-03-13T21:27:43.546141Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/tigress/wenchang/data/cesm/LME/FORCING/CCSM4_volcanic_1850-2008_prototype1.nc\n", "1849-12\n", "2009-01\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
t_erupt_startt_erupt_peakt_erupt_endcolmass_globalcolmass_nhcolmass_peakcolmass_shcolmass_asy
01854-01-01 00:00:001854-04-01 00:00:001855-05-01 00:00:000.0000059.508018e-060.0000088.470329e-211.000000
11856-10-01 00:00:001857-01-01 00:00:001857-11-01 00:00:000.0000036.116875e-060.0000055.929231e-211.000000
21883-08-01 00:00:001883-12-01 00:00:001886-07-01 00:00:000.0000747.786356e-050.0000676.928953e-050.058266
31890-02-01 00:00:001890-06-01 00:00:001892-09-01 00:00:000.0000373.440355e-050.0000343.925764e-05-0.065898
41902-06-01 00:00:001903-02-01 00:00:001905-06-01 00:00:000.0000606.149664e-050.0000525.856645e-050.024405
51907-04-01 00:00:001907-07-01 00:00:001908-05-01 00:00:000.0000036.172037e-060.0000053.402249e-080.989036
61912-06-01 00:00:001912-10-01 00:00:001914-03-01 00:00:000.0000122.424503e-050.0000183.794631e-121.000000
71922-01-01 00:00:001922-04-01 00:00:001923-02-01 00:00:000.0000039.963455e-140.0000055.978524e-06-1.000000
81928-09-01 00:00:001929-10-01 00:00:001930-12-01 00:00:000.0000111.425787e-050.0000086.757029e-060.356930
91932-05-01 00:00:001932-08-01 00:00:001933-06-01 00:00:000.0000034.309986e-080.0000056.365695e-06-0.986550
101953-09-01 00:00:001953-11-01 00:00:001954-05-01 00:00:000.0000012.458299e-060.0000032.541099e-211.000000
111963-03-01 00:00:001963-07-01 00:00:001965-10-01 00:00:000.0000423.790618e-050.0000384.526499e-05-0.088478
121968-07-01 00:00:001968-10-01 00:00:001970-07-01 00:00:000.0000099.636176e-060.0000087.875476e-060.100544
131974-11-01 00:00:001975-02-01 00:00:001976-11-01 00:00:000.0000099.086294e-060.0000088.687923e-060.022413
141982-05-01 00:00:001982-09-01 00:00:001984-11-01 00:00:000.0000363.591773e-050.0000343.639482e-05-0.006598
151991-06-01 00:00:001991-10-01 00:00:001994-03-01 00:00:000.0000596.487196e-050.0000535.352190e-050.095867
\n", "
" ], "text/plain": [ " t_erupt_start t_erupt_peak t_erupt_end \\\n", "0 1854-01-01 00:00:00 1854-04-01 00:00:00 1855-05-01 00:00:00 \n", "1 1856-10-01 00:00:00 1857-01-01 00:00:00 1857-11-01 00:00:00 \n", "2 1883-08-01 00:00:00 1883-12-01 00:00:00 1886-07-01 00:00:00 \n", "3 1890-02-01 00:00:00 1890-06-01 00:00:00 1892-09-01 00:00:00 \n", "4 1902-06-01 00:00:00 1903-02-01 00:00:00 1905-06-01 00:00:00 \n", "5 1907-04-01 00:00:00 1907-07-01 00:00:00 1908-05-01 00:00:00 \n", "6 1912-06-01 00:00:00 1912-10-01 00:00:00 1914-03-01 00:00:00 \n", "7 1922-01-01 00:00:00 1922-04-01 00:00:00 1923-02-01 00:00:00 \n", "8 1928-09-01 00:00:00 1929-10-01 00:00:00 1930-12-01 00:00:00 \n", "9 1932-05-01 00:00:00 1932-08-01 00:00:00 1933-06-01 00:00:00 \n", "10 1953-09-01 00:00:00 1953-11-01 00:00:00 1954-05-01 00:00:00 \n", "11 1963-03-01 00:00:00 1963-07-01 00:00:00 1965-10-01 00:00:00 \n", "12 1968-07-01 00:00:00 1968-10-01 00:00:00 1970-07-01 00:00:00 \n", "13 1974-11-01 00:00:00 1975-02-01 00:00:00 1976-11-01 00:00:00 \n", "14 1982-05-01 00:00:00 1982-09-01 00:00:00 1984-11-01 00:00:00 \n", "15 1991-06-01 00:00:00 1991-10-01 00:00:00 1994-03-01 00:00:00 \n", "\n", " colmass_global colmass_nh colmass_peak colmass_sh colmass_asy \n", "0 0.000005 9.508018e-06 0.000008 8.470329e-21 1.000000 \n", "1 0.000003 6.116875e-06 0.000005 5.929231e-21 1.000000 \n", "2 0.000074 7.786356e-05 0.000067 6.928953e-05 0.058266 \n", "3 0.000037 3.440355e-05 0.000034 3.925764e-05 -0.065898 \n", "4 0.000060 6.149664e-05 0.000052 5.856645e-05 0.024405 \n", "5 0.000003 6.172037e-06 0.000005 3.402249e-08 0.989036 \n", "6 0.000012 2.424503e-05 0.000018 3.794631e-12 1.000000 \n", "7 0.000003 9.963455e-14 0.000005 5.978524e-06 -1.000000 \n", "8 0.000011 1.425787e-05 0.000008 6.757029e-06 0.356930 \n", "9 0.000003 4.309986e-08 0.000005 6.365695e-06 -0.986550 \n", "10 0.000001 2.458299e-06 0.000003 2.541099e-21 1.000000 \n", "11 0.000042 3.790618e-05 0.000038 4.526499e-05 -0.088478 \n", "12 0.000009 9.636176e-06 0.000008 7.875476e-06 0.100544 \n", "13 0.000009 9.086294e-06 0.000008 8.687923e-06 0.022413 \n", "14 0.000036 3.591773e-05 0.000034 3.639482e-05 -0.006598 \n", "15 0.000059 6.487196e-05 0.000053 5.352190e-05 0.095867 " ] }, "execution_count": 57, "metadata": {}, "output_type": "execute_result" } ], "source": [ "forcing_file = '/tigress/wenchang/data/cesm/LME/FORCING/CCSM4_volcanic_1850-2008_prototype1.nc'\n", "ofile = 'eruptions_post1850.csv'\n", "df = extract_volc_info(forcing_file, threshold=1e-6)\n", "# df.to_csv(ofile)\n", "df1850 = df\n", "df" ] }, { "cell_type": "code", "execution_count": 251, "metadata": { "ExecuteTime": { "end_time": "2019-03-09T14:45:43.620457Z", "start_time": "2019-03-09T14:45:43.135217Z" } }, "outputs": [ { "data": { "application/javascript": [ "/* Put everything inside the global mpl namespace */\n", "window.mpl = {};\n", "\n", "\n", "mpl.get_websocket_type = function() {\n", " if (typeof(WebSocket) !== 'undefined') {\n", " return WebSocket;\n", " } else if (typeof(MozWebSocket) !== 'undefined') {\n", " return MozWebSocket;\n", " } else {\n", " alert('Your browser does not have WebSocket support.' +\n", " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", " 'Firefox 4 and 5 are also supported but you ' +\n", " 'have to enable WebSockets in about:config.');\n", " };\n", "}\n", "\n", "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", " this.id = figure_id;\n", "\n", " this.ws = websocket;\n", "\n", " this.supports_binary = (this.ws.binaryType != undefined);\n", "\n", " if (!this.supports_binary) {\n", " var warnings = document.getElementById(\"mpl-warnings\");\n", " if (warnings) {\n", " warnings.style.display = 'block';\n", " warnings.textContent = (\n", " \"This browser does not support binary websocket messages. \" +\n", " \"Performance may be slow.\");\n", " }\n", " }\n", "\n", " this.imageObj = new Image();\n", "\n", " this.context = undefined;\n", " this.message = undefined;\n", " this.canvas = undefined;\n", " this.rubberband_canvas = undefined;\n", " this.rubberband_context = undefined;\n", " this.format_dropdown = undefined;\n", "\n", " this.image_mode = 'full';\n", "\n", " this.root = $('
');\n", " this._root_extra_style(this.root)\n", " this.root.attr('style', 'display: inline-block');\n", "\n", " $(parent_element).append(this.root);\n", "\n", " this._init_header(this);\n", " this._init_canvas(this);\n", " this._init_toolbar(this);\n", "\n", " var fig = this;\n", "\n", " this.waiting = false;\n", "\n", " this.ws.onopen = function () {\n", " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", " fig.send_message(\"send_image_mode\", {});\n", " if (mpl.ratio != 1) {\n", " fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n", " }\n", " fig.send_message(\"refresh\", {});\n", " }\n", "\n", " this.imageObj.onload = function() {\n", " if (fig.image_mode == 'full') {\n", " // Full images could contain transparency (where diff images\n", " // almost always do), so we need to clear the canvas so that\n", " // there is no ghosting.\n", " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", " }\n", " fig.context.drawImage(fig.imageObj, 0, 0);\n", " };\n", "\n", " this.imageObj.onunload = function() {\n", " fig.ws.close();\n", " }\n", "\n", " this.ws.onmessage = this._make_on_message_function(this);\n", "\n", " this.ondownload = ondownload;\n", "}\n", "\n", "mpl.figure.prototype._init_header = function() {\n", " var titlebar = $(\n", " '
');\n", " var titletext = $(\n", " '
');\n", " titlebar.append(titletext)\n", " this.root.append(titlebar);\n", " this.header = titletext[0];\n", "}\n", "\n", "\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "\n", "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", "\n", "}\n", "\n", "mpl.figure.prototype._init_canvas = function() {\n", " var fig = this;\n", "\n", " var canvas_div = $('
');\n", "\n", " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", "\n", " function canvas_keyboard_event(event) {\n", " return fig.key_event(event, event['data']);\n", " }\n", "\n", " canvas_div.keydown('key_press', canvas_keyboard_event);\n", " canvas_div.keyup('key_release', canvas_keyboard_event);\n", " this.canvas_div = canvas_div\n", " this._canvas_extra_style(canvas_div)\n", " this.root.append(canvas_div);\n", "\n", " var canvas = $('');\n", " canvas.addClass('mpl-canvas');\n", " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", "\n", " this.canvas = canvas[0];\n", " this.context = canvas[0].getContext(\"2d\");\n", "\n", " var backingStore = this.context.backingStorePixelRatio ||\n", "\tthis.context.webkitBackingStorePixelRatio ||\n", "\tthis.context.mozBackingStorePixelRatio ||\n", "\tthis.context.msBackingStorePixelRatio ||\n", "\tthis.context.oBackingStorePixelRatio ||\n", "\tthis.context.backingStorePixelRatio || 1;\n", "\n", " mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n", "\n", " var rubberband = $('');\n", " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", "\n", " var pass_mouse_events = true;\n", "\n", " canvas_div.resizable({\n", " start: function(event, ui) {\n", " pass_mouse_events = false;\n", " },\n", " resize: function(event, ui) {\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " stop: function(event, ui) {\n", " pass_mouse_events = true;\n", " fig.request_resize(ui.size.width, ui.size.height);\n", " },\n", " });\n", "\n", " function mouse_event_fn(event) {\n", " if (pass_mouse_events)\n", " return fig.mouse_event(event, event['data']);\n", " }\n", "\n", " rubberband.mousedown('button_press', mouse_event_fn);\n", " rubberband.mouseup('button_release', mouse_event_fn);\n", " // Throttle sequential mouse events to 1 every 20ms.\n", " rubberband.mousemove('motion_notify', mouse_event_fn);\n", "\n", " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", "\n", " canvas_div.on(\"wheel\", function (event) {\n", " event = event.originalEvent;\n", " event['data'] = 'scroll'\n", " if (event.deltaY < 0) {\n", " event.step = 1;\n", " } else {\n", " event.step = -1;\n", " }\n", " mouse_event_fn(event);\n", " });\n", "\n", " canvas_div.append(canvas);\n", " canvas_div.append(rubberband);\n", "\n", " this.rubberband = rubberband;\n", " this.rubberband_canvas = rubberband[0];\n", " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", " this.rubberband_context.strokeStyle = \"#000000\";\n", "\n", " this._resize_canvas = function(width, height) {\n", " // Keep the size of the canvas, canvas container, and rubber band\n", " // canvas in synch.\n", " canvas_div.css('width', width)\n", " canvas_div.css('height', height)\n", "\n", " canvas.attr('width', width * mpl.ratio);\n", " canvas.attr('height', height * mpl.ratio);\n", " canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n", "\n", " rubberband.attr('width', width);\n", " rubberband.attr('height', height);\n", " }\n", "\n", " // Set the figure to an initial 600x600px, this will subsequently be updated\n", " // upon first draw.\n", " this._resize_canvas(600, 600);\n", "\n", " // Disable right mouse context menu.\n", " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", " return false;\n", " });\n", "\n", " function set_focus () {\n", " canvas.focus();\n", " canvas_div.focus();\n", " }\n", "\n", " window.setTimeout(set_focus, 100);\n", "}\n", "\n", "mpl.figure.prototype._init_toolbar = function() {\n", " var fig = this;\n", "\n", " var nav_element = $('
')\n", " nav_element.attr('style', 'width: 100%');\n", " this.root.append(nav_element);\n", "\n", " // Define a callback function for later on.\n", " function toolbar_event(event) {\n", " return fig.toolbar_button_onclick(event['data']);\n", " }\n", " function toolbar_mouse_event(event) {\n", " return fig.toolbar_button_onmouseover(event['data']);\n", " }\n", "\n", " for(var toolbar_ind in mpl.toolbar_items) {\n", " var name = mpl.toolbar_items[toolbar_ind][0];\n", " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", " var image = mpl.toolbar_items[toolbar_ind][2];\n", " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", "\n", " if (!name) {\n", " // put a spacer in here.\n", " continue;\n", " }\n", " var button = $('');\n", " button.click(method_name, toolbar_event);\n", " button.mouseover(tooltip, toolbar_mouse_event);\n", " nav_element.append(button);\n", " }\n", "\n", " // Add the status bar.\n", " var status_bar = $('');\n", " nav_element.append(status_bar);\n", " this.message = status_bar[0];\n", "\n", " // Add the close button to the window.\n", " var buttongrp = $('
');\n", " var button = $('');\n", " button.click(function (evt) { fig.handle_close(fig, {}); } );\n", " button.mouseover('Stop Interaction', toolbar_mouse_event);\n", " buttongrp.append(button);\n", " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n", " titlebar.prepend(buttongrp);\n", "}\n", "\n", "mpl.figure.prototype._root_extra_style = function(el){\n", " var fig = this\n", " el.on(\"remove\", function(){\n", "\tfig.close_ws(fig, {});\n", " });\n", "}\n", "\n", "mpl.figure.prototype._canvas_extra_style = function(el){\n", " // this is important to make the div 'focusable\n", " el.attr('tabindex', 0)\n", " // reach out to IPython and tell the keyboard manager to turn it's self\n", " // off when our div gets focus\n", "\n", " // location in version 3\n", " if (IPython.notebook.keyboard_manager) {\n", " IPython.notebook.keyboard_manager.register_events(el);\n", " }\n", " else {\n", " // location in version 2\n", " IPython.keyboard_manager.register_events(el);\n", " }\n", "\n", "}\n", "\n", "mpl.figure.prototype._key_event_extra = function(event, name) {\n", " var manager = IPython.notebook.keyboard_manager;\n", " if (!manager)\n", " manager = IPython.keyboard_manager;\n", "\n", " // Check for shift+enter\n", " if (event.shiftKey && event.which == 13) {\n", " this.canvas_div.blur();\n", " event.shiftKey = false;\n", " // Send a \"J\" for go to next cell\n", " event.which = 74;\n", " event.keyCode = 74;\n", " manager.command_mode();\n", " manager.handle_keydown(event);\n", " }\n", "}\n", "\n", "mpl.figure.prototype.handle_save = function(fig, msg) {\n", " fig.ondownload(fig, null);\n", "}\n", "\n", "\n", "mpl.find_output_cell = function(html_output) {\n", " // Return the cell and output element which can be found *uniquely* in the notebook.\n", " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n", " // IPython event is triggered only after the cells have been serialised, which for\n", " // our purposes (turning an active figure into a static one), is too late.\n", " var cells = IPython.notebook.get_cells();\n", " var ncells = cells.length;\n", " for (var i=0; i= 3 moved mimebundle to data attribute of output\n", " data = data.data;\n", " }\n", " if (data['text/html'] == html_output) {\n", " return [cell, data, j];\n", " }\n", " }\n", " }\n", " }\n", "}\n", "\n", "// Register the function which deals with the matplotlib target/channel.\n", "// The kernel may be null if the page has been refreshed.\n", "if (IPython.notebook.kernel != null) {\n", " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n", "}\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# \n", "time_noleap = xr.cftime_range('1849-12', '2009-01', freq='MS', calendar='noleap')\n", "ts = xr.open_dataset(forcing_file).colmass.expand_dims('lon', axis=-1).geo.fldmean().assign_coords(time=time_noleap)\n", "for t0,t1,p in zip(xr.CFTimeIndex(df['t_erupt_start']).shift(-1, 'MS'), df['t_erupt_end'], df['colmass_peak']):\n", " if p<1e-5:\n", " color = 'gray'\n", " alpha = 0.5\n", " else:\n", " color = None\n", " alpha = 1\n", " plt.plot( ts.sel(time=slice(t0,t1))/p , label=t0.year, color=color, alpha=alpha)\n", "plt.legend(ncol=2)\n", "\n", "plt.xlabel('Months since eruption')\n", "plt.ylabel('colmass[normalized by peak value]')\n", "plt.tight_layout()" ] }, { "cell_type": "code", "execution_count": 68, "metadata": { "ExecuteTime": { "end_time": "2019-03-13T21:38:03.518426Z", "start_time": "2019-03-13T21:38:03.398267Z" }, "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "LME Volcanic Eruptions during 855-2000\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
t_erupt_startt_erupt_peakt_erupt_endcolmass_globalcolmass_nhcolmass_peakcolmass_shcolmass_asy
00870-04-01 00:00:000870-08-01 00:00:000872-12-01 00:00:000.0000435.408524e-050.0000493.194513e-050.257352
10877-05-01 00:00:000877-08-01 00:00:000878-12-01 00:00:000.0000071.299239e-050.0000081.661124e-070.974752
20893-05-01 00:00:000893-08-01 00:00:000894-09-01 00:00:000.0000048.209603e-060.0000051.074138e-070.974170
30898-05-01 00:00:000898-08-01 00:00:000900-01-01 00:00:000.0000071.459036e-050.0000091.854664e-070.974896
40901-04-01 00:00:000901-08-01 00:00:000903-12-01 00:00:000.0000405.558245e-050.0000452.413676e-050.394456
50929-04-01 00:00:000929-08-01 00:00:000931-06-01 00:00:000.0000206.319425e-060.0000233.332373e-05-0.681185
60933-04-01 00:00:000933-08-01 00:00:000936-02-01 00:00:000.0000531.053543e-040.0000591.316601e-060.975315
70939-05-01 00:00:000939-08-01 00:00:000940-05-01 00:00:000.0000038.441268e-070.0000044.183065e-06-0.664176
80945-04-01 00:00:000945-08-01 00:00:000946-11-01 00:00:000.0000072.192159e-060.0000081.103105e-05-0.668438
90961-04-01 00:00:000961-08-01 00:00:000963-10-01 00:00:000.0000322.148286e-050.0000374.305554e-05-0.334261
100987-04-01 00:00:000987-08-01 00:00:000989-05-01 00:00:000.0000132.653378e-050.0000153.335095e-070.975174
111001-04-01 00:00:001001-08-01 00:00:001003-12-01 00:00:000.0000424.596448e-050.0000483.780502e-050.097404
121018-04-01 00:00:001018-08-01 00:00:001020-04-01 00:00:000.0000112.252248e-050.0000132.878802e-070.974759
131030-04-01 00:00:001030-08-01 00:00:001032-04-01 00:00:000.0000144.493319e-060.0000172.357978e-05-0.679884
141040-05-01 00:00:001040-08-01 00:00:001041-10-01 00:00:000.0000048.175199e-060.0000051.050989e-070.974615
151050-04-01 00:00:001050-08-01 00:00:001051-11-01 00:00:000.0000062.048224e-060.0000081.046166e-05-0.672543
161060-05-01 00:00:001060-08-01 00:00:001061-09-01 00:00:000.0000047.429114e-060.0000059.720203e-080.974170
171081-04-01 00:00:001081-08-01 00:00:001083-11-01 00:00:000.0000345.014625e-050.0000391.851391e-050.460709
181094-04-01 00:00:001094-08-01 00:00:001096-03-01 00:00:000.0000123.735065e-060.0000141.953655e-05-0.679003
191110-04-01 00:00:001110-08-01 00:00:001111-12-01 00:00:000.0000072.379824e-060.0000091.224091e-05-0.674459
201118-04-01 00:00:001118-08-01 00:00:001119-11-01 00:00:000.0000062.092272e-060.0000081.068664e-05-0.672543
211122-05-01 00:00:001122-08-01 00:00:001123-03-01 00:00:000.0000025.417724e-070.0000022.513949e-06-0.645405
221132-04-01 00:00:001132-08-01 00:00:001133-08-01 00:00:000.0000041.448241e-060.0000067.220232e-06-0.665860
231142-05-01 00:00:001142-08-01 00:00:001143-02-01 00:00:000.0000014.851061e-070.0000022.281051e-06-0.649256
241150-04-01 00:00:001150-08-01 00:00:001151-09-01 00:00:000.0000051.529584e-060.0000067.693259e-06-0.668305
251158-04-01 00:00:001158-08-01 00:00:001161-01-01 00:00:000.0000541.736502e-050.0000629.111551e-05-0.679850
261176-05-01 00:00:001176-09-01 00:00:001179-06-01 00:00:000.0000771.521444e-040.0000831.898998e-060.975345
271188-04-01 00:00:001188-08-01 00:00:001190-02-01 00:00:000.0000091.708630e-050.0000102.171334e-070.974903
281213-04-01 00:00:001213-08-01 00:00:001216-07-01 00:00:000.0001212.030097e-040.0001303.847022e-050.681380
291232-04-01 00:00:001232-08-01 00:00:001234-10-01 00:00:000.0000331.059235e-050.0000395.623896e-05-0.683012
...........................
561673-05-01 00:00:001673-09-01 00:00:001675-11-01 00:00:000.0000342.825870e-050.0000393.973589e-05-0.168796
571693-06-01 00:00:001693-10-01 00:00:001696-04-01 00:00:000.0000652.072703e-050.0000751.098490e-04-0.682529
581711-04-01 00:00:001711-08-01 00:00:001713-02-01 00:00:000.0000092.883126e-060.0000111.501112e-05-0.677759
591719-04-01 00:00:001719-08-01 00:00:001722-02-01 00:00:000.0000531.043603e-040.0000591.304180e-060.975315
601729-08-01 00:00:001729-12-01 00:00:001731-11-01 00:00:000.0000203.951664e-050.0000214.906217e-070.975473
611738-08-01 00:00:001738-12-01 00:00:001740-04-01 00:00:000.0000082.473585e-060.0000091.261453e-05-0.672115
621755-10-01 00:00:001756-02-01 00:00:001757-10-01 00:00:000.0000132.577917e-050.0000143.218071e-070.975341
631761-09-01 00:00:001762-01-01 00:00:001765-03-01 00:00:000.0001583.118259e-040.0001663.835303e-060.975700
641794-04-01 00:00:001794-07-01 00:00:001795-07-01 00:00:000.0000041.287637e-060.0000056.602085e-06-0.673591
651796-04-01 00:00:001796-08-01 00:00:001798-03-01 00:00:000.0000112.117954e-050.0000122.718477e-070.974655
661809-04-01 00:00:001809-08-01 00:00:001812-07-01 00:00:000.0001111.132430e-040.0001241.077773e-040.024729
671815-04-01 00:00:001815-08-01 00:00:001818-11-01 00:00:000.0002242.362341e-040.0002522.119986e-040.054069
681831-04-01 00:00:001831-08-01 00:00:001833-10-01 00:00:000.0000285.585518e-050.0000327.011525e-070.975205
691835-01-01 00:00:001835-05-01 00:00:001838-01-01 00:00:000.0000789.857815e-050.0000865.721119e-050.265531
701854-01-01 00:00:001854-04-01 00:00:001855-05-01 00:00:000.0000059.508018e-060.0000088.470329e-211.000000
711856-10-01 00:00:001857-01-01 00:00:001857-11-01 00:00:000.0000036.116875e-060.0000055.929231e-211.000000
721883-08-01 00:00:001883-12-01 00:00:001886-07-01 00:00:000.0000747.786356e-050.0000676.928953e-050.058266
731890-02-01 00:00:001890-06-01 00:00:001892-09-01 00:00:000.0000373.440355e-050.0000343.925764e-05-0.065898
741902-06-01 00:00:001903-02-01 00:00:001905-06-01 00:00:000.0000606.149664e-050.0000525.856645e-050.024405
751907-04-01 00:00:001907-07-01 00:00:001908-05-01 00:00:000.0000036.172037e-060.0000053.402249e-080.989036
761912-06-01 00:00:001912-10-01 00:00:001914-03-01 00:00:000.0000122.424503e-050.0000183.794631e-121.000000
771922-01-01 00:00:001922-04-01 00:00:001923-02-01 00:00:000.0000039.963455e-140.0000055.978524e-06-1.000000
781928-09-01 00:00:001929-10-01 00:00:001930-12-01 00:00:000.0000111.425787e-050.0000086.757029e-060.356930
791932-05-01 00:00:001932-08-01 00:00:001933-06-01 00:00:000.0000034.309986e-080.0000056.365695e-06-0.986550
801953-09-01 00:00:001953-11-01 00:00:001954-05-01 00:00:000.0000012.458299e-060.0000032.541099e-211.000000
811963-03-01 00:00:001963-07-01 00:00:001965-10-01 00:00:000.0000423.790618e-050.0000384.526499e-05-0.088478
821968-07-01 00:00:001968-10-01 00:00:001970-07-01 00:00:000.0000099.636176e-060.0000087.875476e-060.100544
831974-11-01 00:00:001975-02-01 00:00:001976-11-01 00:00:000.0000099.086294e-060.0000088.687923e-060.022413
841982-05-01 00:00:001982-09-01 00:00:001984-11-01 00:00:000.0000363.591773e-050.0000343.639482e-05-0.006598
851991-06-01 00:00:001991-10-01 00:00:001994-03-01 00:00:000.0000596.487196e-050.0000535.352190e-050.095867
\n", "

86 rows × 8 columns

\n", "
" ], "text/plain": [ " t_erupt_start t_erupt_peak t_erupt_end \\\n", "0 0870-04-01 00:00:00 0870-08-01 00:00:00 0872-12-01 00:00:00 \n", "1 0877-05-01 00:00:00 0877-08-01 00:00:00 0878-12-01 00:00:00 \n", "2 0893-05-01 00:00:00 0893-08-01 00:00:00 0894-09-01 00:00:00 \n", "3 0898-05-01 00:00:00 0898-08-01 00:00:00 0900-01-01 00:00:00 \n", "4 0901-04-01 00:00:00 0901-08-01 00:00:00 0903-12-01 00:00:00 \n", "5 0929-04-01 00:00:00 0929-08-01 00:00:00 0931-06-01 00:00:00 \n", "6 0933-04-01 00:00:00 0933-08-01 00:00:00 0936-02-01 00:00:00 \n", "7 0939-05-01 00:00:00 0939-08-01 00:00:00 0940-05-01 00:00:00 \n", "8 0945-04-01 00:00:00 0945-08-01 00:00:00 0946-11-01 00:00:00 \n", "9 0961-04-01 00:00:00 0961-08-01 00:00:00 0963-10-01 00:00:00 \n", "10 0987-04-01 00:00:00 0987-08-01 00:00:00 0989-05-01 00:00:00 \n", "11 1001-04-01 00:00:00 1001-08-01 00:00:00 1003-12-01 00:00:00 \n", "12 1018-04-01 00:00:00 1018-08-01 00:00:00 1020-04-01 00:00:00 \n", "13 1030-04-01 00:00:00 1030-08-01 00:00:00 1032-04-01 00:00:00 \n", "14 1040-05-01 00:00:00 1040-08-01 00:00:00 1041-10-01 00:00:00 \n", "15 1050-04-01 00:00:00 1050-08-01 00:00:00 1051-11-01 00:00:00 \n", "16 1060-05-01 00:00:00 1060-08-01 00:00:00 1061-09-01 00:00:00 \n", "17 1081-04-01 00:00:00 1081-08-01 00:00:00 1083-11-01 00:00:00 \n", "18 1094-04-01 00:00:00 1094-08-01 00:00:00 1096-03-01 00:00:00 \n", "19 1110-04-01 00:00:00 1110-08-01 00:00:00 1111-12-01 00:00:00 \n", "20 1118-04-01 00:00:00 1118-08-01 00:00:00 1119-11-01 00:00:00 \n", "21 1122-05-01 00:00:00 1122-08-01 00:00:00 1123-03-01 00:00:00 \n", "22 1132-04-01 00:00:00 1132-08-01 00:00:00 1133-08-01 00:00:00 \n", "23 1142-05-01 00:00:00 1142-08-01 00:00:00 1143-02-01 00:00:00 \n", "24 1150-04-01 00:00:00 1150-08-01 00:00:00 1151-09-01 00:00:00 \n", "25 1158-04-01 00:00:00 1158-08-01 00:00:00 1161-01-01 00:00:00 \n", "26 1176-05-01 00:00:00 1176-09-01 00:00:00 1179-06-01 00:00:00 \n", "27 1188-04-01 00:00:00 1188-08-01 00:00:00 1190-02-01 00:00:00 \n", "28 1213-04-01 00:00:00 1213-08-01 00:00:00 1216-07-01 00:00:00 \n", "29 1232-04-01 00:00:00 1232-08-01 00:00:00 1234-10-01 00:00:00 \n", ".. ... ... ... \n", "56 1673-05-01 00:00:00 1673-09-01 00:00:00 1675-11-01 00:00:00 \n", "57 1693-06-01 00:00:00 1693-10-01 00:00:00 1696-04-01 00:00:00 \n", "58 1711-04-01 00:00:00 1711-08-01 00:00:00 1713-02-01 00:00:00 \n", "59 1719-04-01 00:00:00 1719-08-01 00:00:00 1722-02-01 00:00:00 \n", "60 1729-08-01 00:00:00 1729-12-01 00:00:00 1731-11-01 00:00:00 \n", "61 1738-08-01 00:00:00 1738-12-01 00:00:00 1740-04-01 00:00:00 \n", "62 1755-10-01 00:00:00 1756-02-01 00:00:00 1757-10-01 00:00:00 \n", "63 1761-09-01 00:00:00 1762-01-01 00:00:00 1765-03-01 00:00:00 \n", "64 1794-04-01 00:00:00 1794-07-01 00:00:00 1795-07-01 00:00:00 \n", "65 1796-04-01 00:00:00 1796-08-01 00:00:00 1798-03-01 00:00:00 \n", "66 1809-04-01 00:00:00 1809-08-01 00:00:00 1812-07-01 00:00:00 \n", "67 1815-04-01 00:00:00 1815-08-01 00:00:00 1818-11-01 00:00:00 \n", "68 1831-04-01 00:00:00 1831-08-01 00:00:00 1833-10-01 00:00:00 \n", "69 1835-01-01 00:00:00 1835-05-01 00:00:00 1838-01-01 00:00:00 \n", "70 1854-01-01 00:00:00 1854-04-01 00:00:00 1855-05-01 00:00:00 \n", "71 1856-10-01 00:00:00 1857-01-01 00:00:00 1857-11-01 00:00:00 \n", "72 1883-08-01 00:00:00 1883-12-01 00:00:00 1886-07-01 00:00:00 \n", "73 1890-02-01 00:00:00 1890-06-01 00:00:00 1892-09-01 00:00:00 \n", "74 1902-06-01 00:00:00 1903-02-01 00:00:00 1905-06-01 00:00:00 \n", "75 1907-04-01 00:00:00 1907-07-01 00:00:00 1908-05-01 00:00:00 \n", "76 1912-06-01 00:00:00 1912-10-01 00:00:00 1914-03-01 00:00:00 \n", "77 1922-01-01 00:00:00 1922-04-01 00:00:00 1923-02-01 00:00:00 \n", "78 1928-09-01 00:00:00 1929-10-01 00:00:00 1930-12-01 00:00:00 \n", "79 1932-05-01 00:00:00 1932-08-01 00:00:00 1933-06-01 00:00:00 \n", "80 1953-09-01 00:00:00 1953-11-01 00:00:00 1954-05-01 00:00:00 \n", "81 1963-03-01 00:00:00 1963-07-01 00:00:00 1965-10-01 00:00:00 \n", "82 1968-07-01 00:00:00 1968-10-01 00:00:00 1970-07-01 00:00:00 \n", "83 1974-11-01 00:00:00 1975-02-01 00:00:00 1976-11-01 00:00:00 \n", "84 1982-05-01 00:00:00 1982-09-01 00:00:00 1984-11-01 00:00:00 \n", "85 1991-06-01 00:00:00 1991-10-01 00:00:00 1994-03-01 00:00:00 \n", "\n", " colmass_global colmass_nh colmass_peak colmass_sh colmass_asy \n", "0 0.000043 5.408524e-05 0.000049 3.194513e-05 0.257352 \n", "1 0.000007 1.299239e-05 0.000008 1.661124e-07 0.974752 \n", "2 0.000004 8.209603e-06 0.000005 1.074138e-07 0.974170 \n", "3 0.000007 1.459036e-05 0.000009 1.854664e-07 0.974896 \n", "4 0.000040 5.558245e-05 0.000045 2.413676e-05 0.394456 \n", "5 0.000020 6.319425e-06 0.000023 3.332373e-05 -0.681185 \n", "6 0.000053 1.053543e-04 0.000059 1.316601e-06 0.975315 \n", "7 0.000003 8.441268e-07 0.000004 4.183065e-06 -0.664176 \n", "8 0.000007 2.192159e-06 0.000008 1.103105e-05 -0.668438 \n", "9 0.000032 2.148286e-05 0.000037 4.305554e-05 -0.334261 \n", "10 0.000013 2.653378e-05 0.000015 3.335095e-07 0.975174 \n", "11 0.000042 4.596448e-05 0.000048 3.780502e-05 0.097404 \n", "12 0.000011 2.252248e-05 0.000013 2.878802e-07 0.974759 \n", "13 0.000014 4.493319e-06 0.000017 2.357978e-05 -0.679884 \n", "14 0.000004 8.175199e-06 0.000005 1.050989e-07 0.974615 \n", "15 0.000006 2.048224e-06 0.000008 1.046166e-05 -0.672543 \n", "16 0.000004 7.429114e-06 0.000005 9.720203e-08 0.974170 \n", "17 0.000034 5.014625e-05 0.000039 1.851391e-05 0.460709 \n", "18 0.000012 3.735065e-06 0.000014 1.953655e-05 -0.679003 \n", "19 0.000007 2.379824e-06 0.000009 1.224091e-05 -0.674459 \n", "20 0.000006 2.092272e-06 0.000008 1.068664e-05 -0.672543 \n", "21 0.000002 5.417724e-07 0.000002 2.513949e-06 -0.645405 \n", "22 0.000004 1.448241e-06 0.000006 7.220232e-06 -0.665860 \n", "23 0.000001 4.851061e-07 0.000002 2.281051e-06 -0.649256 \n", "24 0.000005 1.529584e-06 0.000006 7.693259e-06 -0.668305 \n", "25 0.000054 1.736502e-05 0.000062 9.111551e-05 -0.679850 \n", "26 0.000077 1.521444e-04 0.000083 1.898998e-06 0.975345 \n", "27 0.000009 1.708630e-05 0.000010 2.171334e-07 0.974903 \n", "28 0.000121 2.030097e-04 0.000130 3.847022e-05 0.681380 \n", "29 0.000033 1.059235e-05 0.000039 5.623896e-05 -0.683012 \n", ".. ... ... ... ... ... \n", "56 0.000034 2.825870e-05 0.000039 3.973589e-05 -0.168796 \n", "57 0.000065 2.072703e-05 0.000075 1.098490e-04 -0.682529 \n", "58 0.000009 2.883126e-06 0.000011 1.501112e-05 -0.677759 \n", "59 0.000053 1.043603e-04 0.000059 1.304180e-06 0.975315 \n", "60 0.000020 3.951664e-05 0.000021 4.906217e-07 0.975473 \n", "61 0.000008 2.473585e-06 0.000009 1.261453e-05 -0.672115 \n", "62 0.000013 2.577917e-05 0.000014 3.218071e-07 0.975341 \n", "63 0.000158 3.118259e-04 0.000166 3.835303e-06 0.975700 \n", "64 0.000004 1.287637e-06 0.000005 6.602085e-06 -0.673591 \n", "65 0.000011 2.117954e-05 0.000012 2.718477e-07 0.974655 \n", "66 0.000111 1.132430e-04 0.000124 1.077773e-04 0.024729 \n", "67 0.000224 2.362341e-04 0.000252 2.119986e-04 0.054069 \n", "68 0.000028 5.585518e-05 0.000032 7.011525e-07 0.975205 \n", "69 0.000078 9.857815e-05 0.000086 5.721119e-05 0.265531 \n", "70 0.000005 9.508018e-06 0.000008 8.470329e-21 1.000000 \n", "71 0.000003 6.116875e-06 0.000005 5.929231e-21 1.000000 \n", "72 0.000074 7.786356e-05 0.000067 6.928953e-05 0.058266 \n", "73 0.000037 3.440355e-05 0.000034 3.925764e-05 -0.065898 \n", "74 0.000060 6.149664e-05 0.000052 5.856645e-05 0.024405 \n", "75 0.000003 6.172037e-06 0.000005 3.402249e-08 0.989036 \n", "76 0.000012 2.424503e-05 0.000018 3.794631e-12 1.000000 \n", "77 0.000003 9.963455e-14 0.000005 5.978524e-06 -1.000000 \n", "78 0.000011 1.425787e-05 0.000008 6.757029e-06 0.356930 \n", "79 0.000003 4.309986e-08 0.000005 6.365695e-06 -0.986550 \n", "80 0.000001 2.458299e-06 0.000003 2.541099e-21 1.000000 \n", "81 0.000042 3.790618e-05 0.000038 4.526499e-05 -0.088478 \n", "82 0.000009 9.636176e-06 0.000008 7.875476e-06 0.100544 \n", "83 0.000009 9.086294e-06 0.000008 8.687923e-06 0.022413 \n", "84 0.000036 3.591773e-05 0.000034 3.639482e-05 -0.006598 \n", "85 0.000059 6.487196e-05 0.000053 5.352190e-05 0.095867 \n", "\n", "[86 rows x 8 columns]" ] }, "execution_count": 68, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df1 = df500[(df500['t_erupt_start']>DatetimeNoLeap(855,1,1) ) \n", " & (df500['t_erupt_end']\n", "array([cftime.DatetimeNoLeap(870, 4, 1, 0, 0, 0, 0, 1, 91),\n", " cftime.DatetimeNoLeap(893, 5, 1, 0, 0, 0, 0, 5, 121),\n", " cftime.DatetimeNoLeap(929, 4, 1, 0, 0, 0, 0, 4, 91),\n", " cftime.DatetimeNoLeap(961, 4, 1, 0, 0, 0, 0, 1, 91),\n", " cftime.DatetimeNoLeap(987, 4, 1, 0, 0, 0, 0, 6, 91),\n", " cftime.DatetimeNoLeap(1001, 4, 1, 0, 0, 0, 0, 6, 91),\n", " cftime.DatetimeNoLeap(1018, 4, 1, 0, 0, 0, 0, 2, 91),\n", " cftime.DatetimeNoLeap(1030, 4, 1, 0, 0, 0, 0, 0, 91),\n", " cftime.DatetimeNoLeap(1040, 5, 1, 0, 0, 0, 0, 5, 121),\n", " cftime.DatetimeNoLeap(1050, 4, 1, 0, 0, 0, 0, 6, 91),\n", " cftime.DatetimeNoLeap(1060, 5, 1, 0, 0, 0, 0, 4, 121),\n", " cftime.DatetimeNoLeap(1081, 4, 1, 0, 0, 0, 0, 2, 91),\n", " cftime.DatetimeNoLeap(1094, 4, 1, 0, 0, 0, 0, 1, 91),\n", " cftime.DatetimeNoLeap(1110, 4, 1, 0, 0, 0, 0, 3, 91),\n", " cftime.DatetimeNoLeap(1118, 4, 1, 0, 0, 0, 0, 4, 91),\n", " cftime.DatetimeNoLeap(1132, 4, 1, 0, 0, 0, 0, 4, 91),\n", " cftime.DatetimeNoLeap(1142, 5, 1, 0, 0, 0, 0, 2, 121),\n", " cftime.DatetimeNoLeap(1150, 4, 1, 0, 0, 0, 0, 1, 91),\n", " cftime.DatetimeNoLeap(1158, 4, 1, 0, 0, 0, 0, 2, 91),\n", " cftime.DatetimeNoLeap(1176, 5, 1, 0, 0, 0, 0, 1, 121),\n", " cftime.DatetimeNoLeap(1188, 4, 1, 0, 0, 0, 0, 4, 91),\n", " cftime.DatetimeNoLeap(1213, 4, 1, 0, 0, 0, 0, 1, 91),\n", " cftime.DatetimeNoLeap(1232, 4, 1, 0, 0, 0, 0, 6, 91),\n", " cftime.DatetimeNoLeap(1258, 4, 1, 0, 0, 0, 0, 4, 91),\n", " cftime.DatetimeNoLeap(1268, 4, 1, 0, 0, 0, 0, 0, 91),\n", " cftime.DatetimeNoLeap(1284, 4, 1, 0, 0, 0, 0, 2, 91),\n", " cftime.DatetimeNoLeap(1307, 5, 1, 0, 0, 0, 0, 6, 121),\n", " cftime.DatetimeNoLeap(1316, 5, 1, 0, 0, 0, 0, 1, 121),\n", " cftime.DatetimeNoLeap(1328, 4, 1, 0, 0, 0, 0, 4, 91),\n", " cftime.DatetimeNoLeap(1341, 4, 1, 0, 0, 0, 0, 3, 91),\n", " cftime.DatetimeNoLeap(1358, 5, 1, 0, 0, 0, 0, 1, 121),\n", " cftime.DatetimeNoLeap(1370, 5, 1, 0, 0, 0, 0, 6, 121),\n", " cftime.DatetimeNoLeap(1381, 4, 1, 0, 0, 0, 0, 1, 91),\n", " cftime.DatetimeNoLeap(1416, 4, 1, 0, 0, 0, 0, 1, 91),\n", " cftime.DatetimeNoLeap(1452, 4, 1, 0, 0, 0, 0, 2, 91),\n", " cftime.DatetimeNoLeap(1474, 4, 1, 0, 0, 0, 0, 3, 91),\n", " cftime.DatetimeNoLeap(1503, 5, 1, 0, 0, 0, 0, 6, 121),\n", " cftime.DatetimeNoLeap(1512, 5, 1, 0, 0, 0, 0, 1, 121),\n", " cftime.DatetimeNoLeap(1526, 5, 1, 0, 0, 0, 0, 1, 121),\n", " cftime.DatetimeNoLeap(1534, 6, 1, 0, 0, 0, 0, 5, 152),\n", " cftime.DatetimeNoLeap(1584, 4, 1, 0, 0, 0, 0, 1, 91),\n", " cftime.DatetimeNoLeap(1593, 4, 1, 0, 0, 0, 0, 3, 91),\n", " cftime.DatetimeNoLeap(1619, 4, 1, 0, 0, 0, 0, 1, 91),\n", " cftime.DatetimeNoLeap(1641, 1, 1, 0, 0, 0, 0, 3, 1),\n", " cftime.DatetimeNoLeap(1673, 5, 1, 0, 0, 0, 0, 1, 121),\n", " cftime.DatetimeNoLeap(1693, 6, 1, 0, 0, 0, 0, 3, 152),\n", " cftime.DatetimeNoLeap(1711, 4, 1, 0, 0, 0, 0, 2, 91),\n", " cftime.DatetimeNoLeap(1719, 4, 1, 0, 0, 0, 0, 3, 91),\n", " cftime.DatetimeNoLeap(1729, 8, 1, 0, 0, 0, 0, 2, 213),\n", " cftime.DatetimeNoLeap(1738, 8, 1, 0, 0, 0, 0, 4, 213),\n", " cftime.DatetimeNoLeap(1755, 10, 1, 0, 0, 0, 0, 5, 274),\n", " cftime.DatetimeNoLeap(1794, 4, 1, 0, 0, 0, 0, 1, 91),\n", " cftime.DatetimeNoLeap(1809, 4, 1, 0, 0, 0, 0, 2, 91),\n", " cftime.DatetimeNoLeap(1831, 4, 1, 0, 0, 0, 0, 3, 91),\n", " cftime.DatetimeNoLeap(1854, 1, 1, 0, 0, 0, 0, 6, 1),\n", " cftime.DatetimeNoLeap(1883, 8, 1, 0, 0, 0, 0, 2, 213),\n", " cftime.DatetimeNoLeap(1902, 6, 1, 0, 0, 0, 0, 2, 152),\n", " cftime.DatetimeNoLeap(1922, 1, 1, 0, 0, 0, 0, 4, 1),\n", " cftime.DatetimeNoLeap(1928, 9, 1, 0, 0, 0, 0, 1, 244),\n", " cftime.DatetimeNoLeap(1953, 9, 1, 0, 0, 0, 0, 5, 244),\n", " cftime.DatetimeNoLeap(1963, 3, 1, 0, 0, 0, 0, 6, 60),\n", " cftime.DatetimeNoLeap(1982, 5, 1, 0, 0, 0, 0, 2, 121),\n", " cftime.DatetimeNoLeap(1991, 6, 1, 0, 0, 0, 0, 0, 152)], dtype=object)\n", "Coordinates:\n", " * volc (volc) object 0870-04-01 00:00:00 ... 1991-06-01 00:00:00" ] }, "execution_count": 95, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# filter independent eruptions, i.e. volc erupts >5 years after the previous one\n", "t_5years_before = ds.indexes['volc'].shift(-60, 'MS')\n", "t_5years_before\n", "ivolcs = [0,]\n", "for i in range(1, ds.volc.size):\n", " if t_5years_before[i] > ds.t_erupt_end[i-1]: # volc erupts >5 years after the previous one\n", " ivolcs.append(i)\n", " print(i, end='; ')\n", "ds.isel(volc=ivolcs).to_netcdf('data/lme_eruptions_ind.nc', encoding=encoding)\n", "ds.isel(volc=ivolcs).volc" ] }, { "cell_type": "code", "execution_count": 61, "metadata": { "ExecuteTime": { "end_time": "2019-03-13T21:30:12.375459Z", "start_time": "2019-03-13T21:30:12.210008Z" }, "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "LME Volcanic Eruptions during 855-2000 (large eruptions, i.e global mean colmass peak > 1e-5 kg m**-2)\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
t_erupt_startt_erupt_peakt_erupt_endcolmass_globalcolmass_nhcolmass_peakcolmass_shcolmass_asy
00870-04-01 00:00:000870-08-01 00:00:000872-12-01 00:00:000.0000430.0000540.0000493.194513e-050.257352
10901-04-01 00:00:000901-08-01 00:00:000903-12-01 00:00:000.0000400.0000560.0000452.413676e-050.394456
20929-04-01 00:00:000929-08-01 00:00:000931-06-01 00:00:000.0000200.0000060.0000233.332373e-05-0.681185
30933-04-01 00:00:000933-08-01 00:00:000936-02-01 00:00:000.0000530.0001050.0000591.316601e-060.975315
40961-04-01 00:00:000961-08-01 00:00:000963-10-01 00:00:000.0000320.0000210.0000374.305554e-05-0.334261
50987-04-01 00:00:000987-08-01 00:00:000989-05-01 00:00:000.0000130.0000270.0000153.335095e-070.975174
61001-04-01 00:00:001001-08-01 00:00:001003-12-01 00:00:000.0000420.0000460.0000483.780502e-050.097404
71018-04-01 00:00:001018-08-01 00:00:001020-04-01 00:00:000.0000110.0000230.0000132.878802e-070.974759
81030-04-01 00:00:001030-08-01 00:00:001032-04-01 00:00:000.0000140.0000040.0000172.357978e-05-0.679884
91081-04-01 00:00:001081-08-01 00:00:001083-11-01 00:00:000.0000340.0000500.0000391.851391e-050.460709
101094-04-01 00:00:001094-08-01 00:00:001096-03-01 00:00:000.0000120.0000040.0000141.953655e-05-0.679003
111158-04-01 00:00:001158-08-01 00:00:001161-01-01 00:00:000.0000540.0000170.0000629.111551e-05-0.679850
121176-05-01 00:00:001176-09-01 00:00:001179-06-01 00:00:000.0000770.0001520.0000831.898998e-060.975345
131213-04-01 00:00:001213-08-01 00:00:001216-07-01 00:00:000.0001210.0002030.0001303.847022e-050.681380
141232-04-01 00:00:001232-08-01 00:00:001234-10-01 00:00:000.0000330.0000110.0000395.623896e-05-0.683012
151258-04-01 00:00:001258-08-01 00:00:001262-05-01 00:00:000.0005210.0005750.0005834.669779e-040.103261
161268-04-01 00:00:001268-08-01 00:00:001270-11-01 00:00:000.0000370.0000120.0000436.286808e-05-0.683368
171275-04-01 00:00:001275-08-01 00:00:001278-08-01 00:00:000.0001500.0000660.0001712.349641e-04-0.563943
181284-04-01 00:00:001284-08-01 00:00:001287-07-01 00:00:000.0001160.0001010.0001311.305372e-04-0.126561
191328-04-01 00:00:001328-08-01 00:00:001330-10-01 00:00:000.0000330.0000650.0000378.125120e-070.975205
201341-04-01 00:00:001341-08-01 00:00:001344-03-01 00:00:000.0000710.0000380.0000811.044301e-04-0.464731
211381-04-01 00:00:001381-08-01 00:00:001383-03-01 00:00:000.0000120.0000040.0000152.067422e-05-0.679002
221416-04-01 00:00:001416-08-01 00:00:001418-07-01 00:00:000.0000190.0000210.0000221.713628e-050.100297
231452-04-01 00:00:001452-08-01 00:00:001456-01-01 00:00:000.0003020.0002200.0003413.838267e-04-0.270459
241459-04-01 00:00:001459-08-01 00:00:001461-11-01 00:00:000.0000370.0000720.0000419.043312e-070.975238
251476-03-01 00:00:001476-07-01 00:00:001478-09-01 00:00:000.0000250.0000490.0000286.090958e-070.975278
261480-01-01 00:00:001480-05-01 00:00:001482-01-01 00:00:000.0000120.0000240.0000132.979188e-070.975019
271534-06-01 00:00:001534-10-01 00:00:001536-03-01 00:00:000.0000090.0000030.0000111.478345e-05-0.674904
281584-04-01 00:00:001584-08-01 00:00:001586-12-01 00:00:000.0000400.0000800.0000451.000327e-060.975267
291593-04-01 00:00:001593-08-01 00:00:001595-07-01 00:00:000.0000230.0000070.0000273.823186e-05-0.681724
301600-02-01 00:00:001600-06-01 00:00:001603-04-01 00:00:000.0001030.0001620.0001144.496620e-050.565039
311619-04-01 00:00:001619-08-01 00:00:001621-03-01 00:00:000.0000120.0000040.0000152.051730e-05-0.679002
321641-01-01 00:00:001641-05-01 00:00:001644-03-01 00:00:000.0001000.0001270.0001107.393494e-050.262421
331673-05-01 00:00:001673-09-01 00:00:001675-11-01 00:00:000.0000340.0000280.0000393.973589e-05-0.168796
341693-06-01 00:00:001693-10-01 00:00:001696-04-01 00:00:000.0000650.0000210.0000751.098490e-04-0.682529
351711-04-01 00:00:001711-08-01 00:00:001713-02-01 00:00:000.0000090.0000030.0000111.501112e-05-0.677759
361719-04-01 00:00:001719-08-01 00:00:001722-02-01 00:00:000.0000530.0001040.0000591.304180e-060.975315
371729-08-01 00:00:001729-12-01 00:00:001731-11-01 00:00:000.0000200.0000400.0000214.906217e-070.975473
381755-10-01 00:00:001756-02-01 00:00:001757-10-01 00:00:000.0000130.0000260.0000143.218071e-070.975341
391761-09-01 00:00:001762-01-01 00:00:001765-03-01 00:00:000.0001580.0003120.0001663.835303e-060.975700
401796-04-01 00:00:001796-08-01 00:00:001798-03-01 00:00:000.0000110.0000210.0000122.718477e-070.974655
411809-04-01 00:00:001809-08-01 00:00:001812-07-01 00:00:000.0001110.0001130.0001241.077773e-040.024729
421815-04-01 00:00:001815-08-01 00:00:001818-11-01 00:00:000.0002240.0002360.0002522.119986e-040.054069
431831-04-01 00:00:001831-08-01 00:00:001833-10-01 00:00:000.0000280.0000560.0000327.011525e-070.975205
441835-01-01 00:00:001835-05-01 00:00:001838-01-01 00:00:000.0000780.0000990.0000865.721119e-050.265531
451883-08-01 00:00:001883-12-01 00:00:001886-07-01 00:00:000.0000740.0000780.0000676.928953e-050.058266
461890-02-01 00:00:001890-06-01 00:00:001892-09-01 00:00:000.0000370.0000340.0000343.925764e-05-0.065898
471902-06-01 00:00:001903-02-01 00:00:001905-06-01 00:00:000.0000600.0000610.0000525.856645e-050.024405
481912-06-01 00:00:001912-10-01 00:00:001914-03-01 00:00:000.0000120.0000240.0000183.794631e-121.000000
491963-03-01 00:00:001963-07-01 00:00:001965-10-01 00:00:000.0000420.0000380.0000384.526499e-05-0.088478
501982-05-01 00:00:001982-09-01 00:00:001984-11-01 00:00:000.0000360.0000360.0000343.639482e-05-0.006598
511991-06-01 00:00:001991-10-01 00:00:001994-03-01 00:00:000.0000590.0000650.0000535.352190e-050.095867
\n", "
" ], "text/plain": [ " t_erupt_start t_erupt_peak t_erupt_end \\\n", "0 0870-04-01 00:00:00 0870-08-01 00:00:00 0872-12-01 00:00:00 \n", "1 0901-04-01 00:00:00 0901-08-01 00:00:00 0903-12-01 00:00:00 \n", "2 0929-04-01 00:00:00 0929-08-01 00:00:00 0931-06-01 00:00:00 \n", "3 0933-04-01 00:00:00 0933-08-01 00:00:00 0936-02-01 00:00:00 \n", "4 0961-04-01 00:00:00 0961-08-01 00:00:00 0963-10-01 00:00:00 \n", "5 0987-04-01 00:00:00 0987-08-01 00:00:00 0989-05-01 00:00:00 \n", "6 1001-04-01 00:00:00 1001-08-01 00:00:00 1003-12-01 00:00:00 \n", "7 1018-04-01 00:00:00 1018-08-01 00:00:00 1020-04-01 00:00:00 \n", "8 1030-04-01 00:00:00 1030-08-01 00:00:00 1032-04-01 00:00:00 \n", "9 1081-04-01 00:00:00 1081-08-01 00:00:00 1083-11-01 00:00:00 \n", "10 1094-04-01 00:00:00 1094-08-01 00:00:00 1096-03-01 00:00:00 \n", "11 1158-04-01 00:00:00 1158-08-01 00:00:00 1161-01-01 00:00:00 \n", "12 1176-05-01 00:00:00 1176-09-01 00:00:00 1179-06-01 00:00:00 \n", "13 1213-04-01 00:00:00 1213-08-01 00:00:00 1216-07-01 00:00:00 \n", "14 1232-04-01 00:00:00 1232-08-01 00:00:00 1234-10-01 00:00:00 \n", "15 1258-04-01 00:00:00 1258-08-01 00:00:00 1262-05-01 00:00:00 \n", "16 1268-04-01 00:00:00 1268-08-01 00:00:00 1270-11-01 00:00:00 \n", "17 1275-04-01 00:00:00 1275-08-01 00:00:00 1278-08-01 00:00:00 \n", "18 1284-04-01 00:00:00 1284-08-01 00:00:00 1287-07-01 00:00:00 \n", "19 1328-04-01 00:00:00 1328-08-01 00:00:00 1330-10-01 00:00:00 \n", "20 1341-04-01 00:00:00 1341-08-01 00:00:00 1344-03-01 00:00:00 \n", "21 1381-04-01 00:00:00 1381-08-01 00:00:00 1383-03-01 00:00:00 \n", "22 1416-04-01 00:00:00 1416-08-01 00:00:00 1418-07-01 00:00:00 \n", "23 1452-04-01 00:00:00 1452-08-01 00:00:00 1456-01-01 00:00:00 \n", "24 1459-04-01 00:00:00 1459-08-01 00:00:00 1461-11-01 00:00:00 \n", "25 1476-03-01 00:00:00 1476-07-01 00:00:00 1478-09-01 00:00:00 \n", "26 1480-01-01 00:00:00 1480-05-01 00:00:00 1482-01-01 00:00:00 \n", "27 1534-06-01 00:00:00 1534-10-01 00:00:00 1536-03-01 00:00:00 \n", "28 1584-04-01 00:00:00 1584-08-01 00:00:00 1586-12-01 00:00:00 \n", "29 1593-04-01 00:00:00 1593-08-01 00:00:00 1595-07-01 00:00:00 \n", "30 1600-02-01 00:00:00 1600-06-01 00:00:00 1603-04-01 00:00:00 \n", "31 1619-04-01 00:00:00 1619-08-01 00:00:00 1621-03-01 00:00:00 \n", "32 1641-01-01 00:00:00 1641-05-01 00:00:00 1644-03-01 00:00:00 \n", "33 1673-05-01 00:00:00 1673-09-01 00:00:00 1675-11-01 00:00:00 \n", "34 1693-06-01 00:00:00 1693-10-01 00:00:00 1696-04-01 00:00:00 \n", "35 1711-04-01 00:00:00 1711-08-01 00:00:00 1713-02-01 00:00:00 \n", "36 1719-04-01 00:00:00 1719-08-01 00:00:00 1722-02-01 00:00:00 \n", "37 1729-08-01 00:00:00 1729-12-01 00:00:00 1731-11-01 00:00:00 \n", "38 1755-10-01 00:00:00 1756-02-01 00:00:00 1757-10-01 00:00:00 \n", "39 1761-09-01 00:00:00 1762-01-01 00:00:00 1765-03-01 00:00:00 \n", "40 1796-04-01 00:00:00 1796-08-01 00:00:00 1798-03-01 00:00:00 \n", "41 1809-04-01 00:00:00 1809-08-01 00:00:00 1812-07-01 00:00:00 \n", "42 1815-04-01 00:00:00 1815-08-01 00:00:00 1818-11-01 00:00:00 \n", "43 1831-04-01 00:00:00 1831-08-01 00:00:00 1833-10-01 00:00:00 \n", "44 1835-01-01 00:00:00 1835-05-01 00:00:00 1838-01-01 00:00:00 \n", "45 1883-08-01 00:00:00 1883-12-01 00:00:00 1886-07-01 00:00:00 \n", "46 1890-02-01 00:00:00 1890-06-01 00:00:00 1892-09-01 00:00:00 \n", "47 1902-06-01 00:00:00 1903-02-01 00:00:00 1905-06-01 00:00:00 \n", "48 1912-06-01 00:00:00 1912-10-01 00:00:00 1914-03-01 00:00:00 \n", "49 1963-03-01 00:00:00 1963-07-01 00:00:00 1965-10-01 00:00:00 \n", "50 1982-05-01 00:00:00 1982-09-01 00:00:00 1984-11-01 00:00:00 \n", "51 1991-06-01 00:00:00 1991-10-01 00:00:00 1994-03-01 00:00:00 \n", "\n", " colmass_global colmass_nh colmass_peak colmass_sh colmass_asy \n", "0 0.000043 0.000054 0.000049 3.194513e-05 0.257352 \n", "1 0.000040 0.000056 0.000045 2.413676e-05 0.394456 \n", "2 0.000020 0.000006 0.000023 3.332373e-05 -0.681185 \n", "3 0.000053 0.000105 0.000059 1.316601e-06 0.975315 \n", "4 0.000032 0.000021 0.000037 4.305554e-05 -0.334261 \n", "5 0.000013 0.000027 0.000015 3.335095e-07 0.975174 \n", "6 0.000042 0.000046 0.000048 3.780502e-05 0.097404 \n", "7 0.000011 0.000023 0.000013 2.878802e-07 0.974759 \n", "8 0.000014 0.000004 0.000017 2.357978e-05 -0.679884 \n", "9 0.000034 0.000050 0.000039 1.851391e-05 0.460709 \n", "10 0.000012 0.000004 0.000014 1.953655e-05 -0.679003 \n", "11 0.000054 0.000017 0.000062 9.111551e-05 -0.679850 \n", "12 0.000077 0.000152 0.000083 1.898998e-06 0.975345 \n", "13 0.000121 0.000203 0.000130 3.847022e-05 0.681380 \n", "14 0.000033 0.000011 0.000039 5.623896e-05 -0.683012 \n", "15 0.000521 0.000575 0.000583 4.669779e-04 0.103261 \n", "16 0.000037 0.000012 0.000043 6.286808e-05 -0.683368 \n", "17 0.000150 0.000066 0.000171 2.349641e-04 -0.563943 \n", "18 0.000116 0.000101 0.000131 1.305372e-04 -0.126561 \n", "19 0.000033 0.000065 0.000037 8.125120e-07 0.975205 \n", "20 0.000071 0.000038 0.000081 1.044301e-04 -0.464731 \n", "21 0.000012 0.000004 0.000015 2.067422e-05 -0.679002 \n", "22 0.000019 0.000021 0.000022 1.713628e-05 0.100297 \n", "23 0.000302 0.000220 0.000341 3.838267e-04 -0.270459 \n", "24 0.000037 0.000072 0.000041 9.043312e-07 0.975238 \n", "25 0.000025 0.000049 0.000028 6.090958e-07 0.975278 \n", "26 0.000012 0.000024 0.000013 2.979188e-07 0.975019 \n", "27 0.000009 0.000003 0.000011 1.478345e-05 -0.674904 \n", "28 0.000040 0.000080 0.000045 1.000327e-06 0.975267 \n", "29 0.000023 0.000007 0.000027 3.823186e-05 -0.681724 \n", "30 0.000103 0.000162 0.000114 4.496620e-05 0.565039 \n", "31 0.000012 0.000004 0.000015 2.051730e-05 -0.679002 \n", "32 0.000100 0.000127 0.000110 7.393494e-05 0.262421 \n", "33 0.000034 0.000028 0.000039 3.973589e-05 -0.168796 \n", "34 0.000065 0.000021 0.000075 1.098490e-04 -0.682529 \n", "35 0.000009 0.000003 0.000011 1.501112e-05 -0.677759 \n", "36 0.000053 0.000104 0.000059 1.304180e-06 0.975315 \n", "37 0.000020 0.000040 0.000021 4.906217e-07 0.975473 \n", "38 0.000013 0.000026 0.000014 3.218071e-07 0.975341 \n", "39 0.000158 0.000312 0.000166 3.835303e-06 0.975700 \n", "40 0.000011 0.000021 0.000012 2.718477e-07 0.974655 \n", "41 0.000111 0.000113 0.000124 1.077773e-04 0.024729 \n", "42 0.000224 0.000236 0.000252 2.119986e-04 0.054069 \n", "43 0.000028 0.000056 0.000032 7.011525e-07 0.975205 \n", "44 0.000078 0.000099 0.000086 5.721119e-05 0.265531 \n", "45 0.000074 0.000078 0.000067 6.928953e-05 0.058266 \n", "46 0.000037 0.000034 0.000034 3.925764e-05 -0.065898 \n", "47 0.000060 0.000061 0.000052 5.856645e-05 0.024405 \n", "48 0.000012 0.000024 0.000018 3.794631e-12 1.000000 \n", "49 0.000042 0.000038 0.000038 4.526499e-05 -0.088478 \n", "50 0.000036 0.000036 0.000034 3.639482e-05 -0.006598 \n", "51 0.000059 0.000065 0.000053 5.352190e-05 0.095867 " ] }, "execution_count": 61, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = pd.concat([df1[df1['colmass_peak']>1e-5], df1850[df1850['colmass_peak']>1e-5]], \n", " ignore_index=True)\n", "df.to_csv('eruptions_855_2000_large.csv')\n", "dtype = {'dtype': 'int32'}\n", "encoding = dict(t_erupt_start=dtype,\n", " t_erupt_peak=dtype,\n", " t_erupt_end=dtype,\n", " ivolc=dtype)\n", "xr.Dataset(df).rename(dim_0='ivolc') \\\n", " .to_netcdf('eruptions_855_2000_large.nc', encoding=encoding)\n", "print('LME Volcanic Eruptions during 855-2000 (large eruptions, i.e global mean colmass peak > 1e-5 kg m**-2)')\n", "df" ] }, { "cell_type": "code", "execution_count": 40, "metadata": { "ExecuteTime": { "end_time": "2019-03-13T19:48:58.816254Z", "start_time": "2019-03-13T19:48:58.804585Z" } }, "outputs": [ { "data": { "text/plain": [ "\n", "Dimensions: (ivolc: 52)\n", "Coordinates:\n", " * ivolc (ivolc) int32 0 1 2 3 4 5 6 7 8 ... 44 45 46 47 48 49 50 51\n", "Data variables:\n", " t_erupt_start (ivolc) object ...\n", " t_erupt_peak (ivolc) object ...\n", " t_erupt_end (ivolc) object ...\n", " colmass_global (ivolc) float64 ...\n", " colmass_nh (ivolc) float64 ...\n", " colmass_peak (ivolc) float64 ...\n", " colmass_sh (ivolc) float64 ...\n", " colmass_asy (ivolc) float64 ..." ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ds = xr.open_dataset('eruptions_855_2000_large.nc')\n", "ds" ] }, { "cell_type": "code", "execution_count": 49, "metadata": { "ExecuteTime": { "end_time": "2019-03-13T19:55:01.993654Z", "start_time": "2019-03-13T19:55:01.980666Z" } }, "outputs": [ { "data": { "text/plain": [ "CFTimeIndex([0865-04-01 00:00:00, 0896-04-01 00:00:00, 0924-04-01 00:00:00,\n", " 0928-04-01 00:00:00, 0956-04-01 00:00:00, 0982-04-01 00:00:00,\n", " 0996-04-01 00:00:00, 1013-04-01 00:00:00, 1025-04-01 00:00:00,\n", " 1076-04-01 00:00:00, 1089-04-01 00:00:00, 1153-04-01 00:00:00,\n", " 1171-05-01 00:00:00, 1208-04-01 00:00:00, 1227-04-01 00:00:00,\n", " 1253-04-01 00:00:00, 1263-04-01 00:00:00, 1270-04-01 00:00:00,\n", " 1279-04-01 00:00:00, 1323-04-01 00:00:00, 1336-04-01 00:00:00,\n", " 1376-04-01 00:00:00, 1411-04-01 00:00:00, 1447-04-01 00:00:00,\n", " 1454-04-01 00:00:00, 1471-03-01 00:00:00, 1475-01-01 00:00:00,\n", " 1529-06-01 00:00:00, 1579-04-01 00:00:00, 1588-04-01 00:00:00,\n", " 1595-02-01 00:00:00, 1614-04-01 00:00:00, 1636-01-01 00:00:00,\n", " 1668-05-01 00:00:00, 1688-06-01 00:00:00, 1706-04-01 00:00:00,\n", " 1714-04-01 00:00:00, 1724-08-01 00:00:00, 1750-10-01 00:00:00,\n", " 1756-09-01 00:00:00, 1791-04-01 00:00:00, 1804-04-01 00:00:00,\n", " 1810-04-01 00:00:00, 1826-04-01 00:00:00, 1830-01-01 00:00:00,\n", " 1878-08-01 00:00:00, 1885-02-01 00:00:00, 1897-06-01 00:00:00,\n", " 1907-06-01 00:00:00, 1958-03-01 00:00:00, 1977-05-01 00:00:00,\n", " 1986-06-01 00:00:00],\n", " dtype='object')" ] }, "execution_count": 49, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t_erupt_shifts = ds.rename(ivolc='time') \\\n", " .assign_coords(time=ds.t_erupt_start.values) \\\n", " .indexes['time'].shift(-60, 'MS')\n", "t_erupt_shifts" ] }, { "cell_type": "code", "execution_count": 99, "metadata": { "ExecuteTime": { "end_time": "2019-03-14T14:15:05.466811Z", "start_time": "2019-03-14T14:15:05.463501Z" } }, "outputs": [ { "data": { "text/plain": [ "numpy.int64" ] }, "execution_count": 99, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a = np.arange(-60, 120)\n", "type(a[0])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## misc" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "ExecuteTime": { "end_time": "2018-10-19T20:38:57.735588Z", "start_time": "2018-10-19T20:38:57.731128Z" } }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%%html\n", "" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.2" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": true } }, "nbformat": 4, "nbformat_minor": 2 }