{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Investigate how dune toe compares to R_high" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2018-12-03T03:38:44.538853Z", "start_time": "2018-12-03T03:38:44.189514Z" } }, "outputs": [], "source": [ "%matplotlib inline\n", "%reload_ext autoreload\n", "%autoreload" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2018-12-03T03:38:46.213387Z", "start_time": "2018-12-03T03:38:44.781382Z" } }, "outputs": [], "source": [ "from IPython.core.debugger import set_trace\n", "\n", "import pandas as pd\n", "import numpy as np\n", "import os\n", "\n", "import plotly\n", "import plotly.graph_objs as go\n", "import plotly.plotly as py\n", "import plotly.tools as tls\n", "import plotly.figure_factory as ff\n", "import plotly.io as pio" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Load data\n", "Load data from the `./data/interim/` folder and parse into `pandas` dataframes." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2018-12-03T03:38:53.297184Z", "start_time": "2018-12-03T03:38:46.365829Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Importing profiles.csv\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\z5189959\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\numpy\\lib\\arraysetops.py:472: FutureWarning:\n", "\n", "elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison\n", "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Importing profile_features.csv\n", "Importing impacts_forecasted_foreshore_slope_sto06.csv\n", "Importing impacts_forecasted_mean_slope_sto06.csv\n", "Importing impacts_observed.csv\n", "Importing twl_foreshore_slope_sto06.csv\n", "Importing twl_mean_slope_sto06.csv\n", "Done!\n" ] } ], "source": [ "def df_from_csv(csv, index_col, data_folder='../data/interim'):\n", " print('Importing {}'.format(csv))\n", " return pd.read_csv(os.path.join(data_folder,csv), index_col=index_col)\n", "\n", "df_profiles = df_from_csv('profiles.csv', index_col=[0, 1, 2])\n", "df_profile_features = df_from_csv('profile_features.csv', index_col=[0])\n", "\n", "impacts = {\n", " 'forecasted': {\n", " 'foreshore_slope_sto06': df_from_csv('impacts_forecasted_foreshore_slope_sto06.csv', index_col=[0]),\n", " 'mean_slope_sto06': df_from_csv('impacts_forecasted_mean_slope_sto06.csv', index_col=[0]),\n", " },\n", " 'observed': df_from_csv('impacts_observed.csv', index_col=[0])\n", " }\n", "\n", "twls = {\n", " 'forecasted': {\n", " 'foreshore_slope_sto06': df_from_csv('twl_foreshore_slope_sto06.csv', index_col=[0, 1]),\n", " 'mean_slope_sto06':df_from_csv('twl_mean_slope_sto06.csv', index_col=[0, 1]),\n", " }\n", "}\n", "\n", "print('Done!')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Compare underpredicted cases" ] }, { "cell_type": "code", "execution_count": 39, "metadata": { "ExecuteTime": { "end_time": "2018-12-03T04:05:30.984007Z", "start_time": "2018-12-03T04:05:30.805508Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " | dune_toe_z | \n", "R_high | \n", "diff | \n", "
---|---|---|---|
AVOCAn0005 | \n", "3.306 | \n", "3.260440 | \n", "-0.045560 | \n", "
AVOCAn0008 | \n", "3.507 | \n", "3.220084 | \n", "-0.286916 | \n", "
BILG0005 | \n", "4.807 | \n", "3.293445 | \n", "-1.513555 | \n", "
BLUEYS0001 | \n", "3.064 | \n", "2.800144 | \n", "-0.263856 | \n", "
BLUEYS0002 | \n", "2.929 | \n", "2.470641 | \n", "-0.458359 | \n", "
Failed to display Jupyter Widget of type FigureWidget
.
\n", " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", " that the widgets JavaScript is still loading. If this message persists, it\n", " likely means that the widgets JavaScript library is either not installed or\n", " not enabled. See the Jupyter\n", " Widgets Documentation for setup instructions.\n", "
\n", "\n", " If you're reading this message in another frontend (for example, a static\n", " rendering on GitHub or NBViewer),\n", " it may mean that your frontend doesn't currently support widgets.\n", "
\n" ], "text/plain": [ "FigureWidget({\n", " 'data': [{'type': 'histogram',\n", " 'uid': '75f0d11f-9242-4fc7-b433-1f04e1e37ba6',\n", " 'y': [-0.045560088746212646, -0.28691603912686325,\n", " -1.5135547360075963, ..., -0.4613631587476821,\n", " -0.5212332930925054, -0.3948507473332721]}],\n", " 'layout': {'bargap': 0.2,\n", " 'bargroupgap': 0.1,\n", " 'title': 'D_low - R_high\n", " | dune_toe_z | \n", "R_high | \n", "diff | \n", "
---|---|---|---|
AVOCAn0004 | \n", "3.178 | \n", "3.416988 | \n", "0.238988 | \n", "
BOOM0004 | \n", "3.065 | \n", "3.074980 | \n", "0.009980 | \n", "
BOOM0011 | \n", "2.771 | \n", "6.491824 | \n", "3.720824 | \n", "
BOOM0012 | \n", "2.796 | \n", "3.148087 | \n", "0.352087 | \n", "
CATHIE0001 | \n", "2.780 | \n", "3.522792 | \n", "0.742792 | \n", "
Failed to display Jupyter Widget of type FigureWidget
.
\n", " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", " that the widgets JavaScript is still loading. If this message persists, it\n", " likely means that the widgets JavaScript library is either not installed or\n", " not enabled. See the Jupyter\n", " Widgets Documentation for setup instructions.\n", "
\n", "\n", " If you're reading this message in another frontend (for example, a static\n", " rendering on GitHub or NBViewer),\n", " it may mean that your frontend doesn't currently support widgets.\n", "
\n" ], "text/plain": [ "FigureWidget({\n", " 'data': [{'type': 'histogram',\n", " 'uid': '4a284474-2be1-4fd7-87d5-25364cc78df4',\n", " 'y': [0.23898814460475037, 0.009980312001434566, 3.720823710344608,\n", " ..., 1.5720238663972683, 0.912998680585452, 1.1419977620500927]}],\n", " 'layout': {'bargap': 0.2,\n", " 'bargroupgap': 0.1,\n", " 'title': 'D_low - R_high