{ "metadata": { "name": "", "signature": "sha256:7f1fd91946b50b9e074e7ed974d2d6c0161d9ee45bda13d9449c7cc9de25dc79" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Figures displayed on poster for the Knowledge Mobilization Symposium in Halifax" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Possible days: Around Dec 20" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "\n", "import datetime\n", "from glob import glob\n", "import os\n", "\n", "from IPython.core.display import HTML\n", "import netCDF4 as nc\n", "\n", "from salishsea_tools.nowcast import figures\n", "\n", "%matplotlib inline" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [ "def results_dataset(period, grid, results_dir):\n", " \"\"\"Return the results dataset for period (e.g. 1h or 1d)\n", " and grid (e.g. grid_T, grid_U) from results_dir.\n", " \"\"\"\n", " filename_pattern = 'SalishSea_{period}_*_{grid}.nc'\n", " filepaths = glob(os.path.join(results_dir, filename_pattern.format(period=period, grid=grid)))\n", " return nc.Dataset(filepaths[0])" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [ "run_date = datetime.datetime(2014,12,21)\n", "\n", "\n", "# Results dataset location\n", "results_home = '/data/dlatorne/MEOPAR/SalishSea/nowcast/'\n", "results_dir = os.path.join(results_home, run_date.strftime('%d%b%y').lower())\n", "# model winds\n", "model_path = '/ocean/sallen/allen/research/MEOPAR/Operational/'" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 3 }, { "cell_type": "code", "collapsed": false, "input": [ "grid_T_hr = results_dataset('1h', 'grid_T', results_dir)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 4 }, { "cell_type": "code", "collapsed": false, "input": [ "bathy = nc.Dataset('/data/nsoontie/MEOPAR/NEMO-forcing/grid/bathy_meter_SalishSea2.nc')" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 5 }, { "cell_type": "code", "collapsed": false, "input": [ "HTML('