From 55028735283b78f6c070ed0ea22d2c4746ab64cd Mon Sep 17 00:00:00 2001 From: "Devin C. Cowan" Date: Sat, 27 Jan 2024 13:12:11 -0800 Subject: [PATCH 1/2] Finalize (#37) black and add some blank cells to work with. update topo hash. --- live/02-inversion-dc-resistivity-2d.ipynb | 39 ++++++++++++++----- .../02-inversion-dc-resistivity-2d.ipynb | 2 +- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/live/02-inversion-dc-resistivity-2d.ipynb b/live/02-inversion-dc-resistivity-2d.ipynb index b3f5570..c535a2c 100644 --- a/live/02-inversion-dc-resistivity-2d.ipynb +++ b/live/02-inversion-dc-resistivity-2d.ipynb @@ -32,6 +32,13 @@ "## Step 0: Importing Modules" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "code", "execution_count": null, @@ -170,7 +177,7 @@ "outputs": [], "source": [ "topo_url = \"https://github.com/simpeg/agrogeo24/raw/main/data/topo_2d.txt\"\n", - "topo_hash = \"1B2DAC5C46E48AB1C5606BB14621279C0A86DFD7790674A9FAAD83F3595E7030\"\n", + "topo_hash = \"09EE57B1687E9D17801993F048D7981C1F75B7D6A0F9D702927C9F6BCAA73B13\"\n", "\n", "topo_filename = pooch.retrieve(topo_url, known_hash=topo_hash)" ] @@ -181,11 +188,11 @@ "metadata": {}, "outputs": [], "source": [ - "if survey_type == 'dipole-dipole':\n", + "if survey_type == \"dipole-dipole\":\n", " data_url = \"https://github.com/simpeg/agrogeo24/raw/main/data/dipole_dipole.obs\"\n", " data_hash = \"41ad436c6f3ce9f76aff95e4b6e50c85c851bb674e0c36ed0150b655c1534eb2\"\n", " data_filename = pooch.retrieve(data_url, known_hash=data_hash)\n", - "elif survey_type == 'pole-dipole':\n", + "elif survey_type == \"pole-dipole\":\n", " data_url = \"https://github.com/simpeg/agrogeo24/raw/main/data/pole_dipole.obs\"\n", " data_hash = \"43be6078cb782f468e1feb21e42f23f33e2c3bb1b766d4038490c071e1c9db15\"\n", " data_filename = pooch.retrieve(data_url, known_hash=data_hash)\n", @@ -226,6 +233,13 @@ "dc_data = read_dcip2d_ubc(data_filename, \"volt\", \"general\")" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "markdown", "metadata": {}, @@ -398,6 +412,13 @@ "outputs": [], "source": [] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "code", "execution_count": null, @@ -1088,13 +1109,12 @@ "metadata": {}, "outputs": [], "source": [ - "if survey_type == 'dipole-dipole':\n", - "\n", + "if survey_type == \"dipole-dipole\":\n", " air_resistivity = 1e8\n", " background_resistivity = 1e2\n", " block_resistivity = 1e3\n", " basement_resistivity = 1e1\n", - " \n", + "\n", " true_resistivity = background_resistivity * np.ones(mesh.n_cells)\n", "\n", " ind_basement = mesh.cell_centers[:, -1] < -16.0\n", @@ -1106,14 +1126,13 @@ " true_resistivity[ind_block] = block_resistivity\n", "\n", " true_resistivity = true_resistivity[active_cells]\n", - " \n", - "elif survey_type == 'pole-dipole':\n", - " \n", + "\n", + "elif survey_type == \"pole-dipole\":\n", " air_resistivity = 1e8\n", " background_resistivity = 2e2\n", " aquifer_resistivity = 2e1\n", " basement_resistivity = 1e3\n", - " \n", + "\n", " true_resistivity = background_resistivity * np.ones(mesh.n_cells)\n", "\n", " ind_aquifer = mesh.cell_centers[:, -1] < -12\n", diff --git a/notebooks/02-inversion-dc-resistivity-2d.ipynb b/notebooks/02-inversion-dc-resistivity-2d.ipynb index a699be3..4ab2a7b 100644 --- a/notebooks/02-inversion-dc-resistivity-2d.ipynb +++ b/notebooks/02-inversion-dc-resistivity-2d.ipynb @@ -181,7 +181,7 @@ "outputs": [], "source": [ "topo_url = \"https://github.com/simpeg/agrogeo24/raw/main/data/topo_2d.txt\"\n", - "topo_hash = \"1B2DAC5C46E48AB1C5606BB14621279C0A86DFD7790674A9FAAD83F3595E7030\"\n", + "topo_hash = \"09EE57B1687E9D17801993F048D7981C1F75B7D6A0F9D702927C9F6BCAA73B13\"\n", "\n", "topo_filename = pooch.retrieve(topo_url, known_hash=topo_hash)" ] From 673076dce83af37f1824ecd1d8b9977be4644128 Mon Sep 17 00:00:00 2001 From: "Devin C. Cowan" Date: Sat, 27 Jan 2024 15:31:50 -0800 Subject: [PATCH 2/2] Update 02-inversion-dc-resistivity-2d.ipynb (#38) Add a couple lines. --- live/02-inversion-dc-resistivity-2d.ipynb | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/live/02-inversion-dc-resistivity-2d.ipynb b/live/02-inversion-dc-resistivity-2d.ipynb index c535a2c..6a49919 100644 --- a/live/02-inversion-dc-resistivity-2d.ipynb +++ b/live/02-inversion-dc-resistivity-2d.ipynb @@ -769,7 +769,7 @@ "\n", "### Exercise (beginner):\n", "\n", - "Use the [BaseInvProblem](https://docs.simpeg.xyz/content/api/generated/SimPEG.inverse_problem.BaseInvProblem.html) class to fully define the inverse problem that is solved at each beta (trade-off parameter) iteration. Use the variable name **inv_prob**. Instantiation requires the following as input arguments:\n", + "Use the [inverse_problem.BaseInvProblem](https://docs.simpeg.xyz/content/api/generated/SimPEG.inverse_problem.BaseInvProblem.html) class to fully define the inverse problem that is solved at each beta (trade-off parameter) iteration. Use the variable name **inv_prob**. Instantiation requires the following as input arguments:\n", "\n", "* **dmis** (the data misfit object)\n", "* **reg** (the regularization object)\n", @@ -895,6 +895,13 @@ "outputs": [], "source": [] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "markdown", "metadata": {}, @@ -1198,11 +1205,11 @@ ] }, { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", "metadata": {}, - "outputs": [], - "source": [] + "source": [ + "**Save notebook to drive so we can reuse tomorrow!**" + ] } ], "metadata": {