{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import datetime as dt\n", "import os\n", "import re\n", "from matplotlib import pyplot as plt\n", "from pandas.plotting import register_matplotlib_converters\n", "register_matplotlib_converters()\n", "import netCDF4 as nc\n", "\n", "from sqlalchemy.sql import select, and_, or_, not_, func\n", "from sqlalchemy import create_engine, Column, String, Integer, Boolean, MetaData, Table, case, between, ForeignKey, desc\n", "from sqlalchemy.orm import mapper, create_session, relationship\n", "from sqlalchemy.ext.declarative import declarative_base\n", "from sqlalchemy.ext.automap import automap_base\n", "import sqlalchemy.types as types\n", "from sqlalchemy.sql import select, and_, or_, not_, func\n", "from time import strptime\n", "import string\n", "import pandas as pd\n", "from dateutil.parser import parse as dutparse\n", "\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [], "source": [ "basepath='/ocean/eolson/MEOPAR/obs/'\n", "basedir=basepath + 'ECBuoy/'\n", "dbname='ECBuoy'\n", "Base = automap_base()\n", "engine = create_engine('sqlite:///' + basedir + dbname + '.sqlite', echo = False)\n", "# reflect the tables in salish.sqlite:\n", "Base.prepare(engine, reflect=True)\n", "# mapped classes have been created\n", "FBuoyTBL=Base.classes.FBuoyTBL\n", "FlowTBL=Base.classes.FlowTBL\n", "session = create_session(bind = engine, autocommit = False, autoflush = True)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "df=pd.DataFrame(session.query(FlowTBL.DecDay,FlowTBL.RateHope).filter(FlowTBL.RateHope>=0).all())" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": true }, "outputs": [], "source": [ "dts=[dt.datetime(1900,1,1)+dt.timedelta(days=ii) for ii in df['DecDay']]" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [], "source": [ "df['YD']=[(ii-dt.datetime(ii.year-1,12,31)).days for ii in dts]\n", "df['Year']=[ii.year for ii in dts]" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": true }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA7UAAAD8CAYAAACo5oMMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAHmRJREFUeJzt3X+QrXddH/D3JzdeKraYQIJifjSpjU4BHYsrsO3UrqRCYBzCFLFYp0RlegeKVmytEClNK9qgOOXHWMOkkiZ0KEiJlswUhPQOW/xjg2yQ34hJQck10QSD1BmUQPz2j/Osd3Pv3uzZs2f3nOd5Xq+ZnXP2e55z9vvsOd9znvfz/XGqtRYAAADoo7MWXQEAAACYlVALAABAbwm1AAAA9JZQCwAAQG8JtQAAAPSWUAsAAEBvCbUAAAD0llALAABAbwm1AAAA9NbZi67ArM4777x2ySWXLLoaAAAAHIDbb7/9862183fbrreh9pJLLsnm5uaiqwEAAMABqKo/mGY7w48BAADoLaEWAACA3hJqAQAA6C2hFgAAgN4SagEAAOgtoRYAAIDeEmoBmNjYSK69dnIJANATvf2eWgDmaGMjufzy5IEHkqNHk+PHk9XVRdcKAGBXemoBSNbXJ4H2wQcnl+vri64RAMBUhFoAkrW1SQ/tkSOTy7W1RdcIAGAqhh8DMBlqfPz4pId2bc3QYwCgN4RaACZWV4VZAKB3DD8GAACgt4RaAAAAekuoBQAAoLeEWgAAAHpLqAUAAKC3hFoAAAB6S6gFAACgt4RaAAAAekuoBQAAoLeEWgAAAHpLqAUAAKC3hFoAAAB6S6gFAACgt4RaAAAAekuoBQAAoLeEWgAAAHpr11BbVTdU1b1V9fEdbvupqmpVdV73e1XVG6rqzqr6aFU9adu2V1XVHd3PVdvKv7Oq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oT20JI/qrn99kru76z4bGKzW2j2ttQ911/8syaeSXJDJ6/6mbrObkjynu649HBChdu9+NMm7u+sXJLlr220nujIYrKp6dpI/bK195JSbtAfG5luS/IOq+kBV/Z+q+q6uXFtgjF6a5DVVdVcmoxau7sq1B0ahqi5J8neTfCDJN7TW7kkmwTfJY7vNtIcDItTuQVW9IpNhBm/ZKtphM8tJM1hV9cgkr8hkaNlpN+9Qpj0wZGcnOTeTIWf/Jsnbq6qiLTBOL07yk621i5L8ZJI3deXaA4NXVX89yc1JXtpa+38Pt+kOZdrDHAi1U6qqq5J8X5Ifaie/B+lEkou2bXZhTg63gSH65iSXJvlIVf1+Jq/5D1XVN0Z7YHxOJPn1bhjZbyf5yyTnRVtgnK5K8uvd9f+Rk0PutQcGraq+JpNA+5bW2lYb+OOtYcXd5db0FO3hgAi1U6iqK5K8LMmzW2tf2nbTLUmeX1WPqKpLM5n0/duLqCMchtbax1prj22tXdJauySTN+cntdb+KJP28IJuZb+nJvni1tAbGKj/meRpSVJV35LkaJLPx2cD43R3kn/YXX9akju66z4bGKxudM6bknyqtfaftt10SyYnetJdvnNbufZwAM5edAWWTVW9NclakvOq6kSSazKZF/KIJLdOXru5rbX2otbaJ6rq7Uk+mcmw5Je01h5cTM1h/nZqD621N51h83cleVYmi+J8KcmPHEol4RCc4bPhhiQ3dF9r8kCSq7qRPD4bGLQztId/nuT1VXV2kr/IZGXXxGcDw/b3k/yzJB+rqg93ZT+T5NWZTEl5YSbfFPG87jbt4YDUyZG0AAAA0C+GHwMAANBbQi0AAAC9JdQCAADQW0ItAAAAvSXUAgAA0FtCLQAAAL0l1AIAANBbQi0AAAC99f8BPM2az+3YqUgAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "fig,ax=plt.subplots(1,1,figsize=(16,4))\n", "for yr in np.unique(df['Year']):\n", " df2=df.loc[df.Year==yr]\n", " maxval=np.max(df2['RateHope'])\n", " ax.plot(df2.loc[df2.RateHope==maxval,['YD']].values[0],maxval,'r.')" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "121 2015-05-01 00:00:00\n", "140 2015-05-20 00:00:00\n", "160 2015-06-09 00:00:00\n", "180 2015-06-29 00:00:00\n", "200 2015-07-19 00:00:00\n", "135 2015-05-15 00:00:00\n", "190 2015-07-09 00:00:00\n" ] } ], "source": [ "for iid in (121,140,160,180,200,135,190):\n", " print(iid, dt.datetime(2014,12,31)+dt.timedelta(days=iid))" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "collapsed": true }, "outputs": [], "source": [ "session.close()\n", "engine.dispose()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python [conda env:py37]", "language": "python", "name": "conda-env-py37-py" }, "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" } }, "nbformat": 4, "nbformat_minor": 0 }