From 82d71ff75878d33af7ad7a3a59a8038ce1e49d06 Mon Sep 17 00:00:00 2001 From: Erik van Sebille Date: Fri, 7 Jul 2017 09:52:35 +0100 Subject: [PATCH] removing superfluous plotting notebook script --- experiment_scripts/plotting.ipynb | 92 ------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 experiment_scripts/plotting.ipynb diff --git a/experiment_scripts/plotting.ipynb b/experiment_scripts/plotting.ipynb deleted file mode 100644 index 5249f46..0000000 --- a/experiment_scripts/plotting.ipynb +++ /dev/null @@ -1,92 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from netCDF4 import Dataset\n", - "import numpy as np\n", - "import matplotlib.pyplot as plt\n", - "from mpl_toolkits.basemap import Basemap\n", - "%pylab inline" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "class ParticleData(object):\n", - " def __init__(self):\n", - " self.id = []\n", - "\n", - "def load_particles_file(fname, varnames):\n", - " T = ParticleData()\n", - " pfile = Dataset(fname, 'r')\n", - " T.id = pfile.variables['trajectory'][:]\n", - "\n", - " for v in varnames:\n", - " setattr(T, v, pfile.variables[v][:])\n", - "\n", - " return T" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "T = load_particles_file('corefootprint_particles_array.nc', ['lon', 'lat', 'temp', 'z'])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "pylab.rcParams['figure.figsize'] = (10, 5)\n", - "m = Basemap(projection='merc', llcrnrlat=-43, urcrnrlat=-27, llcrnrlon=9, urcrnrlon=34, resolution='h')\n", - "m.drawcoastlines()\n", - "\n", - "sinks=np.where(T.z>50.)\n", - "dwell=np.where(T.z==50.)\n", - "xs, ys = m(T.lon[dwell], T.lat[dwell])\n", - "m.scatter(xs, ys, c=T.temp[dwell], s=5)\n", - "plt.colorbar()\n", - "xs, ys = m(T.lon[sinks], T.lat[sinks])\n", - "m.scatter(xs, ys, c='k', s=5)\n", - "xs, ys = m(T.lon[0, 0], T.lat[0, 0])\n", - "m.plot(xs, ys, 'om')\n", - "plt.show()" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 2", - "language": "python", - "name": "python2" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 2 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.13" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -}