Skip to content

Commit bdeabaf

Browse files
Jammy2211Jammy2211
authored andcommitted
Rectangular mesh renames
1 parent e3ce0f7 commit bdeabaf

File tree

18 files changed

+45
-43
lines changed

18 files changed

+45
-43
lines changed

autoarray/dataset/interferometer/dataset.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def apply_w_tilde(
162162
self,
163163
curvature_preload=None,
164164
batch_size: int = 128,
165+
chunk_k: int = 2048,
165166
show_progress: bool = False,
166167
show_memory: bool = False,
167168
use_jax: bool = False,
@@ -193,13 +194,16 @@ def apply_w_tilde(
193194

194195
if curvature_preload is None:
195196

196-
logger.info("INTERFEROMETER - Computing W-Tilde; runtime scales with visibility count and mask resolution, extreme inputs may exceed hours.")
197+
logger.info(
198+
"INTERFEROMETER - Computing W-Tilde; runtime scales with visibility count and mask resolution, extreme inputs may exceed hours."
199+
)
197200

198201
curvature_preload = inversion_interferometer_util.w_tilde_curvature_preload_interferometer_from(
199202
noise_map_real=self.noise_map.array.real,
200203
uv_wavelengths=self.uv_wavelengths,
201204
shape_masked_pixels_2d=self.transformer.grid.mask.shape_native_masked_pixels,
202205
grid_radians_2d=self.transformer.grid.mask.derive_grid.all_false.in_radians.native.array,
206+
chunk_k=chunk_k,
203207
show_memory=show_memory,
204208
show_progress=show_progress,
205209
use_jax=use_jax,

autoarray/exc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class MeshException(Exception):
7272
"""
7373
Raises exceptions associated with the `inversion/mesh` modules and `Mesh` classes.
7474
75-
For example if a `RectangularMagnification` mesh has dimensions below 3x3.
75+
For example if a `RectangularAdaptDensity` mesh has dimensions below 3x3.
7676
"""
7777

7878
pass

autoarray/fit/fit_imaging.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ def __init__(
5555

5656
@property
5757
def data(self) -> ty.DataLike:
58-
if self.dataset_model.background_sky_level != 0.0:
59-
return self.dataset.data - self.dataset_model.background_sky_level
60-
return self.dataset.data
58+
return self.dataset.data - self.dataset_model.background_sky_level
6159

6260
@property
6361
def blurred_image(self) -> Array2D:

autoarray/inversion/inversion/abstract.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ def cls_list_from(self, cls: Type, cls_filtered: Optional[Type] = None) -> List:
160160
161161
- If the input is `cls=aa.mesh.Mesh`, a list containing all pixelizations in the class are returned.
162162
163-
- If `cls=aa.mesh.Mesh` and `cls_filtered=aa.mesh.RectangularMagnification`, a list of all pixelizations
164-
excluding those which are `RectangularMagnification` pixelizations will be returned.
163+
- If `cls=aa.mesh.Mesh` and `cls_filtered=aa.mesh.RectangularAdaptDensity`, a list of all pixelizations
164+
excluding those which are `RectangularAdaptDensity` pixelizations will be returned.
165165
166166
Parameters
167167
----------

autoarray/inversion/inversion/interferometer/inversion_interferometer_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def w_tilde_curvature_preload_interferometer_via_np_from(
276276
K = uv_wavelengths.shape[0]
277277
n_chunks = (K + chunk_k - 1) // chunk_k
278278

279-
w = 1.0 / (noise_map_real ** 2)
279+
w = 1.0 / (noise_map_real**2)
280280
ku = 2.0 * np.pi * uv_wavelengths[:, 0]
281281
kv = 2.0 * np.pi * uv_wavelengths[:, 1]
282282

autoarray/inversion/inversion/mapper_valued.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def magnification_via_mesh_from(
245245
246246
To compute the magnification of a `Delaunay` mesh, use the method `magnification_via_interpolation_from`.
247247
248-
This method only supports a `RectangularMagnification`.
248+
This method only supports a `RectangularAdaptDensity`.
249249
"""
250250
)
251251

autoarray/inversion/linear_obj/neighbors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
class Neighbors(np.ndarray):
55
def __new__(cls, arr: np.ndarray, sizes: np.ndarray):
66
"""
7-
Class packaging ndarrays describing the neighbors of every pixel in a mesh (e.g. `RectangularMagnification`).
7+
Class packaging ndarrays describing the neighbors of every pixel in a mesh (e.g. `RectangularAdaptDensity`).
88
99
The array `arr` contains the pixel indexes of the neighbors of every pixel. Its has shape [total_pixels,
1010
max_neighbors_in_single_pixel].
1111
1212
The array `sizes` contains the number of neighbors of every pixel in the pixelixzation.
1313
14-
For example, for a 3x3 `RectangularMagnification` grid:
14+
For example, for a 3x3 `RectangularAdaptDensity` grid:
1515
1616
- `total_pixels=9` and `max_neighbors_in_single_pixel=4` (because the central pixel has 4 neighbors whereas
1717
edge / corner pixels have 3 and 2).

autoarray/inversion/pixelization/mappers/abstract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def mapped_to_source_from(self, array: Array2D) -> np.ndarray:
369369
"""
370370
return mapper_util.mapped_to_source_via_mapping_matrix_from(
371371
mapping_matrix=np.array(self.mapping_matrix),
372-
array_slim=array.slim,
372+
array_slim=array.slim.array,
373373
)
374374

375375
def extent_from(

autoarray/inversion/pixelization/mappers/delaunay.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ def pix_sub_weights(self) -> PixSubWeights:
158158
The `sub_slim_index` refers to the masked data sub-pixels and `pix_indexes` the pixelization pixel indexes,
159159
for example:
160160
161-
- `pix_indexes_for_sub_slim_index[0, 0] = 2`: The data's first (index 0) sub-pixel maps to the RectangularMagnification
161+
- `pix_indexes_for_sub_slim_index[0, 0] = 2`: The data's first (index 0) sub-pixel maps to the RectangularAdaptDensity
162162
pixelization's third (index 2) pixel.
163163
164-
- `pix_indexes_for_sub_slim_index[2, 0] = 4`: The data's third (index 2) sub-pixel maps to the RectangularMagnification
164+
- `pix_indexes_for_sub_slim_index[2, 0] = 4`: The data's third (index 2) sub-pixel maps to the RectangularAdaptDensity
165165
pixelization's fifth (index 4) pixel.
166166
167167
The second dimension of the array `pix_indexes_for_sub_slim_index`, which is 0 in both examples above, is used

autoarray/inversion/pixelization/mappers/rectangular.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class MapperRectangular(AbstractMapper):
3939
`Delaunay` triangulation, where every `grid_slim` pixel maps to three Delaunay pixels (the corners of the
4040
triangles) with varying interpolation weights .
4141
42-
For a `RectangularMagnification` mesh every pixel in the masked data maps to only one pixel, thus the second
42+
For a `RectangularAdaptDensity` mesh every pixel in the masked data maps to only one pixel, thus the second
4343
dimension of `pix_indexes_for_sub_slim_index` is always of size 1.
4444
4545
The mapper allows us to create a mapping matrix, which is a matrix representing the mapping between every
@@ -64,7 +64,7 @@ def shape_native(self) -> Tuple[int, ...]:
6464
def pix_sub_weights(self) -> PixSubWeights:
6565
"""
6666
Computes the following three quantities describing the mappings between of every sub-pixel in the masked data
67-
and pixel in the `RectangularMagnification` mesh.
67+
and pixel in the `RectangularAdaptDensity` mesh.
6868
6969
- `pix_indexes_for_sub_slim_index`: the mapping of every data pixel (given its `sub_slim_index`)
7070
to mesh pixels (given their `pix_indexes`).
@@ -79,18 +79,18 @@ def pix_sub_weights(self) -> PixSubWeights:
7979
The `sub_slim_index` refers to the masked data sub-pixels and `pix_indexes` the mesh pixel indexes,
8080
for example:
8181
82-
- `pix_indexes_for_sub_slim_index[0, 0] = 2`: The data's first (index 0) sub-pixel maps to the RectangularMagnification
82+
- `pix_indexes_for_sub_slim_index[0, 0] = 2`: The data's first (index 0) sub-pixel maps to the RectangularAdaptDensity
8383
mesh's third (index 2) pixel.
8484
85-
- `pix_indexes_for_sub_slim_index[2, 0] = 4`: The data's third (index 2) sub-pixel maps to the RectangularMagnification
85+
- `pix_indexes_for_sub_slim_index[2, 0] = 4`: The data's third (index 2) sub-pixel maps to the RectangularAdaptDensity
8686
mesh's fifth (index 4) pixel.
8787
8888
The second dimension of the array `pix_indexes_for_sub_slim_index`, which is 0 in both examples above, is used
8989
for cases where a data pixel maps to more than one mesh pixel (for example a `Delaunay` triangulation
9090
where each data pixel maps to 3 Delaunay triangles with interpolation weights). The weights of multiple mappings
9191
are stored in the array `pix_weights_for_sub_slim_index`.
9292
93-
For a RectangularMagnification pixelization each data sub-pixel maps to a single mesh pixel, thus the second
93+
For a RectangularAdaptDensity pixelization each data sub-pixel maps to a single mesh pixel, thus the second
9494
dimension of the array `pix_indexes_for_sub_slim_index` 1 and all entries in `pix_weights_for_sub_slim_index`
9595
are equal to 1.0.
9696
"""

0 commit comments

Comments
 (0)