{ "cells": [ { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import netCDF4 as nc\n", "import pickle\n", "import pandas as pd\n", "import os\n", "import datetime as dt\n", "\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "saveloc='/ocean/aisabell/MEOPAR/extracted_files/'\n", "modver='201812'\n", "loc='S3'" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "# loop through years\n", "years=list()\n", "bloomtime1=list()\n", "for year in range(2015,2019):\n", " fname=f'springTimeSeries_{str(year)}_{loc}_{modver}.pkl'\n", " savepath=os.path.join(saveloc,fname)\n", " bio_time,sno3,sdiat,sflag,scili,diat_alld,no3_alld,flag_alld,cili_alld,phyto_alld,intdiat,intphyto,spar,fracdiat,sphyto,percdiat,\\\n", " u_wind,v_wind,twind,solar,wspeed,winddirec,riv_time,rivFlow=pickle.load(open(savepath,'rb'))\n", " # put code that calculates bloom timing here\n", " bt1=dt.datetime(year, 3,1)\n", " years.append(year)\n", " bloomtime1.append(bt1)\n", "years=np.array(years)\n", "bloomtime1=np.array(bloomtime1)" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([2015, 2016, 2017, 2018])" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "years" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[datetime.datetime(2015, 3, 1, 0, 0),\n", " datetime.datetime(2016, 3, 1, 0, 0),\n", " datetime.datetime(2017, 3, 1, 0, 0),\n", " datetime.datetime(2018, 3, 1, 0, 0)]" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bloomtime1" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python (py39)", "language": "python", "name": "py39" }, "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.9.1" } }, "nbformat": 4, "nbformat_minor": 4 }