-
Notifications
You must be signed in to change notification settings - Fork 7
feature/psf_centering_fix #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -723,14 +723,18 @@ def convolved_image_from( | |||||||
| blurred_image_full = xp.fft.irfft2( | ||||||||
| fft_psf * fft_image_native, s=fft_shape, axes=(0, 1) | ||||||||
| ) | ||||||||
| ky, kx = self.native.array.shape # (21, 21) | ||||||||
| off_y = (ky - 1) // 2 | ||||||||
| off_x = (kx - 1) // 2 | ||||||||
|
|
||||||||
| # Crop back to mask_shape | ||||||||
| start_indices = tuple( | ||||||||
| (full_size - out_size) // 2 | ||||||||
| for full_size, out_size in zip(full_shape, mask_shape) | ||||||||
| blurred_image_full = xp.roll( | ||||||||
| blurred_image_full, shift=(-off_y, -off_x), axis=(0, 1) | ||||||||
| ) | ||||||||
|
|
||||||||
| start_indices = (off_y, off_x) | ||||||||
|
|
||||||||
| blurred_image_native = jax.lax.dynamic_slice( | ||||||||
| blurred_image_full, start_indices, mask_shape | ||||||||
| blurred_image_full, start_indices, image.mask.shape | ||||||||
| ) | ||||||||
|
Comment on lines
736
to
738
|
||||||||
|
|
||||||||
| # Return slim form; optionally cast for downstream stability | ||||||||
|
|
@@ -806,6 +810,10 @@ def convolved_mapping_matrix_from( | |||||||
| ndarray of shape (N_pix, N_src) | ||||||||
| Convolved mapping matrix in slim form. | ||||||||
| """ | ||||||||
| # ------------------------------------------------------------------------- | ||||||||
| # NumPy path unchanged | ||||||||
| # ------------------------------------------------------------------------- | ||||||||
|
|
||||||||
| # ------------------------------------------------------------------------- | ||||||||
| # NumPy path unchanged | ||||||||
| # ------------------------------------------------------------------------- | ||||||||
|
Comment on lines
817
to
819
|
||||||||
| # ------------------------------------------------------------------------- | |
| # NumPy path unchanged | |
| # ------------------------------------------------------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The inline comment
# (21, 21)appears to be an example value for demonstration purposes, but it may be unclear to future readers that this is not a constant value. Consider clarifying this comment to indicate it's an example, e.g.,# e.g., (21, 21)or removing it if it's not needed.