Serendipitous discovery of multi-layered PSF bug

Abierto
#911 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
numpy, python
Área
data, testing

Línea de trabajo

Start with test_ConstPSF.TestGetKernel.test_kernel_is_scale_properly_if_cdelts_differ(), which is already being extended in #908, and inspect the PSF kernel scaling path it exercises. Reproduce the factor = 1/3 and factor = 5 cases and trace the shifted maximum and single-pixel NaN. Done means the scaled kernel is centered and the single-pixel case reports a clear error instead of silently returning NaN.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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:

Image

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:

Image

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.

Lenguaje dominante
Python
Estrellas
42
Forks
30
Merge medio
2 d 22 h
PR fusionados (30 d)
7

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de AstarVienna/ScopeSim

Todos los issues de AstarVienna/ScopeSim

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.