Skip to content

Commit 042d686

Browse files
Jammy2211Jammy2211
authored andcommitted
perform fix by not linking state blurring grid to dataset grid
1 parent 7844633 commit 042d686

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

autoarray/dataset/grids.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,13 @@ def blurring(self):
9999
if self.psf is None:
100100
self._blurring = None
101101
else:
102+
103+
blurring_mask = self.mask.derive_mask.blurring_from(
104+
kernel_shape_native=self.psf.kernel.shape_native
105+
)
106+
102107
self._blurring = Grid2D.from_mask(
103-
mask=self.psf._state.blurring_mask,
108+
mask=blurring_mask,
104109
over_sample_size=1,
105110
)
106111

autoarray/operators/convolver.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
import warnings
1313

1414
from autoconf import conf
15-
from autoconf.fitsable import header_obj_from
16-
17-
from autoarray.structures.arrays.uniform_2d import AbstractArray2D
1815
from autoarray.structures.arrays.uniform_2d import Array2D
1916
from autoarray.structures.grids.uniform_2d import Grid2D
2017
from autoarray.structures.header import Header
@@ -123,10 +120,6 @@ class determines how masked real-space data are embedded into a padded array,
123120
)
124121
fft_shape = tuple(scipy.fft.next_fast_len(s, real=True) for s in full_shape)
125122

126-
# make fft_shape odd x odd to avoid wrap-around artefacts with even kernels
127-
# TODO : Fix this so it pads corrrectly internally
128-
fft_shape = tuple(s + 1 if s % 2 == 0 else s for s in fft_shape)
129-
130123
self.fft_shape = fft_shape
131124
self.mask = mask.resized_from(self.fft_shape, pad_value=1)
132125
self.blurring_mask = self.mask.derive_mask.blurring_from(
@@ -248,9 +241,9 @@ def use_fft(self):
248241
return self._use_fft
249242

250243
@property
251-
def normalized(self) -> "Kernel2D":
244+
def normalized(self) -> "Convolver":
252245
"""
253-
Normalize the Kernel2D such that its data_vector values sum to unity.
246+
Normalize the Convolver such that its data_vector values sum to unity.
254247
"""
255248
return Convolver(kernel=self.kernel, state=self._state, normalize=True)
256249

autoarray/plot/wrap/two_d/delaunay_drawer.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,9 @@ def draw_delaunay_pixels(
6262
"""
6363

6464
if pixel_values is None:
65-
raise ValueError(
66-
"pixel_values input to DelaunayPlotter are None and thus cannot be plotted."
67-
)
65+
pixel_values = np.zeros(shape=mapper.source_plane_mesh_grid.shape[0])
6866

69-
if pixel_values is not None:
70-
pixel_values = np.asarray(pixel_values)
67+
pixel_values = np.asarray(pixel_values)
7168

7269
if ax is None:
7370
ax = plt.gca()

0 commit comments

Comments
 (0)