Skip to content

Commit dd7ca45

Browse files
committed
inversion now uses Convoler again, all numba, factory tests pass
1 parent 39fbf72 commit dd7ca45

8 files changed

Lines changed: 583 additions & 11 deletions

File tree

autoarray/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from .fit.fit_imaging import FitImaging
2121
from .fit.fit_interferometer import FitInterferometer
2222
from .geometry.geometry_2d import Geometry2D
23+
from .inversion.convolver import Convolver
2324
from .inversion.pixelization.mappers.abstract import AbstractMapper
2425
from .inversion.pixelization import mesh
2526
from .inversion.pixelization import image_mesh

autoarray/dataset/imaging/dataset.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,27 @@ def grids(self):
179179
psf=self.psf,
180180
)
181181

182+
@cached_property
183+
def convolver(self):
184+
"""
185+
Returns a `Convolver` from a mask and 2D PSF kernel.
186+
187+
The `Convolver` stores in memory the array indexing between the mask and PSF, enabling efficient 2D PSF
188+
convolution of images and matrices used for linear algebra calculations (see `operators.convolver`).
189+
190+
This uses lazy allocation such that the calculation is only performed when the convolver is used, ensuring
191+
efficient set up of the `Imaging` class.
192+
193+
Returns
194+
-------
195+
Convolver
196+
The convolver given the masked imaging data's mask and PSF.
197+
"""
198+
199+
from autoarray.inversion.convolver import Convolver
200+
201+
return Convolver(mask=self.mask, kernel=self.psf)
202+
182203
@cached_property
183204
def w_tilde(self):
184205
"""

0 commit comments

Comments
 (0)