99from autoarray .dataset .grids import GridsDataset
1010from autoarray .dataset .imaging .w_tilde import WTildeImaging
1111from autoarray .structures .arrays .uniform_2d import Array2D
12- from autoarray .operators .convolver import Convolver
1312from autoarray .structures .arrays .kernel_2d import Kernel2D
1413from autoarray .mask .mask_2d import Mask2D
1514from autoarray import type as ty
@@ -30,7 +29,7 @@ def __init__(
3029 noise_covariance_matrix : Optional [np .ndarray ] = None ,
3130 over_sample_size_lp : Union [int , Array2D ] = 4 ,
3231 over_sample_size_pixelization : Union [int , Array2D ] = 4 ,
33- pad_for_convolver : bool = False ,
32+ pad_for_psf : bool = False ,
3433 use_normalized_psf : Optional [bool ] = True ,
3534 check_noise_map : bool = True ,
3635 ):
@@ -77,7 +76,7 @@ def __init__(
7776 over_sample_size_pixelization
7877 How over sampling is performed for the grid which is associated with a pixelization, which is therefore
7978 passed into the calculations performed in the `inversion` module.
80- pad_for_convolver
79+ pad_for_psf
8180 The PSF convolution may extend beyond the edges of the image mask, which can lead to edge effects in the
8281 convolved image. If `True`, the image and noise-map are padded to ensure the PSF convolution does not
8382 extend beyond the edge of the image.
@@ -90,9 +89,9 @@ def __init__(
9089
9190 self .unmasked = None
9291
93- self .pad_for_convolver = pad_for_convolver
92+ self .pad_for_psf = pad_for_psf
9493
95- if pad_for_convolver and psf is not None :
94+ if pad_for_psf and psf is not None :
9695 try :
9796 data .mask .derive_mask .blurring_from (
9897 kernel_shape_native = psf .shape_native
@@ -167,6 +166,9 @@ def __init__(
167166
168167 self .psf = psf
169168
169+ if psf .mask .shape [0 ] % 2 == 0 or psf .mask .shape [1 ] % 2 == 0 :
170+ raise exc .KernelException ("Kernel2D Kernel2D must be odd" )
171+
170172 @cached_property
171173 def grids (self ):
172174 return GridsDataset (
@@ -176,25 +178,6 @@ def grids(self):
176178 psf = self .psf ,
177179 )
178180
179- @cached_property
180- def convolver (self ):
181- """
182- Returns a `Convolver` from a mask and 2D PSF kernel.
183-
184- The `Convolver` stores in memory the array indexing between the mask and PSF, enabling efficient 2D PSF
185- convolution of images and matrices used for linear algebra calculations (see `operators.convolver`).
186-
187- This uses lazy allocation such that the calculation is only performed when the convolver is used, ensuring
188- efficient set up of the `Imaging` class.
189-
190- Returns
191- -------
192- Convolver
193- The convolver given the masked imaging data's mask and PSF.
194- """
195-
196- return Convolver (mask = self .mask , kernel = Kernel2D (values = self .psf ._array , mask = self .psf .mask , header = self .psf .header ))
197-
198181 @cached_property
199182 def w_tilde (self ):
200183 """
@@ -370,7 +353,7 @@ def apply_mask(self, mask: Mask2D) -> "Imaging":
370353 noise_covariance_matrix = noise_covariance_matrix ,
371354 over_sample_size_lp = over_sample_size_lp ,
372355 over_sample_size_pixelization = over_sample_size_pixelization ,
373- pad_for_convolver = True ,
356+ pad_for_psf = True ,
374357 )
375358
376359 dataset .unmasked = unmasked_dataset
@@ -463,7 +446,7 @@ def apply_noise_scaling(
463446 noise_covariance_matrix = self .noise_covariance_matrix ,
464447 over_sample_size_lp = self .over_sample_size_lp ,
465448 over_sample_size_pixelization = self .over_sample_size_pixelization ,
466- pad_for_convolver = False ,
449+ pad_for_psf = False ,
467450 check_noise_map = False ,
468451 )
469452
@@ -511,7 +494,7 @@ def apply_over_sampling(
511494 over_sample_size_lp = over_sample_size_lp or self .over_sample_size_lp ,
512495 over_sample_size_pixelization = over_sample_size_pixelization
513496 or self .over_sample_size_pixelization ,
514- pad_for_convolver = False ,
497+ pad_for_psf = False ,
515498 check_noise_map = False ,
516499 )
517500
0 commit comments