{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# inter-run comparisons of N contained in phytoplankton\n", " - S3\n", " - Sentry Shoal\n", " - Central Node\n", " - JDF" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import pandas as pd\n", "import netCDF4 as nc\n", "import datetime as dt\n", "import subprocess\n", "import requests\n", "import matplotlib.pyplot as plt\n", "import cmocean\n", "import numpy as np\n", "import os\n", "import re\n", "import dateutil as dutil\n", "from salishsea_tools import viz_tools, places\n", "import glob\n", "import pickle\n", "import matplotlib.dates as mdates\n", "import matplotlib as mpl\n", "mpl.rc('xtick', labelsize=14) \n", "mpl.rc('ytick', labelsize=16) \n", "mpl.rc('legend', fontsize=16) \n", "mpl.rc('axes', titlesize=16) \n", "mpl.rc('figure', titlesize=16) \n", "mpl.rc('axes', labelsize=16) \n", "mpl.rc('font', size=16) \n", "\n", "mpl.rcParams['font.size'] = 16\n", "mpl.rcParams['axes.titlesize'] = 16\n", "mpl.rcParams['legend.numpoints'] = 1\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "plist=['Sentry Shoal','S3','Central node','Central SJDF']" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/eolson/anaconda3/envs/python36/lib/python3.6/site-packages/IPython/core/interactiveshell.py:2698: DtypeWarning: Columns (7,9) have mixed types. Specify dtype option on import or set low_memory=False.\n", " interactivity=interactivity, compiler=compiler, result=result)\n", "/home/eolson/anaconda3/envs/python36/lib/python3.6/site-packages/IPython/core/interactiveshell.py:2698: DtypeWarning: Columns (3,5,7,9) have mixed types. Specify dtype option on import or set low_memory=False.\n", " interactivity=interactivity, compiler=compiler, result=result)\n", "/home/eolson/anaconda3/envs/python36/lib/python3.6/site-packages/IPython/core/interactiveshell.py:2698: DtypeWarning: Columns (1,3,5,7,9) have mixed types. Specify dtype option on import or set low_memory=False.\n", " interactivity=interactivity, compiler=compiler, result=result)\n", "/home/eolson/anaconda3/envs/python36/lib/python3.6/site-packages/IPython/core/interactiveshell.py:2698: DtypeWarning: Columns (1) have mixed types. Specify dtype option on import or set low_memory=False.\n", " interactivity=interactivity, compiler=compiler, result=result)\n", "/home/eolson/anaconda3/envs/python36/lib/python3.6/site-packages/IPython/core/interactiveshell.py:2698: DtypeWarning: Columns (3) have mixed types. Specify dtype option on import or set low_memory=False.\n", " interactivity=interactivity, compiler=compiler, result=result)\n" ] } ], "source": [ "flist=['search4979680/BritishColumbiaFerries_Tsawwassen-DukePoint_Turbidity-ChlorophyllandFluorescence_20170217T003041Z_20170315T031911Z-clean.csv',\n", " 'search4979680/BritishColumbiaFerries_Tsawwassen-DukePoint_Turbidity-ChlorophyllandFluorescence_20170315T031912Z_20170404T195130Z-clean.csv',\n", " 'search4979680/BritishColumbiaFerries_Tsawwassen-DukePoint_Turbidity-ChlorophyllandFluorescence_20170404T195131Z_20170426T173215Z-clean.csv',\n", " 'search4979680/BritishColumbiaFerries_Tsawwassen-DukePoint_Turbidity-ChlorophyllandFluorescence_20170426T173216Z_20170522T011843Z-clean.csv',\n", " 'search4979680/BritishColumbiaFerries_Tsawwassen-DukePoint_Turbidity-ChlorophyllandFluorescence_20170522T011844Z_20170611T234016Z-clean.csv',\n", " 'search4979680/BritishColumbiaFerries_Tsawwassen-DukePoint_Turbidity-ChlorophyllandFluorescence_20170611T234017Z_20170702T172228Z-clean.csv',\n", " 'search4979680/BritishColumbiaFerries_Tsawwassen-DukePoint_Turbidity-ChlorophyllandFluorescence_20170702T172229Z_20170722T182606Z-clean.csv',\n", " 'search4979680/BritishColumbiaFerries_Tsawwassen-DukePoint_Turbidity-ChlorophyllandFluorescence_20170722T182607Z_20170815T213737Z-clean.csv',\n", " 'search4979680/BritishColumbiaFerries_Tsawwassen-DukePoint_Turbidity-ChlorophyllandFluorescence_20170815T213738Z_20170825T225506Z-clean.csv',\n", " 'search7672208/BritishColumbiaFerries_Tsawwassen-DukePoint_Turbidity-ChlorophyllandFluorescence_20170825T225507Z_20170923T032427Z-clean.csv',\n", " 'search7672208/BritishColumbiaFerries_Tsawwassen-DukePoint_Turbidity-ChlorophyllandFluorescence_20170923T032428Z_20171016T213134Z-clean.csv',\n", " 'search7672208/BritishColumbiaFerries_Tsawwassen-DukePoint_Turbidity-ChlorophyllandFluorescence_20171016T213135Z_20180108T160335Z-clean.csv',]\n", "dfs=list()\n", "for ii in range(0,len(flist)):\n", " dfs.append(pd.read_csv('/ocean/eolson/MEOPAR/obs/ONC/turbidity/nearSurface/'+flist[ii],\n", " skiprows=67,header=None,usecols=[0,1,2,3,4,5,6,7,8,9,10],\n", " names=('TimeUTC','CDOM','CDOMQC','Chlorophyll_ug','ChlQC','Turbidity_NTU','TurbQC','Lat','LatQC','Lon','LongQC')))" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [], "source": [ "df=pd.concat(dfs,ignore_index=True)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [], "source": [ "dts=[dt.datetime(int(r[0:4]),int(r[5:7]),int(r[8:10]),int(r[11:13]),int(r[14:16]),int(r[17:19])) for r in df['TimeUTC']]" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [], "source": [ "df=df.assign(dts=dts)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": true }, "outputs": [], "source": [ "df['Lat']=pd.to_numeric(df['Lat'],errors='coerce')\n", "df['Lon']=pd.to_numeric(df['Lon'],errors='coerce')" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
| \n", " | TimeUTC | \n", "CDOM | \n", "CDOMQC | \n", "Chlorophyll_ug | \n", "ChlQC | \n", "Turbidity_NTU | \n", "TurbQC | \n", "Lat | \n", "LatQC | \n", "Lon | \n", "LongQC | \n", "dts | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "2017-02-17T00:30:42.369Z | \n", "14.37 | \n", "1 | \n", "2.0178 | \n", "1 | \n", "25.0716 | \n", "1 | \n", "49.177814 | \n", "8 | \n", "-123.641612 | \n", "8 | \n", "2017-02-17 00:30:42 | \n", "
| 1 | \n", "2017-02-17T00:30:43.444Z | \n", "13.9868 | \n", "1 | \n", "1.9352 | \n", "1 | \n", "23.664 | \n", "1 | \n", "49.177854 | \n", "8 | \n", "-123.641739 | \n", "8 | \n", "2017-02-17 00:30:43 | \n", "
| 2 | \n", "2017-02-17T00:30:44.518Z | \n", "13.9868 | \n", "1 | \n", "1.9352 | \n", "1 | \n", "23.7864 | \n", "1 | \n", "49.177895 | \n", "8 | \n", "-123.641867 | \n", "8 | \n", "2017-02-17 00:30:44 | \n", "
| 3 | \n", "2017-02-17T00:30:45.593Z | \n", "13.9868 | \n", "1 | \n", "1.9116 | \n", "1 | \n", "23.4396 | \n", "1 | \n", "49.177935 | \n", "8 | \n", "-123.641994 | \n", "8 | \n", "2017-02-17 00:30:45 | \n", "
| 4 | \n", "2017-02-17T00:30:46.667Z | \n", "14.0826 | \n", "1 | \n", "1.9352 | \n", "1 | \n", "23.358 | \n", "1 | \n", "49.177975 | \n", "8 | \n", "-123.642122 | \n", "8 | \n", "2017-02-17 00:30:46 | \n", "