Skip to content

Commit 799be12

Browse files
Jammy2211Jammy2211
authored andcommitted
fix horror bug
1 parent 0d6e2a2 commit 799be12

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

autoarray/inversion/pixelization/image_mesh/overlay.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ def image_plane_mesh_grid_from(
202202
Not used by this image mesh.
203203
"""
204204

205+
print(mask.pixels_in_mask)
206+
205207
pixel_scales = mask.pixel_scales
206208

207209
grid = mask.derive_grid.unmasked

autoarray/inversion/regularization/regularization_util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,4 +309,7 @@ def pixel_splitted_regularization_matrix_from(
309309
# Now scatter-add all entries into the (P,P) matrix
310310
reg_mat = reg_mat.at[rows, cols].add(outer_scaled)
311311

312+
# Divide diagonal by 2
313+
reg_mat = reg_mat.at[jnp.diag_indices(reg_mat.shape[0])].add(-1e-8)
314+
312315
return reg_mat

autoarray/structures/mesh/triangulation_2d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def split_points_from(points, area_weights, xp=np):
178178
"""
179179

180180
N = points.shape[0]
181-
offsets = 0.5 * area_weights
181+
offsets = area_weights
182182

183183
x = points[:, 0]
184184
y = points[:, 1]
@@ -324,7 +324,7 @@ def delaunay(self) -> "scipy.spatial.Delaunay":
324324
simplices = delaunay.simplices.astype(np.int32)
325325
vertex_neighbor_vertices = delaunay.vertex_neighbor_vertices
326326

327-
voronoi_areas = voronoi_areas_from(points_np)
327+
voronoi_areas = voronoi_areas_from(mesh_grid)
328328

329329
return DelaunayInterface(
330330
points, simplices, voronoi_areas, vertex_neighbor_vertices

0 commit comments

Comments
 (0)