From dcf1a83672f5ea8659e036896e90eef81863df63 Mon Sep 17 00:00:00 2001 From: Lindsey Heagy Date: Wed, 6 Mar 2024 22:43:56 -0800 Subject: [PATCH] simplify the logic for defining the mesh --- geoscilabs/inversion/TomographyInversion.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/geoscilabs/inversion/TomographyInversion.py b/geoscilabs/inversion/TomographyInversion.py index 1c1c85e..f7c9c8d 100644 --- a/geoscilabs/inversion/TomographyInversion.py +++ b/geoscilabs/inversion/TomographyInversion.py @@ -131,7 +131,7 @@ def add_noise(self): def get_block_index(self, xc=50, yc=50, dx=20, dy=20): p0 = np.array([xc - dx / 2.0, yc + dy / 2]) p1 = np.array([xc + dx / 2.0, yc - dy / 2]) - index = utils.model_builder.getIndicesBlock(p0, p1, self.mesh_prop.gridCC) + index = utils.model_builder.get_indices_block(p0, p1, self.mesh_prop.gridCC) return index def get_block_points(self, xc=50, yc=50, dx=20, dy=20): @@ -171,7 +171,7 @@ def plot_model( 1.0 / self.slowness_prop, ax=ax, grid=show_grid, - gridOpts={"color": "white", "alpha": 0.5}, + grid_opts={"color": "white", "linewidth":0.5} #, "alpha": 0.5}, ) plt.colorbar(out[0], ax=ax, fraction=0.02) ax.plot( @@ -186,7 +186,7 @@ def plot_model( ax.set_xlabel("x (m)") ax.set_ylabel("z (m)") ax.set_title( - ("(%.1fm, %.1fm)") % (self.mesh_prop.hx.min(), self.mesh_prop.hy.min()) + ("(%.1fm, %.1fm)") % (self.mesh_prop.h[0].min(), self.mesh_prop.h[1].min()) ) else: @@ -208,7 +208,7 @@ def plot_model( 1.0 / self.slowness_prop, ax=ax, grid=show_grid, - gridOpts={"color": "white", "alpha": 0.5}, + grid_opts={"color": "white", "linewidth":0.5} #, "alpha": 0.5}, ) plt.colorbar(out[0], ax=ax, fraction=0.02) ax.plot(