While working on #908 I ran into test_ConstPSF.TestGetKernel.test_kernel_is_scale_properly_if_cdelts_differ(), which was failing on that branch in one of three parameter combinations, because the resulting kernel was only a single pixel, which got squeezed into a scalar. This led me to investigate what's going on with that test in general, with slightly worrying results:
No rescaling
The baseline case of factor = 1 produces the kind of image you'd expect:
Scaling up
With factor = 1/3, the FOV's pixel scale is reduced, thus the PSF kernel is interpolated to a larger image. Here's where it starts getting weird, the center of the PSF is shifted:
Scaling down
The final case of factor = 5, which should scale the PSF down to a smaller image, produces the most interesting result, which unfortunately cannot be plotted, as the kernel array becomes just array([[nan]]). To be fair, scaling the PSF down to a single pixel is somewhat nonsensical, but then I'd expect an error and not a silent NaN.
For now, I'm adding an additional check to that test case in #908, verifying that the index of the maximum value in the resulting kernel is in the center pixel, which makes the 1/3 case now xfail, while the 5 case xfails because the single-element 2D array becomes a scalar.
While working on #908 I ran into
test_ConstPSF.TestGetKernel.test_kernel_is_scale_properly_if_cdelts_differ(), which was failing on that branch in one of three parameter combinations, because the resulting kernel was only a single pixel, which got squeezed into a scalar. This led me to investigate what's going on with that test in general, with slightly worrying results:No rescaling
The baseline case of
factor = 1produces the kind of image you'd expect:Scaling up
With
factor = 1/3, the FOV's pixel scale is reduced, thus the PSF kernel is interpolated to a larger image. Here's where it starts getting weird, the center of the PSF is shifted:Scaling down
The final case of
factor = 5, which should scale the PSF down to a smaller image, produces the most interesting result, which unfortunately cannot be plotted, as the kernel array becomes justarray([[nan]]). To be fair, scaling the PSF down to a single pixel is somewhat nonsensical, but then I'd expect an error and not a silent NaN.For now, I'm adding an additional check to that test case in #908, verifying that the index of the maximum value in the resulting kernel is in the center pixel, which makes the
1/3case now xfail, while the5case xfails because the single-element 2D array becomes a scalar.