Skip to content

Commit 723111c

Browse files
Jammy2211Jammy2211
authored andcommitted
move areas factor
1 parent f60bb2f commit 723111c

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

autoarray/inversion/pixelization/interpolator/delaunay.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
split_points_from,
1010
)
1111

12-
1312
def scipy_delaunay(points_np, query_points_np, areas_factor):
1413
"""Compute Delaunay simplices (simplices_padded) and Voronoi areas in one call."""
1514

@@ -427,12 +426,10 @@ def delaunay(self) -> "scipy.spatial.Delaunay":
427426

428427
if self.preloads is not None:
429428

430-
areas_factor = self.preloads.areas_factor
431429
skip_areas = self.preloads.skip_areas
432430

433431
else:
434432

435-
areas_factor = 0.5
436433
skip_areas = False
437434

438435
if not skip_areas:
@@ -445,7 +442,7 @@ def delaunay(self) -> "scipy.spatial.Delaunay":
445442
jax_delaunay(
446443
points=self.mesh_grid_xy,
447444
query_points=self.data_grid.over_sampled,
448-
areas_factor=areas_factor,
445+
areas_factor=self.mesh.areas_factor,
449446
)
450447
)
451448

@@ -455,7 +452,7 @@ def delaunay(self) -> "scipy.spatial.Delaunay":
455452
scipy_delaunay(
456453
points_np=self.mesh_grid_xy,
457454
query_points_np=self.data_grid.over_sampled,
458-
areas_factor=areas_factor,
455+
areas_factor=self.mesh.areas_factor,
459456
)
460457
)
461458

autoarray/inversion/pixelization/mesh/delaunay.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
class Delaunay(AbstractMesh):
13-
def __init__(self):
13+
def __init__(self, areas_factor: float = 0.5):
1414
"""
1515
An irregular mesh of Delaunay triangle pixels, which using linear barycentric interpolation are paired with
1616
a 2D grid of (y,x) coordinates.
@@ -35,6 +35,7 @@ def __init__(self):
3535
triangle corners they are a closer distance to.
3636
"""
3737
super().__init__()
38+
self.areas_factor = areas_factor
3839

3940
@property
4041
def mapper_cls(self):

autoarray/preloads.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def __init__(
2424
source_pixel_zeroed_indices: np.ndarray = None,
2525
image_plane_mesh_grid_list: np.ndarray = None,
2626
linear_light_profile_blurred_mapping_matrix=None,
27-
areas_factor: float = 0.5,
2827
skip_areas: bool = False,
2928
):
3029
"""
@@ -81,8 +80,6 @@ def __init__(
8180
inversion, with the other component being the pixelization's pixels. These are fixed when the lens light
8281
is fixed to the maximum likelihood solution, allowing the blurred mapping matrix to be preloaded, but
8382
the intensity values will still be solved for during the inversion.
84-
areas_factor
85-
Factor used to scale the Voronoi areas during split point computation. Default is 0.5.
8683
skip_areas
8784
Whether to skip Voronoi area calculations and split point computations during Delaunay triangulation.
8885
When True, the Delaunay interface returns only the minimal set of outputs (points, simplices, mappings)
@@ -128,5 +125,4 @@ def __init__(
128125
linear_light_profile_blurred_mapping_matrix
129126
)
130127

131-
self.areas_factor = areas_factor
132128
self.skip_areas = skip_areas

0 commit comments

Comments
 (0)