Skip to content

Commit

Permalink
Restore transients, these were incidentily removed
Browse files Browse the repository at this point in the history
  • Loading branch information
keesvanginkel committed Sep 17, 2021
1 parent 2354aea commit 246164e
Show file tree
Hide file tree
Showing 10 changed files with 200 additions and 0 deletions.
200 changes: 200 additions & 0 deletions SLR_projections/PDF_approach.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# PDF SLR - Horton et al.\n",
"Horton, B.P., Khan, N.S., Cahill, N. et al. Estimating global mean sea-level rise and its uncertainties by 2100 and 2300 from an expert survey. npj Clim Atmos Sci 3, 18 (2020). https://doi.org/10.1038/s41612-020-0121-5\n",
"### Draw sea level rise projections from probability density functions"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import os\n",
"import pandas as pd\n",
"from pathlib import Path"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"p = Path().absolute() / 'Horton_PDFs' #move to subfolder with pathlib\n",
"files = list(p.glob(\"*.csv\")) #open all csv-files in this folder\n",
"\n",
"for file in files:\n",
" pass"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"WindowsPath('D:/Python/Urban-SETP/SLR_projections/Horton_PDFs/rsl_pred_SurveyH14_Blue_2100.csv')"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"file = files[0]\n",
"file"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>value</th>\n",
" </tr>\n",
" <tr>\n",
" <th>name</th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0.001</th>\n",
" <td>0.054063</td>\n",
" </tr>\n",
" <tr>\n",
" <th>0.002</th>\n",
" <td>0.068623</td>\n",
" </tr>\n",
" <tr>\n",
" <th>0.003</th>\n",
" <td>0.078123</td>\n",
" </tr>\n",
" <tr>\n",
" <th>0.004</th>\n",
" <td>0.085309</td>\n",
" </tr>\n",
" <tr>\n",
" <th>0.005</th>\n",
" <td>0.091256</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>0.996</th>\n",
" <td>1.325282</td>\n",
" </tr>\n",
" <tr>\n",
" <th>0.997</th>\n",
" <td>1.364257</td>\n",
" </tr>\n",
" <tr>\n",
" <th>0.998</th>\n",
" <td>1.415482</td>\n",
" </tr>\n",
" <tr>\n",
" <th>0.999</th>\n",
" <td>1.492232</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1.000</th>\n",
" <td>1.642124</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>1000 rows × 1 columns</p>\n",
"</div>"
],
"text/plain": [
" value\n",
"name \n",
"0.001 0.054063\n",
"0.002 0.068623\n",
"0.003 0.078123\n",
"0.004 0.085309\n",
"0.005 0.091256\n",
"... ...\n",
"0.996 1.325282\n",
"0.997 1.364257\n",
"0.998 1.415482\n",
"0.999 1.492232\n",
"1.000 1.642124\n",
"\n",
"[1000 rows x 1 columns]"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = pd.read_csv(file,index_col=0)\n",
"df.index = df.index/1000 #convert to probability [0.001,1]\n",
"df.value = df.value/100 #convert to cm\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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.8.2"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Binary file added SLR_projections/Transients/Scenario_01.pkl
Binary file not shown.
Binary file added SLR_projections/Transients/Scenario_02.pkl
Binary file not shown.
Binary file added SLR_projections/Transients/Scenario_03.pkl
Binary file not shown.
Binary file added SLR_projections/Transients/Scenario_04.pkl
Binary file not shown.
Binary file added SLR_projections/Transients/Scenario_05.pkl
Binary file not shown.
Binary file added SLR_projections/Transients/Scenario_06.pkl
Binary file not shown.
Binary file added SLR_projections/Transients/Scenario_07.pkl
Binary file not shown.
Binary file added SLR_projections/Transients/Scenario_08.pkl
Binary file not shown.
Binary file added SLR_projections/Transients/Scenario_09.pkl
Binary file not shown.

0 comments on commit 246164e

Please sign in to comment.