2536 lines
80 KiB
Plaintext
2536 lines
80 KiB
Plaintext
{
|
||
"cells": [
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"# FloPy\n",
|
||
"\n",
|
||
"## MNW2 package example"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 1,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"3.8.6 | packaged by conda-forge | (default, Oct 7 2020, 18:42:56) \n",
|
||
"[Clang 10.0.1 ]\n",
|
||
"numpy version: 1.18.5\n",
|
||
"pandas version: 1.0.5\n",
|
||
"flopy version: 3.3.3\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"import sys\n",
|
||
"import os\n",
|
||
"import numpy as np\n",
|
||
"try:\n",
|
||
" import pandas as pd\n",
|
||
"except:\n",
|
||
" pass\n",
|
||
"\n",
|
||
"# run installed version of flopy or add local path\n",
|
||
"try:\n",
|
||
" import flopy\n",
|
||
"except:\n",
|
||
" fpth = os.path.abspath(os.path.join('..', '..'))\n",
|
||
" sys.path.append(fpth)\n",
|
||
" import flopy\n",
|
||
"\n",
|
||
"print(sys.version)\n",
|
||
"print('numpy version: {}'.format(np.__version__))\n",
|
||
"try:\n",
|
||
" print('pandas version: {}'.format(pd.__version__))\n",
|
||
"except:\n",
|
||
" pass\n",
|
||
"print('flopy version: {}'.format(flopy.__version__))"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"### Make an MNW2 package from scratch"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 2,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"m = flopy.modflow.Modflow('mnw2example', model_ws='data')\n",
|
||
"dis = flopy.modflow.ModflowDis(nrow=5, ncol=5, nlay=3, nper=3, top=10, botm=0, model=m)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"### MNW2 information by node\n",
|
||
"(this could be prepared externally from well reconds and read in from a csv or excel file)\n",
|
||
"* this table has two multi-node wells, the first (well1) consisting of two nodes that are manually specified\n",
|
||
"(where the variable **rw** is specified by node)\n",
|
||
"* node that some variables that are constant for the whole well are also included (losstype, zpump, etc.)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 3,
|
||
"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>i</th>\n",
|
||
" <th>j</th>\n",
|
||
" <th>ztop</th>\n",
|
||
" <th>zbotm</th>\n",
|
||
" <th>wellid</th>\n",
|
||
" <th>losstype</th>\n",
|
||
" <th>pumploc</th>\n",
|
||
" <th>qlimit</th>\n",
|
||
" <th>ppflag</th>\n",
|
||
" <th>pumpcap</th>\n",
|
||
" <th>rw</th>\n",
|
||
" <th>rskin</th>\n",
|
||
" <th>kskin</th>\n",
|
||
" <th>zpump</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>1</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>9.5</td>\n",
|
||
" <td>7.1</td>\n",
|
||
" <td>well1</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>5.0</td>\n",
|
||
" <td>6.2</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>1</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>7.1</td>\n",
|
||
" <td>5.1</td>\n",
|
||
" <td>well1</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.5</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>5.0</td>\n",
|
||
" <td>6.2</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>3</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>9.1</td>\n",
|
||
" <td>3.7</td>\n",
|
||
" <td>well2</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>5.0</td>\n",
|
||
" <td>4.1</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" i j ztop zbotm wellid losstype pumploc qlimit ppflag pumpcap rw \\\n",
|
||
"0 1 1 9.5 7.1 well1 skin -1 0 0 0 1.0 \n",
|
||
"1 1 1 7.1 5.1 well1 skin -1 0 0 0 0.5 \n",
|
||
"2 3 3 9.1 3.7 well2 skin -1 0 0 0 1.0 \n",
|
||
"\n",
|
||
" rskin kskin zpump \n",
|
||
"0 2.0 5.0 6.2 \n",
|
||
"1 2.0 5.0 6.2 \n",
|
||
"2 2.0 5.0 4.1 "
|
||
]
|
||
},
|
||
"execution_count": 3,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"node_data = pd.DataFrame([[1, 1, 9.5, 7.1, 'well1', 'skin', -1, 0, 0, 0, 1., 2., 5., 6.2],\n",
|
||
" [1, 1, 7.1, 5.1, 'well1', 'skin', -1, 0, 0, 0, 0.5, 2., 5., 6.2],\n",
|
||
" [3, 3, 9.1, 3.7, 'well2', 'skin', -1, 0, 0, 0, 1., 2., 5., 4.1]], \n",
|
||
" columns=['i', 'j', 'ztop', 'zbotm', 'wellid', 'losstype', 'pumploc', 'qlimit', 'ppflag', 'pumpcap', \n",
|
||
" 'rw', 'rskin', 'kskin', 'zpump'])\n",
|
||
"node_data"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"#### convert the DataFrame to a recarray for compatibility with flopy"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 4,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"rec.array([(0, 1, 1, 9.5, 7.1, 'well1', 'skin', -1, 0, 0, 0, 1. , 2., 5., 6.2),\n",
|
||
" (1, 1, 1, 7.1, 5.1, 'well1', 'skin', -1, 0, 0, 0, 0.5, 2., 5., 6.2),\n",
|
||
" (2, 3, 3, 9.1, 3.7, 'well2', 'skin', -1, 0, 0, 0, 1. , 2., 5., 4.1)],\n",
|
||
" dtype=[('index', '<i8'), ('i', '<i8'), ('j', '<i8'), ('ztop', '<f8'), ('zbotm', '<f8'), ('wellid', 'O'), ('losstype', 'O'), ('pumploc', '<i8'), ('qlimit', '<i8'), ('ppflag', '<i8'), ('pumpcap', '<i8'), ('rw', '<f8'), ('rskin', '<f8'), ('kskin', '<f8'), ('zpump', '<f8')])"
|
||
]
|
||
},
|
||
"execution_count": 4,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"node_data = node_data.to_records()\n",
|
||
"node_data"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"### Stress period information\n",
|
||
"(could also be developed externally)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 5,
|
||
"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>per</th>\n",
|
||
" <th>wellid</th>\n",
|
||
" <th>qdes</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>well1</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>1</td>\n",
|
||
" <td>well1</td>\n",
|
||
" <td>100.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>well2</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>1</td>\n",
|
||
" <td>well2</td>\n",
|
||
" <td>1000.0</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" per wellid qdes\n",
|
||
"0 0 well1 0.0\n",
|
||
"1 1 well1 100.0\n",
|
||
"2 0 well2 0.0\n",
|
||
"3 1 well2 1000.0"
|
||
]
|
||
},
|
||
"execution_count": 5,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"stress_period_data = pd.DataFrame([[0, 'well1', 0],\n",
|
||
" [1, 'well1', 100.0],\n",
|
||
" [0, 'well2', 0],\n",
|
||
" [1, 'well2', 1000.]], columns=['per', 'wellid', 'qdes'])\n",
|
||
"stress_period_data"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 6,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"{0: rec.array([(0, 0, 'well1', 0.), (2, 0, 'well2', 0.)],\n",
|
||
" dtype=[('index', '<i8'), ('per', '<i8'), ('wellid', 'O'), ('qdes', '<f8')]),\n",
|
||
" 1: rec.array([(1, 1, 'well1', 100.), (3, 1, 'well2', 1000.)],\n",
|
||
" dtype=[('index', '<i8'), ('per', '<i8'), ('wellid', 'O'), ('qdes', '<f8')])}"
|
||
]
|
||
},
|
||
"execution_count": 6,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"pers = stress_period_data.groupby('per')\n",
|
||
"stress_period_data = {i: pers.get_group(i).to_records() for i in [0, 1]}\n",
|
||
"stress_period_data"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"### Make ``ModflowMnw2`` package object\n",
|
||
"* note that extraneous columns in node_data and stress_period_data are ignored\n",
|
||
"* if itmp is positive, it must equal the number of active wells being specified in ``stress_period_data``, otherwise the package class will raise an error."
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 7,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"mnw2 = flopy.modflow.ModflowMnw2(model=m, mnwmax=2,\n",
|
||
" node_data=node_data, \n",
|
||
" stress_period_data=stress_period_data, \n",
|
||
" itmp=[2, 2, -1], # reuse second per pumping for last stress period\n",
|
||
" )"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 8,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"3"
|
||
]
|
||
},
|
||
"execution_count": 8,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"# \"nodtot\" is computed automatically\n",
|
||
"mnw2.nodtot"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 9,
|
||
"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>k</th>\n",
|
||
" <th>i</th>\n",
|
||
" <th>j</th>\n",
|
||
" <th>ztop</th>\n",
|
||
" <th>zbotm</th>\n",
|
||
" <th>wellid</th>\n",
|
||
" <th>losstype</th>\n",
|
||
" <th>pumploc</th>\n",
|
||
" <th>qlimit</th>\n",
|
||
" <th>ppflag</th>\n",
|
||
" <th>...</th>\n",
|
||
" <th>hlim</th>\n",
|
||
" <th>qcut</th>\n",
|
||
" <th>qfrcmn</th>\n",
|
||
" <th>qfrcmx</th>\n",
|
||
" <th>hlift</th>\n",
|
||
" <th>liftq0</th>\n",
|
||
" <th>liftqmax</th>\n",
|
||
" <th>hwtol</th>\n",
|
||
" <th>liftn</th>\n",
|
||
" <th>qn</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>9.5</td>\n",
|
||
" <td>7.1</td>\n",
|
||
" <td>well1</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>7.1</td>\n",
|
||
" <td>5.1</td>\n",
|
||
" <td>well1</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>9.1</td>\n",
|
||
" <td>3.7</td>\n",
|
||
" <td>well2</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"<p>3 rows × 33 columns</p>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" k i j ztop zbotm wellid losstype pumploc qlimit ppflag ... hlim \\\n",
|
||
"0 0 1 1 9.5 7.1 well1 skin -1 0 0 ... 0.0 \n",
|
||
"1 0 1 1 7.1 5.1 well1 skin -1 0 0 ... 0.0 \n",
|
||
"2 0 3 3 9.1 3.7 well2 skin -1 0 0 ... 0.0 \n",
|
||
"\n",
|
||
" qcut qfrcmn qfrcmx hlift liftq0 liftqmax hwtol liftn qn \n",
|
||
"0 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n",
|
||
"1 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n",
|
||
"2 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n",
|
||
"\n",
|
||
"[3 rows x 33 columns]"
|
||
]
|
||
},
|
||
"execution_count": 9,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"pd.DataFrame(mnw2.node_data)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 10,
|
||
"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>k</th>\n",
|
||
" <th>i</th>\n",
|
||
" <th>j</th>\n",
|
||
" <th>wellid</th>\n",
|
||
" <th>qdes</th>\n",
|
||
" <th>capmult</th>\n",
|
||
" <th>cprime</th>\n",
|
||
" <th>hlim</th>\n",
|
||
" <th>qcut</th>\n",
|
||
" <th>qfrcmn</th>\n",
|
||
" <th>qfrcmx</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>well1</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>well2</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" k i j wellid qdes capmult cprime hlim qcut qfrcmn qfrcmx\n",
|
||
"0 0 1 1 well1 0.0 0 0.0 0.0 0 0.0 0.0\n",
|
||
"1 0 3 3 well2 0.0 0 0.0 0.0 0 0.0 0.0"
|
||
]
|
||
},
|
||
"execution_count": 10,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"pd.DataFrame(mnw2.stress_period_data[0])"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 11,
|
||
"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>k</th>\n",
|
||
" <th>i</th>\n",
|
||
" <th>j</th>\n",
|
||
" <th>wellid</th>\n",
|
||
" <th>qdes</th>\n",
|
||
" <th>capmult</th>\n",
|
||
" <th>cprime</th>\n",
|
||
" <th>hlim</th>\n",
|
||
" <th>qcut</th>\n",
|
||
" <th>qfrcmn</th>\n",
|
||
" <th>qfrcmx</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>well1</td>\n",
|
||
" <td>100.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>well2</td>\n",
|
||
" <td>1000.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" k i j wellid qdes capmult cprime hlim qcut qfrcmn qfrcmx\n",
|
||
"0 0 1 1 well1 100.0 0 0.0 0.0 0 0.0 0.0\n",
|
||
"1 0 3 3 well2 1000.0 0 0.0 0.0 0 0.0 0.0"
|
||
]
|
||
},
|
||
"execution_count": 11,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"pd.DataFrame(mnw2.stress_period_data[1])"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 12,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"tmp = flopy.modflow.ModflowMnw2(model=m,\n",
|
||
" itmp=[1, 1, -1], # reuse second per pumping for last stress period\n",
|
||
" )"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"### empty ``node_data`` and ``stress_period_data`` tables can also be generated by the package class, and then filled"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 13,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"rec.array([(0, 0, 0, 0., 0., 0, 0, 0, 0, 0, 0, 0., 0., 0., 0., 0., 0., 0., 0., 0, 0, 0, 0., 0., 0, 0., 0., 0., 0., 0., 0., 0., 0.),\n",
|
||
" (0, 0, 0, 0., 0., 0, 0, 0, 0, 0, 0, 0., 0., 0., 0., 0., 0., 0., 0., 0, 0, 0, 0., 0., 0, 0., 0., 0., 0., 0., 0., 0., 0.),\n",
|
||
" (0, 0, 0, 0., 0., 0, 0, 0, 0, 0, 0, 0., 0., 0., 0., 0., 0., 0., 0., 0, 0, 0, 0., 0., 0, 0., 0., 0., 0., 0., 0., 0., 0.)],\n",
|
||
" dtype=[('k', '<i8'), ('i', '<i8'), ('j', '<i8'), ('ztop', '<f4'), ('zbotm', '<f4'), ('wellid', 'O'), ('losstype', 'O'), ('pumploc', '<i8'), ('qlimit', '<i8'), ('ppflag', '<i8'), ('pumpcap', '<i8'), ('rw', '<f4'), ('rskin', '<f4'), ('kskin', '<f4'), ('B', '<f4'), ('C', '<f4'), ('P', '<f4'), ('cwc', '<f4'), ('pp', '<f4'), ('pumplay', '<i8'), ('pumprow', '<i8'), ('pumpcol', '<i8'), ('zpump', '<f4'), ('hlim', '<f4'), ('qcut', '<i8'), ('qfrcmn', '<f4'), ('qfrcmx', '<f4'), ('hlift', '<f4'), ('liftq0', '<f4'), ('liftqmax', '<f4'), ('hwtol', '<f4'), ('liftn', '<f4'), ('qn', '<f4')])"
|
||
]
|
||
},
|
||
"execution_count": 13,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"node_data = tmp.get_empty_node_data(3)\n",
|
||
"node_data"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"### Mnw objects\n",
|
||
"at the base of the flopy mnw2 module is the **Mnw** object class, which describes a single multi-node well.\n",
|
||
"A list or dict of **Mnw** objects can be used to build a package (using the example above):\n",
|
||
"```\n",
|
||
"flopy.modflow.ModflowMnw2(model=m, mnwmax=2,\n",
|
||
" mnw=<dict or list of Mnw objects>,\n",
|
||
" itmp=[1, 1, -1], # reuse second per pumping for last stress period\n",
|
||
" )\n",
|
||
"```\n",
|
||
"or if node_data and stress_period_data are supplied, the **Mnw** objects are created on initialization of the ModflowMnw2 class instance, and assigned to the ```.mnw``` attribute, as items in a dictionary keyed by ```wellid```."
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 14,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"{'well1': <flopy.modflow.mfmnw2.Mnw at 0x11a9af8e0>,\n",
|
||
" 'well2': <flopy.modflow.mfmnw2.Mnw at 0x11a9af940>}"
|
||
]
|
||
},
|
||
"execution_count": 14,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"mnw2.mnw"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 15,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"{'nper': 3,\n",
|
||
" 'mnwpackage': \n",
|
||
" Multi-Node Well 2 Package Class\n",
|
||
" \n",
|
||
" Parameters\n",
|
||
" ----------\n",
|
||
" model : model object\n",
|
||
" The model object (of type :class:'flopy.modflow.mf.Modflow') to which\n",
|
||
" this package will be added.\n",
|
||
" mnwmax : int\n",
|
||
" The absolute value of MNWMAX is the maximum number of multi-node wells\n",
|
||
" (MNW) to be simulated. If MNWMAX is a negative number, NODTOT is read.\n",
|
||
" nodtot : int\n",
|
||
" Maximum number of nodes.\n",
|
||
" The code automatically estimates the maximum number of nodes (NODTOT)\n",
|
||
" as required for allocation of arrays. However, if a large number of\n",
|
||
" horizontal wells are being simulated, or possibly for other reasons,\n",
|
||
" this default estimate proves to be inadequate, a new input option has\n",
|
||
" been added to allow the user to directly specify a value for NODTOT.\n",
|
||
" If this is a desired option, then it can be implemented by specifying\n",
|
||
" a negative value for \"MNWMAX\"--the first value listed in Record 1\n",
|
||
" (Line 1) of the MNW2 input data file. If this is done, then the code\n",
|
||
" will assume that the very next value on that line will be the desired\n",
|
||
" value of \"NODTOT\". The model will then reset \"MNWMAX\" to its absolute\n",
|
||
" value. The value of \"ipakcb\" will become the third value on that\n",
|
||
" line, etc.\n",
|
||
" ipakcb : int\n",
|
||
" is a flag and a unit number:\n",
|
||
" if ipakcb > 0, then it is the unit number to which MNW cell-by-cell\n",
|
||
" flow terms will be recorded whenever cell-by-cell budget data are\n",
|
||
" written to a file (as determined by the outputcontrol options of\n",
|
||
" MODFLOW).\n",
|
||
" if ipakcb = 0, then MNW cell-by-cell flow terms will not be printed\n",
|
||
" or recorded.\n",
|
||
" if ipakcb < 0, then well injection or withdrawal rates and water\n",
|
||
" levels in the well and its multiple cells will be printed in\n",
|
||
" the main MODFLOW listing (output) file whenever cell-by-cell\n",
|
||
" budget data are written to a file (as determined by the output\n",
|
||
" control options of MODFLOW).\n",
|
||
" mnwprnt : integer\n",
|
||
" Flag controlling the level of detail of information about multi-node\n",
|
||
" wells to be written to the main MODFLOW listing (output) file.\n",
|
||
" If MNWPRNT = 0, then only basic well information will be printed in\n",
|
||
" the main MODFLOW output file; increasing the value of MNWPRNT yields\n",
|
||
" more information, up to a maximum level of detail corresponding\n",
|
||
" with MNWPRNT = 2. (default is 0)\n",
|
||
" aux : list of strings\n",
|
||
" (listed as \"OPTION\" in MNW2 input instructions)\n",
|
||
" is an optional list of character values in the style of \"AUXILIARY abc\"\n",
|
||
" or \"AUX abc\" where \"abc\" is the name of an auxiliary parameter to be\n",
|
||
" read for each multi-node well as part of dataset 4a. Up to 20\n",
|
||
" parameters can be specified, each of which must be preceded by\n",
|
||
" \"AUXILIARY\" or \"AUX.\" These parameters will not be used by the MNW2\n",
|
||
" Package, but they will be available for use by other packages.\n",
|
||
" (default is None)\n",
|
||
" node_data : numpy record array\n",
|
||
" master table describing multi-node wells in package. Same format as\n",
|
||
" node_data tables for each Mnw object. See Mnw class documentation for\n",
|
||
" more information.\n",
|
||
" mnw : list or dict of Mnw objects\n",
|
||
" Can be supplied instead of node_data and stress_period_data tables\n",
|
||
" (in which case the tables are constructed from the Mnw objects).\n",
|
||
" Otherwise the a dict of Mnw objects (keyed by wellid) is constructed\n",
|
||
" from the tables.\n",
|
||
" stress_period_data : dict of numpy record arrays\n",
|
||
" master dictionary of record arrays (keyed by stress period) containing\n",
|
||
" transient input for multi-node wells. Format is the same as stress\n",
|
||
" period data for individual Mnw objects, except the 'per' column is\n",
|
||
" replaced by 'wellid' (containing wellid for each MNW). See Mnw class\n",
|
||
" documentation for more information.\n",
|
||
" itmp : list of ints\n",
|
||
" is an integer value for reusing or reading multi-node well data; it\n",
|
||
" can change each stress period. ITMP must be >= 0 for the first stress\n",
|
||
" period of a simulation.\n",
|
||
" if ITMP > 0, then ITMP is the total number of active multi-node wells\n",
|
||
" simulated during the stress period, and only wells listed in\n",
|
||
" dataset 4a will be active during the stress period. Characteristics\n",
|
||
" of each well are defined in datasets 2 and 4.\n",
|
||
" if ITMP = 0, then no multi-node wells are active for the stress period\n",
|
||
" and the following dataset is skipped.\n",
|
||
" if ITMP < 0, then the same number of wells and well information will\n",
|
||
" be reused from the previous stress period and dataset 4 is skipped.\n",
|
||
" extension : string\n",
|
||
" Filename extension (default is 'mnw2')\n",
|
||
" unitnumber : int\n",
|
||
" File unit number (default is None).\n",
|
||
" filenames : str or list of str\n",
|
||
" Filenames to use for the package and the output files. If\n",
|
||
" filenames=None the package name will be created using the model name\n",
|
||
" and package extension and the cbc output name will be created using\n",
|
||
" the model name and .cbc extension (for example, modflowtest.cbc),\n",
|
||
" if ipakcbc is a number greater than zero. If a single string is passed\n",
|
||
" the package will be set to the string and cbc output names will be\n",
|
||
" created using the model name and .cbc extension, if ipakcbc is a\n",
|
||
" number greater than zero. To define the names for all package files\n",
|
||
" (input and output) the length of the list of strings should be 2.\n",
|
||
" Default is None.\n",
|
||
" gwt : boolean\n",
|
||
" Flag indicating whether GW transport process is active\n",
|
||
" \n",
|
||
" Attributes\n",
|
||
" ----------\n",
|
||
" \n",
|
||
" Methods\n",
|
||
" -------\n",
|
||
" \n",
|
||
" See Also\n",
|
||
" --------\n",
|
||
" \n",
|
||
" Notes\n",
|
||
" -----\n",
|
||
" \n",
|
||
" Examples\n",
|
||
" --------\n",
|
||
" \n",
|
||
" >>> import flopy\n",
|
||
" >>> ml = flopy.modflow.Modflow()\n",
|
||
" >>> mnw2 = flopy.modflow.ModflowMnw2(ml, ...)\n",
|
||
" \n",
|
||
" _name = MNW2\n",
|
||
" _parent = MODFLOW 3 layer(s) 5 row(s) 5 column(s) 3 stress period(s) ('flopy.modflow.mf.Modflow)\n",
|
||
" acceptable_dtypes (list, items = 3)\n",
|
||
" allowDuplicates = False ('bool)\n",
|
||
" aux (list, items = 0)\n",
|
||
" extra = \n",
|
||
" file_name = mnw2example.mnw2\n",
|
||
" fn_path = data/mnw2example.mnw2 ('str)\n",
|
||
" gwt = False ('bool)\n",
|
||
" ipakcb = 0 ('int)\n",
|
||
" itmp (list, items = 3)\n",
|
||
" mnw = {'well1': <flopy.modflow.mfmnw2.Mnw object at 0x11a9af8e0>, 'well2': <flopy.modflow.mfmnw2.Mnw object at 0x11a9af940>} ('dict)\n",
|
||
" mnwmax = 2 ('int)\n",
|
||
" mnwprnt = 0 ('int)\n",
|
||
" node_data (array, shape = 3,)\n",
|
||
" nodtot = 3 ('int)\n",
|
||
" nper = 3 ('int)\n",
|
||
" stress_period_data = <flopy.utils.util_list.MfList object at 0x11a9af910> ('flopy.utils.util_list.MfList)\n",
|
||
" structured = True ('bool)\n",
|
||
" unit_number = 34,\n",
|
||
" 'aux': [],\n",
|
||
" 'wellid': 'well1',\n",
|
||
" 'nnodes': -2,\n",
|
||
" 'losstype': 'skin',\n",
|
||
" 'pumploc': -1,\n",
|
||
" 'qlimit': 0,\n",
|
||
" 'ppflag': 0,\n",
|
||
" 'pumpcap': 0,\n",
|
||
" 'rw': [1.0, 0.5],\n",
|
||
" 'rskin': [2.0, 2.0],\n",
|
||
" 'kskin': [5.0, 5.0],\n",
|
||
" 'B': [None],\n",
|
||
" 'C': [0],\n",
|
||
" 'P': [2.0],\n",
|
||
" 'cwc': [None],\n",
|
||
" 'pp': [1],\n",
|
||
" 'k': [0],\n",
|
||
" 'i': [1, 1],\n",
|
||
" 'j': [1, 1],\n",
|
||
" 'ztop': [9.5, 7.1],\n",
|
||
" 'zbotm': [7.1, 5.1],\n",
|
||
" 'pumplay': 0,\n",
|
||
" 'pumprow': 0,\n",
|
||
" 'pumpcol': 0,\n",
|
||
" 'zpump': 6.2,\n",
|
||
" 'hlim': None,\n",
|
||
" 'qcut': None,\n",
|
||
" 'qfrcmn': None,\n",
|
||
" 'qfrcmx': None,\n",
|
||
" 'hlift': None,\n",
|
||
" 'liftq0': None,\n",
|
||
" 'liftqmax': None,\n",
|
||
" 'hwtol': None,\n",
|
||
" 'liftn': None,\n",
|
||
" 'qn': None,\n",
|
||
" 'stress_period_data': rec.array([(0, 1, 1, 0, 0., 0, 0., 0., 0, 0., 0.),\n",
|
||
" (0, 1, 1, 1, 100., 0, 0., 0., 0, 0., 0.),\n",
|
||
" (0, 1, 1, 1, 100., 0, 0., 0., 0, 0., 0.)],\n",
|
||
" dtype=[('k', '<i8'), ('i', '<i8'), ('j', '<i8'), ('per', '<i8'), ('qdes', '<f4'), ('capmult', '<i8'), ('cprime', '<f4'), ('hlim', '<f4'), ('qcut', '<i8'), ('qfrcmn', '<f4'), ('qfrcmx', '<f4')]),\n",
|
||
" 'node_data': rec.array([(0, 1, 1, 9.5, 7.1, 'well1', 'skin', -1, 0, 0, 0, 1. , 2., 5., 0., 0., 0., 0., 0., 0, 0, 0, 6.2, 0., 0, 0., 0., 0., 0., 0., 0., 0., 0.),\n",
|
||
" (0, 1, 1, 7.1, 5.1, 'well1', 'skin', -1, 0, 0, 0, 0.5, 2., 5., 0., 0., 0., 0., 0., 0, 0, 0, 6.2, 0., 0, 0., 0., 0., 0., 0., 0., 0., 0.)],\n",
|
||
" dtype=[('k', '<i8'), ('i', '<i8'), ('j', '<i8'), ('ztop', '<f4'), ('zbotm', '<f4'), ('wellid', 'O'), ('losstype', 'O'), ('pumploc', '<i8'), ('qlimit', '<i8'), ('ppflag', '<i8'), ('pumpcap', '<i8'), ('rw', '<f4'), ('rskin', '<f4'), ('kskin', '<f4'), ('B', '<f4'), ('C', '<f4'), ('P', '<f4'), ('cwc', '<f4'), ('pp', '<f4'), ('pumplay', '<i8'), ('pumprow', '<i8'), ('pumpcol', '<i8'), ('zpump', '<f4'), ('hlim', '<f4'), ('qcut', '<i8'), ('qfrcmn', '<f4'), ('qfrcmx', '<f4'), ('hlift', '<f4'), ('liftq0', '<f4'), ('liftqmax', '<f4'), ('hwtol', '<f4'), ('liftn', '<f4'), ('qn', '<f4')])}"
|
||
]
|
||
},
|
||
"execution_count": 15,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"mnw2.mnw['well1'].__dict__"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"Note that Mnw object attributes for variables that vary by node are lists (e.g. ``rw`` above)\n",
|
||
"\n",
|
||
"#### Each Mnw object has its own ``node_data`` and ``stress_period_data``"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 16,
|
||
"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>k</th>\n",
|
||
" <th>i</th>\n",
|
||
" <th>j</th>\n",
|
||
" <th>ztop</th>\n",
|
||
" <th>zbotm</th>\n",
|
||
" <th>wellid</th>\n",
|
||
" <th>losstype</th>\n",
|
||
" <th>pumploc</th>\n",
|
||
" <th>qlimit</th>\n",
|
||
" <th>ppflag</th>\n",
|
||
" <th>...</th>\n",
|
||
" <th>hlim</th>\n",
|
||
" <th>qcut</th>\n",
|
||
" <th>qfrcmn</th>\n",
|
||
" <th>qfrcmx</th>\n",
|
||
" <th>hlift</th>\n",
|
||
" <th>liftq0</th>\n",
|
||
" <th>liftqmax</th>\n",
|
||
" <th>hwtol</th>\n",
|
||
" <th>liftn</th>\n",
|
||
" <th>qn</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>9.5</td>\n",
|
||
" <td>7.1</td>\n",
|
||
" <td>well1</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>7.1</td>\n",
|
||
" <td>5.1</td>\n",
|
||
" <td>well1</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"<p>2 rows × 33 columns</p>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" k i j ztop zbotm wellid losstype pumploc qlimit ppflag ... hlim \\\n",
|
||
"0 0 1 1 9.5 7.1 well1 skin -1 0 0 ... 0.0 \n",
|
||
"1 0 1 1 7.1 5.1 well1 skin -1 0 0 ... 0.0 \n",
|
||
"\n",
|
||
" qcut qfrcmn qfrcmx hlift liftq0 liftqmax hwtol liftn qn \n",
|
||
"0 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n",
|
||
"1 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n",
|
||
"\n",
|
||
"[2 rows x 33 columns]"
|
||
]
|
||
},
|
||
"execution_count": 16,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"pd.DataFrame(mnw2.mnw['well1'].node_data)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"#### Instead of a dict keyed by stress period, Mnw.stress_period_data is a recarray with pumping data listed by stress period for that well\n",
|
||
"* note that data for period 2, where ``itmp`` < 1, is shown (was copied from s.p. 1 during construction of the **Mnw** object)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 17,
|
||
"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>k</th>\n",
|
||
" <th>i</th>\n",
|
||
" <th>j</th>\n",
|
||
" <th>per</th>\n",
|
||
" <th>qdes</th>\n",
|
||
" <th>capmult</th>\n",
|
||
" <th>cprime</th>\n",
|
||
" <th>hlim</th>\n",
|
||
" <th>qcut</th>\n",
|
||
" <th>qfrcmn</th>\n",
|
||
" <th>qfrcmx</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>1000.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>1000.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" k i j per qdes capmult cprime hlim qcut qfrcmn qfrcmx\n",
|
||
"0 0 3 3 0 0.0 0 0.0 0.0 0 0.0 0.0\n",
|
||
"1 0 3 3 1 1000.0 0 0.0 0.0 0 0.0 0.0\n",
|
||
"2 0 3 3 1 1000.0 0 0.0 0.0 0 0.0 0.0"
|
||
]
|
||
},
|
||
"execution_count": 17,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"pd.DataFrame(mnw2.mnw['well2'].stress_period_data)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"### Build the same package using only the ``Mnw`` objects"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 18,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"mnw2fromobj = flopy.modflow.ModflowMnw2(model=m, mnwmax=2,\n",
|
||
" mnw=mnw2.mnw,\n",
|
||
" itmp=[2, 2, -1], # reuse second per pumping for last stress period\n",
|
||
" )"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 19,
|
||
"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>k</th>\n",
|
||
" <th>i</th>\n",
|
||
" <th>j</th>\n",
|
||
" <th>ztop</th>\n",
|
||
" <th>zbotm</th>\n",
|
||
" <th>wellid</th>\n",
|
||
" <th>losstype</th>\n",
|
||
" <th>pumploc</th>\n",
|
||
" <th>qlimit</th>\n",
|
||
" <th>ppflag</th>\n",
|
||
" <th>...</th>\n",
|
||
" <th>hlim</th>\n",
|
||
" <th>qcut</th>\n",
|
||
" <th>qfrcmn</th>\n",
|
||
" <th>qfrcmx</th>\n",
|
||
" <th>hlift</th>\n",
|
||
" <th>liftq0</th>\n",
|
||
" <th>liftqmax</th>\n",
|
||
" <th>hwtol</th>\n",
|
||
" <th>liftn</th>\n",
|
||
" <th>qn</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>9.5</td>\n",
|
||
" <td>7.1</td>\n",
|
||
" <td>well1</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>7.1</td>\n",
|
||
" <td>5.1</td>\n",
|
||
" <td>well1</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>9.1</td>\n",
|
||
" <td>3.7</td>\n",
|
||
" <td>well2</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"<p>3 rows × 33 columns</p>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" k i j ztop zbotm wellid losstype pumploc qlimit ppflag ... hlim \\\n",
|
||
"0 0 1 1 9.5 7.1 well1 skin -1 0 0 ... 0.0 \n",
|
||
"1 0 1 1 7.1 5.1 well1 skin -1 0 0 ... 0.0 \n",
|
||
"2 0 3 3 9.1 3.7 well2 skin -1 0 0 ... 0.0 \n",
|
||
"\n",
|
||
" qcut qfrcmn qfrcmx hlift liftq0 liftqmax hwtol liftn qn \n",
|
||
"0 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n",
|
||
"1 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n",
|
||
"2 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 \n",
|
||
"\n",
|
||
"[3 rows x 33 columns]"
|
||
]
|
||
},
|
||
"execution_count": 19,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"pd.DataFrame(mnw2fromobj.node_data)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 20,
|
||
"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>k</th>\n",
|
||
" <th>i</th>\n",
|
||
" <th>j</th>\n",
|
||
" <th>wellid</th>\n",
|
||
" <th>qdes</th>\n",
|
||
" <th>capmult</th>\n",
|
||
" <th>cprime</th>\n",
|
||
" <th>hlim</th>\n",
|
||
" <th>qcut</th>\n",
|
||
" <th>qfrcmn</th>\n",
|
||
" <th>qfrcmx</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>well1</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>well2</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" k i j wellid qdes capmult cprime hlim qcut qfrcmn qfrcmx\n",
|
||
"0 0 1 1 well1 0.0 0 0.0 0.0 0 0.0 0.0\n",
|
||
"1 0 3 3 well2 0.0 0 0.0 0.0 0 0.0 0.0"
|
||
]
|
||
},
|
||
"execution_count": 20,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"pd.DataFrame(mnw2fromobj.stress_period_data[0])"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 21,
|
||
"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>k</th>\n",
|
||
" <th>i</th>\n",
|
||
" <th>j</th>\n",
|
||
" <th>wellid</th>\n",
|
||
" <th>qdes</th>\n",
|
||
" <th>capmult</th>\n",
|
||
" <th>cprime</th>\n",
|
||
" <th>hlim</th>\n",
|
||
" <th>qcut</th>\n",
|
||
" <th>qfrcmn</th>\n",
|
||
" <th>qfrcmx</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>well1</td>\n",
|
||
" <td>100.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>3</td>\n",
|
||
" <td>well2</td>\n",
|
||
" <td>1000.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" k i j wellid qdes capmult cprime hlim qcut qfrcmn qfrcmx\n",
|
||
"0 0 1 1 well1 100.0 0 0.0 0.0 0 0.0 0.0\n",
|
||
"1 0 3 3 well2 1000.0 0 0.0 0.0 0 0.0 0.0"
|
||
]
|
||
},
|
||
"execution_count": 21,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"pd.DataFrame(mnw2fromobj.stress_period_data[1])"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"### By default, the ``node_data`` and ``stress_period_data`` tables attached to the ``ModflowMnw2`` package class are definitive\n",
|
||
"* on writing of the package output (``mnw2.write_file()``), the **Mnw** objects are regenerated from the tables. This setting is controlled by the default argument ``use_tables=True``. To write the package file using the **Mnw** objects (ignoring the tables), use ``mnw2.write_file(use_tables=False)``. "
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 22,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"rec.array([(0, 0, 0, 0, 0., 0, 0., 0., 0, 0., 0.),\n",
|
||
" (0, 0, 0, 0, 0., 0, 0., 0., 0, 0., 0.)],\n",
|
||
" dtype=[('k', '<i8'), ('i', '<i8'), ('j', '<i8'), ('wellid', 'O'), ('qdes', '<f4'), ('capmult', '<i8'), ('cprime', '<f4'), ('hlim', '<f4'), ('qcut', '<i8'), ('qfrcmn', '<f4'), ('qfrcmx', '<f4')])"
|
||
]
|
||
},
|
||
"execution_count": 22,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"per1 = flopy.modflow.ModflowMnw2.get_empty_stress_period_data(itmp=2)\n",
|
||
"per1"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"### Write an MNW2 package file and inspect the results"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 23,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"mnw2.write_file(os.path.join('data/test.mnw2'))"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 24,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"# MNW2 package for MODFLOW-2005, generated by Flopy.\n",
|
||
"2 0 0\n",
|
||
"well1 -2\n",
|
||
" skin -1 0 0 0\n",
|
||
" -1.0000000E+00 2.0000000E+00 5.0000000E+00\n",
|
||
" 9.5000000E+00 7.0999999E+00 2 2 1.0000000E+00\n",
|
||
" 7.0999999E+00 5.0999999E+00 2 2 5.0000000E-01\n",
|
||
" 6.1999998E+00\n",
|
||
"well2 -1\n",
|
||
" skin -1 0 0 0\n",
|
||
" 1.0000000E+00 2.0000000E+00 5.0000000E+00\n",
|
||
" 9.1000004E+00 3.7000000E+00 4 4\n",
|
||
" 4.0999999E+00\n",
|
||
"2 Stress Period 1\n",
|
||
"well1 0.0000000E+00\n",
|
||
"well2 0.0000000E+00\n",
|
||
"2 Stress Period 2\n",
|
||
"well1 1.0000000E+02\n",
|
||
"well2 1.0000000E+03\n",
|
||
"-1 Stress Period 3\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"junk = [print(l.strip('\\n')) for l in open('data/test.mnw2').readlines()]"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"### Load some example MNW2 packages"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 25,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"path = os.path.join('..', '..', 'examples', 'data', 'mnw2_examples')\n",
|
||
"cpth = os.path.join('..', '..', 'autotest', 'data')\n",
|
||
"m = flopy.modflow.Modflow('MNW2-Fig28', model_ws=cpth)\n",
|
||
"dis = flopy.modflow.ModflowDis.load(os.path.join(path, 'MNW2-Fig28.dis'), m)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 26,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"['DIS']"
|
||
]
|
||
},
|
||
"execution_count": 26,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"m.get_package_list()"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 27,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"mnw2pth = os.path.join(path, 'MNW2-Fig28.mnw2')\n",
|
||
"mnw2 = flopy.modflow.ModflowMnw2.load(mnw2pth, m)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 28,
|
||
"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>k</th>\n",
|
||
" <th>i</th>\n",
|
||
" <th>j</th>\n",
|
||
" <th>ztop</th>\n",
|
||
" <th>zbotm</th>\n",
|
||
" <th>wellid</th>\n",
|
||
" <th>losstype</th>\n",
|
||
" <th>pumploc</th>\n",
|
||
" <th>qlimit</th>\n",
|
||
" <th>ppflag</th>\n",
|
||
" <th>...</th>\n",
|
||
" <th>hlim</th>\n",
|
||
" <th>qcut</th>\n",
|
||
" <th>qfrcmn</th>\n",
|
||
" <th>qfrcmx</th>\n",
|
||
" <th>hlift</th>\n",
|
||
" <th>liftq0</th>\n",
|
||
" <th>liftqmax</th>\n",
|
||
" <th>hwtol</th>\n",
|
||
" <th>liftn</th>\n",
|
||
" <th>qn</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>29</td>\n",
|
||
" <td>40</td>\n",
|
||
" <td>-5.0</td>\n",
|
||
" <td>-65.0</td>\n",
|
||
" <td>well-a</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>-7.5</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>0.1</td>\n",
|
||
" <td>0.15</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"<p>1 rows × 33 columns</p>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" k i j ztop zbotm wellid losstype pumploc qlimit ppflag ... \\\n",
|
||
"0 0 29 40 -5.0 -65.0 well-a skin 0 1 0 ... \n",
|
||
"\n",
|
||
" hlim qcut qfrcmn qfrcmx hlift liftq0 liftqmax hwtol liftn qn \n",
|
||
"0 -7.5 -1 0.1 0.15 0.0 0.0 0.0 0.0 0.0 0.0 \n",
|
||
"\n",
|
||
"[1 rows x 33 columns]"
|
||
]
|
||
},
|
||
"execution_count": 28,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"pd.DataFrame(mnw2.node_data)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 29,
|
||
"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>k</th>\n",
|
||
" <th>i</th>\n",
|
||
" <th>j</th>\n",
|
||
" <th>wellid</th>\n",
|
||
" <th>qdes</th>\n",
|
||
" <th>capmult</th>\n",
|
||
" <th>cprime</th>\n",
|
||
" <th>hlim</th>\n",
|
||
" <th>qcut</th>\n",
|
||
" <th>qfrcmn</th>\n",
|
||
" <th>qfrcmx</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>29</td>\n",
|
||
" <td>40</td>\n",
|
||
" <td>well-a</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" k i j wellid qdes capmult cprime hlim qcut qfrcmn qfrcmx\n",
|
||
"0 0 29 40 well-a 0.0 0 0.0 0.0 0 0.0 0.0"
|
||
]
|
||
},
|
||
"execution_count": 29,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"pd.DataFrame(mnw2.stress_period_data[0])"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 30,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"{'well-a': <flopy.modflow.mfmnw2.Mnw at 0x11a92b910>}"
|
||
]
|
||
},
|
||
"execution_count": 30,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"mnw2.mnw"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 31,
|
||
"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>k</th>\n",
|
||
" <th>i</th>\n",
|
||
" <th>j</th>\n",
|
||
" <th>per</th>\n",
|
||
" <th>qdes</th>\n",
|
||
" <th>capmult</th>\n",
|
||
" <th>cprime</th>\n",
|
||
" <th>hlim</th>\n",
|
||
" <th>qcut</th>\n",
|
||
" <th>qfrcmn</th>\n",
|
||
" <th>qfrcmx</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>29</td>\n",
|
||
" <td>40</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>29</td>\n",
|
||
" <td>40</td>\n",
|
||
" <td>1</td>\n",
|
||
" <td>-10000.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>0</td>\n",
|
||
" <td>29</td>\n",
|
||
" <td>40</td>\n",
|
||
" <td>2</td>\n",
|
||
" <td>-10000.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" <td>0.0</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" k i j per qdes capmult cprime hlim qcut qfrcmn qfrcmx\n",
|
||
"0 0 29 40 0 0.0 0 0.0 0.0 0 0.0 0.0\n",
|
||
"1 0 29 40 1 -10000.0 0 0.0 0.0 0 0.0 0.0\n",
|
||
"2 0 29 40 2 -10000.0 0 0.0 0.0 0 0.0 0.0"
|
||
]
|
||
},
|
||
"execution_count": 31,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"pd.DataFrame(mnw2.mnw['well-a'].stress_period_data)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 32,
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"path = os.path.join('..', '..', 'examples', 'data', 'mnw2_examples')\n",
|
||
"cpth = os.path.join('data')\n",
|
||
"m = flopy.modflow.Modflow('br', model_ws=cpth)\n",
|
||
"mnw2 = flopy.modflow.ModflowMnw2.load(path + '/BadRiver_cal.mnw2', m)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 33,
|
||
"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>i</th>\n",
|
||
" <th>j</th>\n",
|
||
" <th>ztop</th>\n",
|
||
" <th>zbotm</th>\n",
|
||
" <th>wellid</th>\n",
|
||
" <th>losstype</th>\n",
|
||
" <th>pumploc</th>\n",
|
||
" <th>rw</th>\n",
|
||
" <th>rskin</th>\n",
|
||
" <th>kskin</th>\n",
|
||
" <th>zpump</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>294</td>\n",
|
||
" <td>503</td>\n",
|
||
" <td>181.630005</td>\n",
|
||
" <td>161.630005</td>\n",
|
||
" <td>br_birch1</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>162.630005</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>295</td>\n",
|
||
" <td>503</td>\n",
|
||
" <td>179.119995</td>\n",
|
||
" <td>159.119995</td>\n",
|
||
" <td>br_birch2</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>160.119995</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>175</td>\n",
|
||
" <td>342</td>\n",
|
||
" <td>400.220001</td>\n",
|
||
" <td>312.220001</td>\n",
|
||
" <td>br_diaperville1</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>313.220001</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>174</td>\n",
|
||
" <td>342</td>\n",
|
||
" <td>399.119995</td>\n",
|
||
" <td>312.119995</td>\n",
|
||
" <td>br_diaperville2</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>313.119995</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>4</th>\n",
|
||
" <td>248</td>\n",
|
||
" <td>454</td>\n",
|
||
" <td>565.200012</td>\n",
|
||
" <td>555.200012</td>\n",
|
||
" <td>br_franks1</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>556.200012</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>5</th>\n",
|
||
" <td>249</td>\n",
|
||
" <td>453</td>\n",
|
||
" <td>564.419983</td>\n",
|
||
" <td>554.419983</td>\n",
|
||
" <td>br_franks2</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>555.419983</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>6</th>\n",
|
||
" <td>180</td>\n",
|
||
" <td>396</td>\n",
|
||
" <td>453.959991</td>\n",
|
||
" <td>447.959991</td>\n",
|
||
" <td>br_odanah1</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>448.959991</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>7</th>\n",
|
||
" <td>181</td>\n",
|
||
" <td>395</td>\n",
|
||
" <td>450.559998</td>\n",
|
||
" <td>444.559998</td>\n",
|
||
" <td>br_odanah2</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>445.559998</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>8</th>\n",
|
||
" <td>181</td>\n",
|
||
" <td>395</td>\n",
|
||
" <td>380.489990</td>\n",
|
||
" <td>371.489990</td>\n",
|
||
" <td>br_odanah3</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>372.489990</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>9</th>\n",
|
||
" <td>180</td>\n",
|
||
" <td>396</td>\n",
|
||
" <td>450.739990</td>\n",
|
||
" <td>444.739990</td>\n",
|
||
" <td>br_odanah4</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>445.739990</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>10</th>\n",
|
||
" <td>170</td>\n",
|
||
" <td>350</td>\n",
|
||
" <td>475.410004</td>\n",
|
||
" <td>472.410004</td>\n",
|
||
" <td>br_oldschool</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>473.410004</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>11</th>\n",
|
||
" <td>172</td>\n",
|
||
" <td>312</td>\n",
|
||
" <td>377.410004</td>\n",
|
||
" <td>348.410004</td>\n",
|
||
" <td>br_recycle</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>349.410004</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>12</th>\n",
|
||
" <td>216</td>\n",
|
||
" <td>412</td>\n",
|
||
" <td>562.200012</td>\n",
|
||
" <td>542.200012</td>\n",
|
||
" <td>br_unspec</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>543.200012</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>13</th>\n",
|
||
" <td>516</td>\n",
|
||
" <td>424</td>\n",
|
||
" <td>1079.910034</td>\n",
|
||
" <td>1072.910034</td>\n",
|
||
" <td>cfsp_ncp1</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>1073.910034</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>14</th>\n",
|
||
" <td>515</td>\n",
|
||
" <td>424</td>\n",
|
||
" <td>1077.900024</td>\n",
|
||
" <td>1074.900024</td>\n",
|
||
" <td>cfsp_ncp2</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>1075.900024</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>15</th>\n",
|
||
" <td>539</td>\n",
|
||
" <td>415</td>\n",
|
||
" <td>1093.010010</td>\n",
|
||
" <td>1003.010010</td>\n",
|
||
" <td>cfsp_of</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>1004.010010</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>16</th>\n",
|
||
" <td>360</td>\n",
|
||
" <td>2</td>\n",
|
||
" <td>706.330017</td>\n",
|
||
" <td>699.330017</td>\n",
|
||
" <td>hayward_bait_n</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>700.330017</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>17</th>\n",
|
||
" <td>360</td>\n",
|
||
" <td>6</td>\n",
|
||
" <td>705.289978</td>\n",
|
||
" <td>698.289978</td>\n",
|
||
" <td>hayward_bait_ne</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>699.289978</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>18</th>\n",
|
||
" <td>362</td>\n",
|
||
" <td>4</td>\n",
|
||
" <td>696.979980</td>\n",
|
||
" <td>689.979980</td>\n",
|
||
" <td>hayward_bait_of</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>690.979980</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>19</th>\n",
|
||
" <td>456</td>\n",
|
||
" <td>699</td>\n",
|
||
" <td>1352.050049</td>\n",
|
||
" <td>1342.050049</td>\n",
|
||
" <td>ironbelt2</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>1343.050049</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>20</th>\n",
|
||
" <td>456</td>\n",
|
||
" <td>699</td>\n",
|
||
" <td>1350.439941</td>\n",
|
||
" <td>1343.439941</td>\n",
|
||
" <td>ironbelt3</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>1344.439941</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>21</th>\n",
|
||
" <td>599</td>\n",
|
||
" <td>414</td>\n",
|
||
" <td>1198.839966</td>\n",
|
||
" <td>1188.839966</td>\n",
|
||
" <td>mellen2</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>1189.839966</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>22</th>\n",
|
||
" <td>576</td>\n",
|
||
" <td>408</td>\n",
|
||
" <td>1151.599976</td>\n",
|
||
" <td>1131.599976</td>\n",
|
||
" <td>mellen3</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>1132.599976</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>23</th>\n",
|
||
" <td>253</td>\n",
|
||
" <td>149</td>\n",
|
||
" <td>622.179993</td>\n",
|
||
" <td>602.179993</td>\n",
|
||
" <td>milestone</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>603.179993</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>24</th>\n",
|
||
" <td>208</td>\n",
|
||
" <td>148</td>\n",
|
||
" <td>520.119995</td>\n",
|
||
" <td>500.119995</td>\n",
|
||
" <td>nsp</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>501.119995</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>25</th>\n",
|
||
" <td>80</td>\n",
|
||
" <td>162</td>\n",
|
||
" <td>535.299988</td>\n",
|
||
" <td>30.299999</td>\n",
|
||
" <td>washburn1</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>31.299999</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>26</th>\n",
|
||
" <td>91</td>\n",
|
||
" <td>143</td>\n",
|
||
" <td>541.280029</td>\n",
|
||
" <td>-67.720001</td>\n",
|
||
" <td>washburn2</td>\n",
|
||
" <td>skin</td>\n",
|
||
" <td>-1</td>\n",
|
||
" <td>1.0</td>\n",
|
||
" <td>2.0</td>\n",
|
||
" <td>10.0</td>\n",
|
||
" <td>-66.720001</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" i j ztop zbotm wellid losstype pumploc \\\n",
|
||
"0 294 503 181.630005 161.630005 br_birch1 skin -1 \n",
|
||
"1 295 503 179.119995 159.119995 br_birch2 skin -1 \n",
|
||
"2 175 342 400.220001 312.220001 br_diaperville1 skin -1 \n",
|
||
"3 174 342 399.119995 312.119995 br_diaperville2 skin -1 \n",
|
||
"4 248 454 565.200012 555.200012 br_franks1 skin -1 \n",
|
||
"5 249 453 564.419983 554.419983 br_franks2 skin -1 \n",
|
||
"6 180 396 453.959991 447.959991 br_odanah1 skin -1 \n",
|
||
"7 181 395 450.559998 444.559998 br_odanah2 skin -1 \n",
|
||
"8 181 395 380.489990 371.489990 br_odanah3 skin -1 \n",
|
||
"9 180 396 450.739990 444.739990 br_odanah4 skin -1 \n",
|
||
"10 170 350 475.410004 472.410004 br_oldschool skin -1 \n",
|
||
"11 172 312 377.410004 348.410004 br_recycle skin -1 \n",
|
||
"12 216 412 562.200012 542.200012 br_unspec skin -1 \n",
|
||
"13 516 424 1079.910034 1072.910034 cfsp_ncp1 skin -1 \n",
|
||
"14 515 424 1077.900024 1074.900024 cfsp_ncp2 skin -1 \n",
|
||
"15 539 415 1093.010010 1003.010010 cfsp_of skin -1 \n",
|
||
"16 360 2 706.330017 699.330017 hayward_bait_n skin -1 \n",
|
||
"17 360 6 705.289978 698.289978 hayward_bait_ne skin -1 \n",
|
||
"18 362 4 696.979980 689.979980 hayward_bait_of skin -1 \n",
|
||
"19 456 699 1352.050049 1342.050049 ironbelt2 skin -1 \n",
|
||
"20 456 699 1350.439941 1343.439941 ironbelt3 skin -1 \n",
|
||
"21 599 414 1198.839966 1188.839966 mellen2 skin -1 \n",
|
||
"22 576 408 1151.599976 1131.599976 mellen3 skin -1 \n",
|
||
"23 253 149 622.179993 602.179993 milestone skin -1 \n",
|
||
"24 208 148 520.119995 500.119995 nsp skin -1 \n",
|
||
"25 80 162 535.299988 30.299999 washburn1 skin -1 \n",
|
||
"26 91 143 541.280029 -67.720001 washburn2 skin -1 \n",
|
||
"\n",
|
||
" rw rskin kskin zpump \n",
|
||
"0 1.0 2.0 10.0 162.630005 \n",
|
||
"1 1.0 2.0 10.0 160.119995 \n",
|
||
"2 1.0 2.0 10.0 313.220001 \n",
|
||
"3 1.0 2.0 10.0 313.119995 \n",
|
||
"4 1.0 2.0 10.0 556.200012 \n",
|
||
"5 1.0 2.0 10.0 555.419983 \n",
|
||
"6 1.0 2.0 10.0 448.959991 \n",
|
||
"7 1.0 2.0 10.0 445.559998 \n",
|
||
"8 1.0 2.0 10.0 372.489990 \n",
|
||
"9 1.0 2.0 10.0 445.739990 \n",
|
||
"10 1.0 2.0 10.0 473.410004 \n",
|
||
"11 1.0 2.0 10.0 349.410004 \n",
|
||
"12 1.0 2.0 10.0 543.200012 \n",
|
||
"13 1.0 2.0 10.0 1073.910034 \n",
|
||
"14 1.0 2.0 10.0 1075.900024 \n",
|
||
"15 1.0 2.0 10.0 1004.010010 \n",
|
||
"16 1.0 2.0 10.0 700.330017 \n",
|
||
"17 1.0 2.0 10.0 699.289978 \n",
|
||
"18 1.0 2.0 10.0 690.979980 \n",
|
||
"19 1.0 2.0 10.0 1343.050049 \n",
|
||
"20 1.0 2.0 10.0 1344.439941 \n",
|
||
"21 1.0 2.0 10.0 1189.839966 \n",
|
||
"22 1.0 2.0 10.0 1132.599976 \n",
|
||
"23 1.0 2.0 10.0 603.179993 \n",
|
||
"24 1.0 2.0 10.0 501.119995 \n",
|
||
"25 1.0 2.0 10.0 31.299999 \n",
|
||
"26 1.0 2.0 10.0 -66.720001 "
|
||
]
|
||
},
|
||
"execution_count": 33,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"df = pd.DataFrame(mnw2.node_data)\n",
|
||
"df.loc[:, df.sum(axis=0) != 0]"
|
||
]
|
||
}
|
||
],
|
||
"metadata": {
|
||
"anaconda-cloud": {},
|
||
"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.6"
|
||
}
|
||
},
|
||
"nbformat": 4,
|
||
"nbformat_minor": 1
|
||
}
|