Commit 41abd99b authored by Jan Dinkelbach's avatar Jan Dinkelbach Committed by Markus Mirz
Browse files

add assertion dp vs emt to PiLine example notebook

parent f77f1f89
......@@ -295,7 +295,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Compare DP vs. EMT for PiLine Component "
"## Compare PiLine Component DP vs. EMT"
]
},
{
......@@ -307,7 +307,6 @@
"plt.figure()\n",
"for name in [('v1_0', 'v1_shift'), ('v2_0', 'v2_shift')]:\n",
" plt.plot(piline_component_emt[name[0]].time, np.sqrt(3/2)*piline_component_emt[name[0]].values - piline_component_dp_shifted[name[1]].values, label=name[0]+' vs. '+name[1])\n",
" compare_errors.append(np.absolute(np.sqrt(3/2)*piline_component_emt[name[0]].values - piline_component_dp_shifted[name[1]].values).max())\n",
"plt.legend()"
]
},
......@@ -319,10 +318,27 @@
"source": [
"plt.figure()\n",
"plt.plot(piline_component_emt['iline_0'].time, np.sqrt(3/2)*piline_component_emt['iline_0'].values - piline_component_dp_shifted['iline_shift'].values, label='iline_0'+' vs. '+'iline_shift')\n",
"compare_errors.append(np.absolute(np.sqrt(3/2)*piline_component_emt['iline_0'].values - piline_component_dp_shifted['iline_shift'].values).max())\n",
"plt.legend()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Assertion DP vs. EMT for PiLine Component"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"compare_errors = []\n",
"for name in [('v1_0', 'v1_shift'), ('v2_0', 'v2_shift'), ('iline_0', 'iline_shift')]:\n",
" compare_errors.append(np.absolute(np.sqrt(3/2)*piline_component_emt[name[0]].values - piline_component_dp_shifted[name[1]].values).max())\n",
" print(name[0]+' vs. '+name[1] + ': ' + str(compare_errors[-1]))\n",
"assert np.max(compare_errors) < 1e-3"
]
},
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment