Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
838c642
add gc
Jammy2211 Nov 10, 2024
919e7b8
Merge pull request #142 from Jammy2211/feature/coordinate_jax
rhayes777 Nov 11, 2024
68200db
fix
rhayes777 Nov 11, 2024
fa21a87
Merge pull request #144 from Jammy2211/feature/garbabe_collection
Jammy2211 Nov 11, 2024
276d832
fixes
rhayes777 Nov 11, 2024
229da37
test illustrating containment works as expected
rhayes777 Nov 11, 2024
00886ff
format;
rhayes777 Nov 11, 2024
99ab78c
check triangles touch
rhayes777 Nov 11, 2024
c126627
ensure grid is properly tiled
rhayes777 Nov 11, 2024
4f2c54c
Merge pull request #145 from Jammy2211/feature/fixes
Jammy2211 Nov 11, 2024
0482967
uncomment tests
Jammy2211 Nov 11, 2024
faaa350
preload fix
Jammy2211 Nov 13, 2024
588df3a
'Updated version in __init__ to 2024.11.13.2
rhayes777 Nov 13, 2024
666a078
plot work already!
Jammy2211 Nov 14, 2024
f209d33
moved to DelaunayDrawer
Jammy2211 Nov 14, 2024
852e093
plot now fully works
Jammy2211 Nov 14, 2024
7dd9b07
delaunay plotter unitt est
Jammy2211 Nov 14, 2024
23f1755
add_poisson_noise -> add_poisson_noise_to_data
Jammy2211 Nov 18, 2024
3edc108
update unitt ests
Jammy2211 Nov 18, 2024
6e97858
test__via_image_from__disable_poisson_noise_in_noise_map
Jammy2211 Nov 18, 2024
a1e6bcc
reognise tests
Jammy2211 Nov 18, 2024
fbf65b0
Merge pull request #147 from Jammy2211/feature/disable_noise
Jammy2211 Nov 18, 2024
b953af2
docstring
Jammy2211 Nov 18, 2024
e4ac84f
git Merge branch 'feature/disable_noise' into main
Jammy2211 Nov 18, 2024
5b33e25
Merge branch 'main' into feature/delaunay_visual
Jammy2211 Nov 18, 2024
3df1838
Merge pull request #146 from Jammy2211/feature/delaunay_visual
Jammy2211 Nov 18, 2024
01a3aad
errors -> reconstruction noise map
Jammy2211 Nov 20, 2024
c51f76b
docstrings
Jammy2211 Nov 20, 2024
4ba02c4
fix unit test
Jammy2211 Nov 20, 2024
b7dfc95
final
Jammy2211 Nov 20, 2024
ed40f86
Merge pull request #148 from Jammy2211/feature/inversion_noise_map
Jammy2211 Nov 20, 2024
2f2dfca
set limit to 15 triangles
rhayes777 Nov 22, 2024
caf02dc
nan mask null indices to -1
rhayes777 Nov 22, 2024
2d02f17
signal to noise value scasling adding
Jammy2211 Nov 26, 2024
838bc7a
add option should_zero_data
Jammy2211 Nov 26, 2024
824bf07
Merge pull request #149 from Jammy2211/feature/noise_scaling_snr
Jammy2211 Nov 26, 2024
cfee369
move should zero data
Jammy2211 Nov 26, 2024
cf25d88
should zero fix?
Jammy2211 Nov 26, 2024
8b07b25
should zero fix?
Jammy2211 Nov 26, 2024
7e38136
fix jax precision
rhayes777 Nov 29, 2024
9517624
Merge branch 'main' into feature/fixes
rhayes777 Nov 29, 2024
d67a2a8
moved array triangles into package and added more abstract class
rhayes777 Nov 29, 2024
d082574
same for coordinate array triangles
rhayes777 Nov 29, 2024
d043f04
generating vertex coordinates... will this actually give a speedup?
rhayes777 Nov 29, 2024
fe3a4f1
use centres not coordinates
rhayes777 Nov 29, 2024
8fa2826
making coordinate arrays int32 instead of float
rhayes777 Nov 29, 2024
f78e377
ensure other arrays are also int32
rhayes777 Nov 29, 2024
181f664
passing a mask around and retaining int32 coordinates
rhayes777 Nov 29, 2024
9ba7197
more int32
rhayes777 Nov 29, 2024
273f796
using jax numpy in more places
rhayes777 Dec 2, 2024
d60c777
use mask to determine length
rhayes777 Dec 2, 2024
7ddb7d0
fix use of unique for jax
rhayes777 Dec 2, 2024
de032ae
fix numpy use
rhayes777 Dec 2, 2024
05c2089
revert to representing coordinates as floats
rhayes777 Dec 2, 2024
02c9e4d
fix
rhayes777 Dec 2, 2024
50b28d5
brightest_coordinate_in_region_from
Jammy2211 Dec 9, 2024
b9689b8
added brightest_sub_pixel_coordinate_in_region_from
Jammy2211 Dec 9, 2024
ce815ed
fin
Jammy2211 Dec 12, 2024
100e521
black
Jammy2211 Dec 12, 2024
9e6ab87
Merge pull request #154 from Jammy2211/feature/brightest_pixel
Jammy2211 Dec 12, 2024
bf1f2b8
all over samplers dont support None
Jammy2211 Dec 14, 2024
3ef3d60
remove Grid2D Iterate and sort bugs
Jammy2211 Dec 14, 2024
177bfda
mid way through big refactor removing a lor of ocer sampoling nonsens…
Jammy2211 Dec 15, 2024
b209f3e
fix over sample util tests and rename
Jammy2211 Dec 15, 2024
cdda058
structure tests pass
Jammy2211 Dec 15, 2024
a5ddad2
fix dataset tests
Jammy2211 Dec 15, 2024
eabb866
most tests fixed
Jammy2211 Dec 15, 2024
9ebe6f8
all tests pass
Jammy2211 Dec 15, 2024
d4a8ef3
black
Jammy2211 Dec 15, 2024
3e0f442
horrible refactor nearly done
Jammy2211 Dec 15, 2024
215baab
remove config nonsense
Jammy2211 Dec 15, 2024
73d6700
uniform -> lp
Jammy2211 Dec 15, 2024
9810993
fix numpy jax import
rhayes777 Dec 16, 2024
28de257
Merge pull request #153 from Jammy2211/feature/revert_to_float
rhayes777 Dec 16, 2024
bae9503
fix issue causing ndarray to not be a type when accessed via jax wrapper
rhayes777 Dec 16, 2024
e7a66fe
Merge pull request #155 from Jammy2211/feature/wrapper_fix
rhayes777 Dec 16, 2024
1fab29e
border relocator refactor
Jammy2211 Dec 16, 2024
305f50e
simplify grid over sampled API
Jammy2211 Dec 16, 2024
4f7251e
simplify API
Jammy2211 Dec 16, 2024
9aff29b
noise scaling hacks
Jammy2211 Dec 16, 2024
6f01e62
fix
Jammy2211 Dec 16, 2024
3806cb7
undo changes
Jammy2211 Dec 16, 2024
b054a45
merge in jax wrapper changes
rhayes777 Dec 16, 2024
1e2cc67
fix
rhayes777 Dec 16, 2024
d03ab4c
fix JAX imports
Jammy2211 Dec 18, 2024
64ec5e0
Merge branch 'main' into feature/over_sampling_refactor
Jammy2211 Dec 18, 2024
ad35938
remove Grid2DIRregularUniform
Jammy2211 Dec 18, 2024
5b08862
fix jax
Jammy2211 Dec 18, 2024
ac082a3
Merge branch 'main' into feature/over_sampling_refactor
Jammy2211 Dec 18, 2024
62b688f
remove point Hilbert funciton
Jammy2211 Dec 19, 2024
78bf573
added apply_over_sampling to Grid2D
Jammy2211 Dec 19, 2024
be571b5
remove OverSamplingDataset
Jammy2211 Dec 20, 2024
1d20dda
fix bug
Jammy2211 Dec 20, 2024
b4548cc
dataset changes
Jammy2211 Jan 13, 2025
18ca6ef
docstring
Jammy2211 Jan 14, 2025
a3c1454
final clean up
Jammy2211 Jan 15, 2025
5366bc9
Merge pull request #159 from Jammy2211/feature/over_sampling_refactor
Jammy2211 Jan 15, 2025
91371da
'Updated version in __init__ to 2025.1.18.7
rhayes777 Jan 18, 2025
42f688c
more conflicts with main resolved
Jammy2211 Jan 22, 2025
22fc982
shipwreck of a multi fits outputter works
Jammy2211 Feb 20, 2025
f850a52
black
Jammy2211 Feb 20, 2025
b5c80d0
docstrings
Jammy2211 Feb 21, 2025
b8a6397
review
Jammy2211 Feb 21, 2025
60ee228
Merge pull request #160 from Jammy2211/feature/images_refactor
Jammy2211 Feb 21, 2025
393d273
Merge branch 'main' into feature/jax_merge
Jammy2211 Mar 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions autoarray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from .dataset.interferometer.dataset import Interferometer
from .dataset.interferometer.simulator import SimulatorInterferometer
from .dataset.interferometer.w_tilde import WTildeInterferometer
from .dataset.over_sampling import OverSamplingDataset
from .dataset.dataset_model import DatasetModel
from .fit.fit_dataset import AbstractFit
from .fit.fit_dataset import FitDataset
Expand Down Expand Up @@ -68,14 +67,8 @@
from .structures.arrays.irregular import ArrayIrregular
from .structures.grids.uniform_1d import Grid1D
from .structures.grids.uniform_2d import Grid2D
from .operators.over_sampling.decorator import perform_over_sampling_from
from .operators.over_sampling.grid_oversampled import Grid2DOverSampled
from .operators.over_sampling.uniform import OverSamplingUniform
from .operators.over_sampling.iterate import OverSamplingIterate
from .operators.over_sampling.uniform import OverSamplerUniform
from .operators.over_sampling.iterate import OverSamplerIterate
from .operators.over_sampling.over_sampler import OverSampler
from .structures.grids.irregular_2d import Grid2DIrregular
from .structures.grids.irregular_2d import Grid2DIrregularUniform
from .structures.mesh.rectangular_2d import Mesh2DRectangular
from .structures.mesh.voronoi_2d import Mesh2DVoronoi
from .structures.mesh.delaunay_2d import Mesh2DDelaunay
Expand All @@ -98,4 +91,4 @@

conf.instance.register(__file__)

__version__ = "2024.11.6.1"
__version__ = "2025.1.18.7"
9 changes: 9 additions & 0 deletions autoarray/config/visualize/mat_wrap_2d.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ VectorYXQuiver: # wrapper for `plt.quiver()`: customize (y,x) vectors appea
linewidth: 5
pivot: middle
units: xy
DelaunayDrawer: # wrapper for `plt.fill()`: customize the appearance of Delaunay mesh's.
figure:
alpha: 0.7
edgecolor: k
linewidth: 0.0
subplot:
alpha: 0.7
edgecolor: k
linewidth: 0.0
VoronoiDrawer: # wrapper for `plt.fill()`: customize the appearance of Voronoi mesh's.
figure:
alpha: 0.7
Expand Down
32 changes: 2 additions & 30 deletions autoarray/config/visualize/plots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,11 @@

dataset: # Settings for plots of all datasets (e.g. ImagingPlotter, InterferometerPlotter).
subplot_dataset: true # Plot subplot containing all dataset quantities (e.g. the data, noise-map, etc.)?
data: false # Plot the individual data of every dataset?
noise_map: false # Plot the individual noise-map of every dataset?
signal_to_noise_map: false # Plot the individual signal-to-noise-map of every dataset?
over_sampling: false # Plot the over-sampling sub-size, used to evaluate light profiles, of every dataset?
over_sampling_non_uniform: false # Plot the over-sampling sub-size, used to evaluate non uniform grids, of every dataset?
over_sampling_pixelization: false # Plot the over-sampling sub-size, used to evaluate pixelizations, of every dataset?
imaging: # Settings for plots of imaging datasets (e.g. ImagingPlotter)
psf: false
fit: # Settings for plots of all fits (e.g. FitImagingPlotter, FitInterferometerPlotter).
subplot_fit: true # Plot subplot of all fit quantities for any dataset (e.g. the model data, residual-map, etc.)?
subplot_fit_log10: true # Plot subplot of all fit quantities for any dataset using log10 color maps (e.g. the model data, residual-map, etc.)?
all_at_end_png: true # Plot all individual plots listed below as .png (even if False)?
all_at_end_fits: true # Plot all individual plots listed below as .fits (even if False)?
all_at_end_pdf: false # Plot all individual plots listed below as publication-quality .pdf (even if False)?
data: false # Plot individual plots of the data?
noise_map: false # Plot individual plots of the noise-map?
signal_to_noise_map: false # Plot individual plots of the signal-to-noise-map?
Expand All @@ -31,33 +22,14 @@ fit_imaging: {} # Settings for plots of fits to imagi
inversion: # Settings for plots of inversions (e.g. InversionPlotter).
subplot_inversion: true # Plot subplot of all quantities in each inversion (e.g. reconstrucuted image, reconstruction)?
subplot_mappings: true # Plot subplot of the image-to-source pixels mappings of each pixelization?
all_at_end_png: true # Plot all individual plots listed below as .png (even if False)?
all_at_end_fits: true # Plot all individual plots listed below as .fits (even if False)?
all_at_end_pdf: false # Plot all individual plots listed below as publication-quality .pdf (even if False)?
data_subtracted: false # Plot individual plots of the data with the other inversion linear objects subtracted?
errors: false # Plot image of the errors of every mesh-pixel reconstructed value?
reconstruction_noise_map: false # Plot image of the noise of every mesh-pixel reconstructed value?
sub_pixels_per_image_pixels: false # Plot the number of sub pixels per masked data pixels?
mesh_pixels_per_image_pixels: false # Plot the number of image-plane mesh pixels per masked data pixels?
image_pixels_per_mesh_pixels: false # Plot the number of image pixels in each pixel of the mesh?
reconstructed_image: false # Plot image of the reconstructed data (e.g. in the image-plane)?
reconstruction: false # Plot the reconstructed inversion (e.g. the pixelization's mesh in the source-plane)?
regularization_weights: false # Plot the effective regularization weight of every inversion mesh pixel?
interferometer: # Settings for plots of interferometer datasets (e.g. InterferometerPlotter).
amplitudes_vs_uv_distances: false
phases_vs_uv_distances: false
uv_wavelengths: false
dirty_image: false
dirty_noise_map: false
dirty_signal_to_noise_map: false
fit_interferometer: # Settings for plots of fits to interferometer datasets (e.g. FitInterferometerPlotter).
subplot_fit_dirty_images: false # Plot subplot of the dirty-images of all interferometer datasets?
subplot_fit_real_space: false # Plot subplot of the real-space images of all interferometer datasets?
amplitudes_vs_uv_distances: false
phases_vs_uv_distances: false
uv_wavelengths: false
dirty_image: false
dirty_noise_map: false
dirty_signal_to_noise_map: false
dirty_residual_map: false
dirty_normalized_residual_map: false
dirty_chi_squared_map: false
subplot_fit_real_space: false # Plot subplot of the real-space images of all interferometer datasets?
77 changes: 67 additions & 10 deletions autoarray/dataset/abstract/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
import warnings
from typing import Optional, Union

from autoarray.dataset.over_sampling import OverSamplingDataset
from autoconf import cached_property

from autoarray.dataset.grids import GridsDataset

from autoarray import exc
from autoarray.mask.mask_1d import Mask1D
from autoarray.mask.mask_2d import Mask2D
from autoarray.structures.abstract_structure import Structure
from autoarray.structures.arrays.uniform_2d import Array2D
from autoconf import cached_property

from autoarray.operators.over_sampling import over_sample_util


logger = logging.getLogger(__name__)
Expand All @@ -24,7 +26,8 @@ def __init__(
data: Structure,
noise_map: Structure,
noise_covariance_matrix: Optional[np.ndarray] = None,
over_sampling: Optional[OverSamplingDataset] = OverSamplingDataset(),
over_sample_size_lp: Union[int, Array2D] = 4,
over_sample_size_pixelization: Union[int, Array2D] = 4,
):
"""
An abstract dataset, containing the image data, noise-map, PSF and associated quantities for calculations
Expand All @@ -45,6 +48,32 @@ def __init__(
over sampling calculations built in which approximate the 2D line integral of these calculations within a
pixel. This is explained in more detail in the `GridsDataset` class.

**Over Sampling**

If a grid is uniform and the centre of each point on the grid is the centre of a 2D pixel, evaluating
the value of a function on the grid requires a 2D line integral to compute it precisely. This can be
computationally expensive and difficult to implement.

Over sampling is a numerical technique where the function is evaluated on a sub-grid within each grid pixel
which is higher resolution than the grid itself. This approximates more closely the value of the function
within a 2D line intergral of the values in the square pixel that the grid is centred.

For example, in PyAutoGalaxy and PyAutoLens the light profiles and galaxies are evaluated in order to determine
how much light falls in each pixel. This uses over sampling and therefore a higher resolution grid than the
image data to ensure the calculation is accurate.

This class controls how over sampling is performed for 2 different types of grids:

- `lp`: A grids of (y,x) coordinates which aligns with the centre of every image pixel of the image data
and is used to evaluate light profiles for model-fititng.

- `pixelization`: A grid of (y,x) coordinates which again align with the centre of every image pixel of
the image data. This grid is used specifically for pixelizations computed via the `inversion` module, which
can benefit from using different oversampling schemes than the normal grid.

Different calculations typically benefit from different over sampling, which this class enables
the customization of.

Parameters
----------
data
Expand All @@ -56,10 +85,13 @@ def __init__(
noise_covariance_matrix
A noise-map covariance matrix representing the covariance between noise in every `data` value, which
can be used via a bespoke fit to account for correlated noise in the data.
over_sampling
The over sampling schemes which divide the grids into sub grids of smaller pixels within their host image
pixels when using the grid to evaluate a function (e.g. images) to better approximate the 2D line integral
This class controls over sampling for all the different grids (e.g. `grid`, `grids.pixelization).
over_sample_size_lp
The over sampling scheme size, which divides the grid into a sub grid of smaller pixels when computing
values (e.g. images) from the grid to approximate the 2D line integral of the amount of light that falls
into each pixel.
over_sample_size_pixelization
How over sampling is performed for the grid which is associated with a pixelization, which is therefore
passed into the calculations performed in the `inversion` module.
"""

self.data = data
Expand Down Expand Up @@ -93,15 +125,28 @@ def __init__(

self.noise_map = noise_map

self.over_sampling = over_sampling
self.over_sample_size_lp = (
over_sample_util.over_sample_size_convert_to_array_2d_from(
over_sample_size=over_sample_size_lp, mask=self.mask
)
)
self.over_sample_size_pixelization = (
over_sample_util.over_sample_size_convert_to_array_2d_from(
over_sample_size=over_sample_size_pixelization, mask=self.mask
)
)

@property
def grid(self):
return self.grids.uniform
return self.grids.lp

@cached_property
def grids(self):
return GridsDataset(mask=self.data.mask, over_sampling=self.over_sampling)
return GridsDataset(
mask=self.data.mask,
over_sample_size_lp=self.over_sample_size_lp,
over_sample_size_pixelization=self.over_sample_size_pixelization,
)

@property
def shape_native(self):
Expand Down Expand Up @@ -161,4 +206,16 @@ def trimmed_after_convolution_from(self, kernel_shape) -> "AbstractDataset":
kernel_shape=kernel_shape
)

dataset.over_sample_size_lp = (
dataset.over_sample_size_lp.trimmed_after_convolution_from(
kernel_shape=kernel_shape
)
)

dataset.over_sample_size_pixelization = (
dataset.over_sample_size_pixelization.trimmed_after_convolution_from(
kernel_shape=kernel_shape
)
)

return dataset
84 changes: 21 additions & 63 deletions autoarray/dataset/grids.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from typing import Optional, Union

from autoarray.dataset.over_sampling import OverSamplingDataset
from autoarray.mask.mask_2d import Mask2D
from autoarray.structures.arrays.uniform_2d import Array2D
from autoarray.structures.arrays.kernel_2d import Kernel2D
from autoarray.structures.grids.uniform_1d import Grid1D
from autoarray.structures.grids.uniform_2d import Grid2D

from autoarray.operators.over_sampling.uniform import OverSamplingUniform
from autoarray.inversion.pixelization.border_relocator import BorderRelocator
from autoconf import cached_property

Expand All @@ -15,7 +14,8 @@ class GridsDataset:
def __init__(
self,
mask: Mask2D,
over_sampling: OverSamplingDataset,
over_sample_size_lp: Union[int, Array2D],
over_sample_size_pixelization: Union[int, Array2D],
psf: Optional[Kernel2D] = None,
):
"""
Expand All @@ -28,11 +28,6 @@ def __init__(
which is used for most normal calculations (e.g. evaluating the amount of light that falls in an pixel
from a light profile).

- `non_uniform`: A grid of (y,x) coordinates which aligns with the centre of every image pixel of the image
data, but where their values are going to be deflected to become non-uniform such that the adaptive over
sampling scheme used for the main grid does not apply. This is used to compute over sampled light profiles of
lensed sources in PyAutoLens.

- `pixelization`: A grid of (y,x) coordinates which again align with the centre of every image pixel of
the image data. This grid is used specifically for pixelizations computed via the `inversion` module, which
can benefit from using different oversampling schemes than the normal grid.
Expand All @@ -49,16 +44,24 @@ def __init__(

Parameters
----------
mask
over_sampling
over_sample_size_lp
The over sampling scheme size, which divides the grid into a sub grid of smaller pixels when computing
values (e.g. images) from the grid to approximate the 2D line integral of the amount of light that falls
into each pixel.
over_sample_size_pixelization
How over sampling is performed for the grid which is associated with a pixelization, which is therefore
passed into the calculations performed in the `inversion` module.
psf
The Point Spread Function kernel of the image which accounts for diffraction due to the telescope optics
via 2D convolution.
"""
self.mask = mask
self.over_sampling = over_sampling
self.over_sample_size_lp = over_sample_size_lp
self.over_sample_size_pixelization = over_sample_size_pixelization
self.psf = psf

@cached_property
def uniform(self) -> Union[Grid1D, Grid2D]:
def lp(self) -> Union[Grid1D, Grid2D]:
"""
Returns the grid of (y,x) Cartesian coordinates at the centre of every pixel in the masked data, which is used
to perform most normal calculations (e.g. evaluating the amount of light that falls in an pixel from a light
Expand All @@ -70,38 +73,9 @@ def uniform(self) -> Union[Grid1D, Grid2D]:
-------
The (y,x) coordinates of every pixel in the data.
"""

return Grid2D.from_mask(
mask=self.mask,
over_sampling=self.over_sampling.uniform,
)

@cached_property
def non_uniform(self) -> Optional[Union[Grid1D, Grid2D]]:
"""
Returns the grid of (y,x) Cartesian coordinates at the centre of every pixel in the masked data, but
with a different over sampling scheme designed for

where
their values are going to be deflected to become non-uniform such that the adaptive over sampling scheme used
for the main grid does not apply.

This is used to compute over sampled light profiles of lensed sources in PyAutoLens.


This grid is computed based on the mask, in particular its pixel-scale and sub-grid size.

Returns
-------
The (y,x) coordinates of every pixel in the data.
"""

if self.over_sampling.non_uniform is None:
return None

return Grid2D.from_mask(
mask=self.mask,
over_sampling=self.over_sampling.non_uniform,
over_sample_size=self.over_sample_size_lp,
)

@cached_property
Expand All @@ -120,15 +94,9 @@ def pixelization(self) -> Grid2D:
-------
The (y,x) coordinates of every pixel in the data, used for pixelization / inversion calculations.
"""

over_sampling = self.over_sampling.pixelization

if over_sampling is None:
over_sampling = OverSamplingUniform(sub_size=4)

return Grid2D.from_mask(
mask=self.mask,
over_sampling=over_sampling,
over_sample_size=self.over_sample_size_pixelization,
)

@cached_property
Expand All @@ -151,36 +119,26 @@ def blurring(self) -> Optional[Grid2D]:
if self.psf is None:
return None

return self.uniform.blurring_grid_via_kernel_shape_from(
return self.lp.blurring_grid_via_kernel_shape_from(
kernel_shape_native=self.psf.shape_native,
)

@cached_property
def over_sampler_non_uniform(self):
return self.non_uniform.over_sampling.over_sampler_from(mask=self.mask)

@cached_property
def over_sampler_pixelization(self):
return self.pixelization.over_sampling.over_sampler_from(mask=self.mask)

@cached_property
def border_relocator(self) -> BorderRelocator:
return BorderRelocator(
mask=self.mask, sub_size=self.pixelization.over_sampling.sub_size
mask=self.mask, sub_size=self.over_sample_size_pixelization
)


class GridsInterface:
def __init__(
self,
uniform=None,
non_uniform=None,
lp=None,
pixelization=None,
blurring=None,
border_relocator=None,
):
self.uniform = uniform
self.non_uniform = non_uniform
self.lp = lp
self.pixelization = pixelization
self.blurring = blurring
self.border_relocator = border_relocator
Loading
Loading