diff --git a/simpeg_drivers/plate_simulation/__init__.py b/simpeg_drivers/plate_simulation/__init__.py index 6f1705aa..df32b204 100644 --- a/simpeg_drivers/plate_simulation/__init__.py +++ b/simpeg_drivers/plate_simulation/__init__.py @@ -7,5 +7,3 @@ # (see LICENSE file at the root of this source code package). ' # ' # ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -from .driver import PlateSimulationDriver diff --git a/simpeg_drivers/plate_simulation/match/__init__.py b/simpeg_drivers/plate_simulation/match/__init__.py index 56a5c742..df32b204 100644 --- a/simpeg_drivers/plate_simulation/match/__init__.py +++ b/simpeg_drivers/plate_simulation/match/__init__.py @@ -7,5 +7,3 @@ # (see LICENSE file at the root of this source code package). ' # ' # ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -from .driver import PlateMatchDriver diff --git a/simpeg_drivers/plate_simulation/match/driver.py b/simpeg_drivers/plate_simulation/match/driver.py index 6dc5ea1c..bf2b13ac 100644 --- a/simpeg_drivers/plate_simulation/match/driver.py +++ b/simpeg_drivers/plate_simulation/match/driver.py @@ -15,6 +15,10 @@ from pathlib import Path from typing import Self +import matplotlib + + +matplotlib.use("Agg") import matplotlib.pyplot as plt import numpy as np from dask.distributed import Client, Future, progress @@ -194,6 +198,7 @@ def _create_plate_from_parameters( :return: MaxwellPlate object created from the parameters. """ center = self.params.survey.vertices[index_center] + center[2] = ( self._drape_heights[index_center] - model_options.overburden_options.thickness @@ -364,6 +369,10 @@ def run(self): query, strike_angle[ii] ) flip = is_up_dip(observed[:, indices]) + + if flip: + indices = np.flip(indices, axis=0) + # Loop through files and compute scores and find the best match scores, centers = self.run_scores(spatial_projection, observed[:, indices]) ranked = np.argsort(scores) @@ -433,6 +442,9 @@ def run_scores(self, spatial_projection, data) -> tuple[np.ndarray, np.ndarray]: ) tasks = [] for file_batch in file_split: + if len(file_batch) == 0: + continue + args = ( file_batch, spatial_projection, diff --git a/simpeg_drivers/plate_simulation/sweep/__init__.py b/simpeg_drivers/plate_simulation/sweep/__init__.py index f6af80c8..df32b204 100644 --- a/simpeg_drivers/plate_simulation/sweep/__init__.py +++ b/simpeg_drivers/plate_simulation/sweep/__init__.py @@ -7,5 +7,3 @@ # (see LICENSE file at the root of this source code package). ' # ' # ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -from .driver import PlateSweepDriver diff --git a/tests/run_tests/driver_joint_pgi_homogeneous_test.py b/tests/run_tests/driver_joint_pgi_homogeneous_test.py index 33e74ddb..67649450 100644 --- a/tests/run_tests/driver_joint_pgi_homogeneous_test.py +++ b/tests/run_tests/driver_joint_pgi_homogeneous_test.py @@ -223,7 +223,7 @@ def test_homogeneous_run( # Remove inversion type as per current json on file options = driver.out_group.options - del options["inversion_type"] + options.pop("inversion_type", None) driver.out_group.options = options drivers.append(driver) else: