Skip to content

Commit df1f2d5

Browse files
Jammy2211Copilot
andauthored
Update autoarray/operators/convolver.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 042d686 commit df1f2d5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

autoarray/operators/convolver.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,13 @@ def use_fft(self):
244244
def normalized(self) -> "Convolver":
245245
"""
246246
Normalize the Convolver such that its data_vector values sum to unity.
247+
248+
A copy of the kernel is used to avoid mutating the original kernel instance,
249+
and no existing state is reused so that any cached FFTs are recomputed for
250+
the normalized kernel.
247251
"""
248-
return Convolver(kernel=self.kernel, state=self._state, normalize=True)
252+
kernel_copy = self.kernel.copy()
253+
return Convolver(kernel=kernel_copy, state=None, normalize=True)
249254

250255
@classmethod
251256
def no_blur(cls, pixel_scales):

0 commit comments

Comments
 (0)