From 3ed50878e0659b6ca5a9419304a97ec60f331398 Mon Sep 17 00:00:00 2001 From: domfournier Date: Wed, 14 Oct 2026 15:34:14 -0700 Subject: [PATCH 1/5] Only apply receiver locs to non-large loop surveys --- simpeg_drivers/utils/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simpeg_drivers/utils/utils.py b/simpeg_drivers/utils/utils.py index b223cce4..f18f566f 100644 --- a/simpeg_drivers/utils/utils.py +++ b/simpeg_drivers/utils/utils.py @@ -491,8 +491,6 @@ def get_containing_cells( else: locations = data.locations - inds = mesh.get_containing_cells(locations) - if isinstance(data.entity, LargeLoopGroundEMSurvey): line_ind = [] transmitters = data.entity.transmitters @@ -503,7 +501,9 @@ def get_containing_cells( transmitters.vertices[cell[1], :], ) ) - inds = np.r_[inds, np.hstack(line_ind)] + inds = np.hstack(line_ind) + else: + inds = mesh.get_containing_cells(locations) elif isinstance(mesh, TensorMesh): locations = data.drape_locations() From 78c2092c23d4132f004f183420fffb7e36a3a17b Mon Sep 17 00:00:00 2001 From: domfournier Date: Wed, 14 Oct 2026 15:34:54 -0700 Subject: [PATCH 2/5] Update unit test --- tests/run_tests/driver_ground_tem_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run_tests/driver_ground_tem_test.py b/tests/run_tests/driver_ground_tem_test.py index 389cff25..d65a5e23 100644 --- a/tests/run_tests/driver_ground_tem_test.py +++ b/tests/run_tests/driver_ground_tem_test.py @@ -45,7 +45,7 @@ # To test the full run and validate the inversion. # Move this file out of the test directory and run. -target_run = {"data_norm": 1.8460e-11, "phi_d": 3.0390e01, "phi_m": 2.0320e04} +target_run = {"data_norm": 1.8460e-11, "phi_d": 3.0370e01, "phi_m": 2.0310e04} def test_tiling_ground_tem( From bccaa4d68266f93c201a6cca616602f59f4c3f5b Mon Sep 17 00:00:00 2001 From: domfournier Date: Wed, 14 Oct 2026 17:50:00 -0700 Subject: [PATCH 3/5] More the receivers and check inactive --- simpeg_drivers/utils/synthetics/surveys/time_domain.py | 3 +++ tests/run_tests/driver_ground_tem_test.py | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/simpeg_drivers/utils/synthetics/surveys/time_domain.py b/simpeg_drivers/utils/synthetics/surveys/time_domain.py index 7e823186..ad882b7d 100644 --- a/simpeg_drivers/utils/synthetics/surveys/time_domain.py +++ b/simpeg_drivers/utils/synthetics/surveys/time_domain.py @@ -216,6 +216,9 @@ def generate_large_loop_survey( cells.append(np.c_[inds, inds + 1]) count += X.shape[1] + # Put receivers in the air + vertices[:, 2] += 25.0 + survey = LargeLoopGroundTEMReceivers.create( geoh5, name=name, vertices=vertices, cells=np.vstack(cells) ) diff --git a/tests/run_tests/driver_ground_tem_test.py b/tests/run_tests/driver_ground_tem_test.py index d65a5e23..888381ae 100644 --- a/tests/run_tests/driver_ground_tem_test.py +++ b/tests/run_tests/driver_ground_tem_test.py @@ -45,7 +45,7 @@ # To test the full run and validate the inversion. # Move this file out of the test directory and run. -target_run = {"data_norm": 1.8460e-11, "phi_d": 3.0370e01, "phi_m": 2.0310e04} +target_run = {"data_norm": 3.3993e-11, "phi_d": 2.3720e02, "phi_m": 6.4250e03} def test_tiling_ground_tem( @@ -112,6 +112,11 @@ def test_tiling_ground_tem( for tile in tiles[None]: assert len(np.unique(components.survey.tx_id_property.values[tile])) == 1 + # Check that all receivers are in the air + indices = fwr_driver.inversion_mesh.mesh.get_containing_cells( + components.survey.vertices + ) + assert np.all(~fwr_driver.models.active_cells[indices]) fwr_driver.run() From 0408fc57fb246ccc58c2994c95cb44202142e0fb Mon Sep 17 00:00:00 2001 From: domfournier Date: Wed, 14 Oct 2026 21:30:42 -0700 Subject: [PATCH 4/5] Switch to almost equal --- tests/run_tests/oriented_ground_tem_receiver_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run_tests/oriented_ground_tem_receiver_test.py b/tests/run_tests/oriented_ground_tem_receiver_test.py index 4350309d..06cf489a 100644 --- a/tests/run_tests/oriented_ground_tem_receiver_test.py +++ b/tests/run_tests/oriented_ground_tem_receiver_test.py @@ -166,7 +166,7 @@ def test_tem_fwr_run(tmp_path: Path): rot_vals = np.vstack(rot_vals) # Check that the total fields are preserved - np.testing.assert_allclose( + np.testing.assert_array_almost_equal( np.linalg.norm(rot_vals, axis=0), np.linalg.norm(comp_vals, axis=0) ) From 22d239390ddc4f1ee3c5111699e51c263aa13a08 Mon Sep 17 00:00:00 2001 From: domfournier Date: Fri, 16 Oct 2026 11:39:06 -0700 Subject: [PATCH 5/5] Revert changes to the borehole test --- simpeg_drivers/utils/synthetics/surveys/time_domain.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/simpeg_drivers/utils/synthetics/surveys/time_domain.py b/simpeg_drivers/utils/synthetics/surveys/time_domain.py index ad882b7d..c67825ff 100644 --- a/simpeg_drivers/utils/synthetics/surveys/time_domain.py +++ b/simpeg_drivers/utils/synthetics/surveys/time_domain.py @@ -75,11 +75,11 @@ def generate_borehole_survey( survey = generate_large_loop_survey( geoh5, X, Y, Z, channels=channels, waveform=waveform, name=name, n_loops=1 ) - - center = survey.vertices[0, :] - survey.vertices = ( - y_rotation_matrix(np.pi / 4) @ (survey.vertices - center).T - ).T + center + # Put receivers in the air + vertices = survey.vertices + vertices[:, 2] -= 25.0 + center = vertices[0, :] + survey.vertices = (y_rotation_matrix(np.pi / 4) @ (vertices - center).T).T + center return survey