From 2f8747f42fc70f561eddcfc5da3f6422bd3ce2de Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Thu, 25 Jan 2024 13:07:40 -0800 Subject: [PATCH] Fix cells for mesh creation --- live/01-forward-dc-resisitivity-2d.ipynb | 65 +++--------------------- 1 file changed, 8 insertions(+), 57 deletions(-) diff --git a/live/01-forward-dc-resisitivity-2d.ipynb b/live/01-forward-dc-resisitivity-2d.ipynb index b764582..f36d9f7 100644 --- a/live/01-forward-dc-resisitivity-2d.ipynb +++ b/live/01-forward-dc-resisitivity-2d.ipynb @@ -187,7 +187,14 @@ "\n", "# Shift top to maximum topography and center of survey line\n", "y_topo_max = np.max(topo_2d[:, -1])\n", - "mesh.origin = mesh.origin + np.r_[np.mean(end_locations), y_topo_max]" + "mesh.origin = mesh.origin + np.r_[0, y_topo_max]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Once the tree mesh is initialized, we want to refine it close to the electrodes and around the topography" ] }, { @@ -241,62 +248,6 @@ "plt.show()" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Once the tree mesh is initialized, we want to refine it close to the electrodes and around the topography" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Plot the mesh\n", - "fig = plt.figure(figsize=(8, 4))\n", - "\n", - "ax1 = fig.add_axes([0.14, 0.17, 0.8, 0.7])\n", - "mesh.plot_grid(ax=ax1, linewidth=1)\n", - "ax1.grid(False)\n", - "ax1.set_xlim(-200, 200)\n", - "ax1.set_ylim(np.max(y_topo) - 200, np.max(y_topo))\n", - "ax1.set_title(\"Mesh\")\n", - "ax1.set_xlabel(\"x (m)\")\n", - "ax1.set_ylabel(\"y (m)\")\n", - "\n", - "plt.show()" - ] - }, { "cell_type": "markdown", "metadata": {},