{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "*This notebook contains material from [Controlling Natural Watersheds](https://jckantor.github.io/Controlling-Natural-Watersheds);\n", "content is available [on Github](https://github.com/jckantor/Controlling-Natural-Watersheds.git).*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "< [Rainy Lake Water Levels](http://nbviewer.jupyter.org/github/jckantor/Controlling-Natural-Watersheds/blob/master/notebooks/A.03-Rainy_Lake_Water_Levels.ipynb) | [Contents](toc.ipynb) | [Rainy River Flows](http://nbviewer.jupyter.org/github/jckantor/Controlling-Natural-Watersheds/blob/master/notebooks/A.05-Rainy_River_Flows.ipynb) >
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Namakan Lake Water Levels" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The purpose of this notebook is to create a data series for the water level on Namakan Lake. The data series is written to a file `NL.pkl` that can be read into other notebooks using `NL = pd.read_pickle('../data/NL.pkl')`.\n", "\n", "The data series is constructed using data from stations 05PA003 from the Water Survey of Canada." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Read Data from Water Survey of Canada" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The Water Survey of Canada currently maintains a station on Namakan Lake recording lake level. Station 05PA003, located just upstream of Kettle Falls, has been in place since 1911.\n", "\n", "The data set is imported into the workspace by running the Water Survey of Canada notebook." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# Display graphics inline with the notebook\n", "%matplotlib inline\n", "\n", "# Standard Python modules\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import pandas as pd\n", "import os\n", "import datetime\n", "import requests\n", "\n", "import seaborn as sns\n", "sns.set_context('talk')\n", "\n", "# Modules to display images and data tables\n", "from IPython.display import Image\n", "from IPython.core.display import display\n", "\n", "WSC_STATIONS = pd.read_pickle('../data/WSC_STATIONS')\n", "WSC_LEVELS = pd.read_pickle('../data/WSC_LEVELS')\n", "\n", "def mapWSC(stationList):\n", " # returns a .png map image\n", " S = WSC_STATIONS.ix[stationList,['STATION_NAME','LATITUDE','LONGITUDE']]\n", " locs = [\"{0},{1}\".format(S.ix[s,'LATITUDE'], S.ix[s,'LONGITUDE']) \\\n", " for s in S.index]\n", " google_maps_url = \\\n", " \"https://maps.googleapis.com/maps/api/staticmap?\" + \\\n", " \"size=640x320\" + \\\n", " \"&maptype=terrain\" + \\\n", " \"&markers=color:red%7Csize:mid%7C\" + \"|\".join(locs)\n", " display(S)\n", " return Image(requests.get(google_maps_url).content)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | STATION_NAME | \n", "LATITUDE | \n", "LONGITUDE | \n", "
---|---|---|---|
STATION_NUMBER | \n", "\n", " | \n", " | \n", " |
05PA003 | \n", "NAMAKAN LAKE ABOVE KETTLE FALLS DAM | \n", "48.50000 | \n", "-92.63886 | \n", "
05PA013 | \n", "NAMAKAN LAKE AT SQUIRREL ISLAND | \n", "48.49686 | \n", "-92.65856 | \n", "
" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "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.3" } }, "nbformat": 4, "nbformat_minor": 2 }