Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions simpeg_drivers/utils/synthetics/surveys/time_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
)
Expand Down
6 changes: 3 additions & 3 deletions simpeg_drivers/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
7 changes: 6 additions & 1 deletion tests/run_tests/driver_ground_tem_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": 3.3993e-11, "phi_d": 2.3720e02, "phi_m": 6.4250e03}


def test_tiling_ground_tem(
Expand Down Expand Up @@ -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()


Expand Down
2 changes: 1 addition & 1 deletion tests/run_tests/oriented_ground_tem_receiver_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)

Expand Down
Loading