Skip to content

Commit a32e0de

Browse files
Jammy2211Jammy2211
authored andcommitted
Delaunay visualization fix
1 parent 656814a commit a32e0de

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

autoarray/config/visualize/plots.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ imaging: # Settings for plots of imaging datas
99
psf: false
1010
fit: # Settings for plots of all fits (e.g. FitImaging, FitInterferometer).
1111
subplot_fit: true # Plot subplot of all fit quantities for any dataset (e.g. the model data, residual-map, etc.)?
12-
subplot_fit_log10: true # Plot subplot of all fit quantities for any dataset using log10 color maps (e.g. the model data, residual-map, etc.)?
12+
subplot_fit_log10: false # Plot subplot of all fit quantities for any dataset using log10 color maps (e.g. the model data, residual-map, etc.)?
1313
data: false # Plot individual plots of the data?
1414
noise_map: false # Plot individual plots of the noise-map?
1515
signal_to_noise_map: false # Plot individual plots of the signal-to-noise-map?

autoarray/plot/inversion.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,20 @@ def _plot_delaunay(ax, pixel_values, mapper, norm, colormap, is_subplot=False):
257257
tick labels (matches the behaviour of :func:`~autoarray.plot.array.plot_array`).
258258
"""
259259
mesh_grid = mapper.source_plane_mesh_grid
260-
x = mesh_grid[:, 1]
261-
y = mesh_grid[:, 0]
260+
261+
if hasattr(mesh_grid, "array"):
262+
mesh_grid = mesh_grid.array
263+
264+
mesh_grid = np.asarray(mesh_grid)
265+
266+
x = np.asarray(mesh_grid[:, 1], dtype=float)
267+
y = np.asarray(mesh_grid[:, 0], dtype=float)
262268

263269
if hasattr(pixel_values, "array"):
264270
vals = pixel_values.array
265271
else:
266272
vals = pixel_values
267273

268-
tc = ax.tripcolor(x, y, vals, cmap=colormap, norm=norm, shading="gouraud")
274+
tc = ax.tripcolor(x, y, vals, cmap=colormap, norm=norm)
269275
from autoarray.plot.utils import _apply_colorbar
270276
_apply_colorbar(tc, ax, is_subplot=is_subplot)

0 commit comments

Comments
 (0)