Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

`shift_x_y_to_zk1_2_wavediff()` function has dimensional inconsistencies

Abierto
#175 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
35/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
python

Línea de trabajo

Read src/wf_psf/utils/preprocessing.py around shift_x_y_to_zk1_2_wavediff() and src/wf_psf/utils/centroids.py around compute_zernike_tip_tilt. Trace the displacement units through both functions and clarify the intended physics and Zernike wavediff convention. Done means the arctan input and conversion path are dimensionally consistent, with the affected behavior verified.

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

Descripción

question

Hi @tobias-liaudat,

There seems to be a dimensional analysis issue in the code you originally wrote. Since you're most familiar with the intended physics here, could you take a look?

In the code snippet below, the function takes arctan() of a quantity with units [1/m], which is dimensionally incorrect:

https://github.com/CosmoStat/wf-psf/blob/7c4b51564df1f1255597471b08bb312806c6ea55/src/wf_psf/utils/preprocessing.py#L39-L44

Moreover, this function is called incompute_zernike_tip_tilt. There, the arg passed in is the displacement pixel shift multiplied by pixel_sampling=12e-6 m, which will do the conversion from the [pixel] units to [m].

https://github.com/CosmoStat/wf-psf/blob/7c4b51564df1f1255597471b08bb312806c6ea55/src/wf_psf/utils/centroids.py#L87

But, then this is undone by division by reference_pix_sampling = 12e-6 in shift_x_y_to_zk1_2_wavediff in the arctan function above. Both values are the same, making this conversion roundtrip unnecessary.

Just to add: this pattern also appears in the original code from last year:

   current_shifts = centroid_calc.return_shifts()  # In [pixel]

    dx = reference_shifts[1] - current_shifts[1]  # In [pixel]
    dy = reference_shifts[0] - current_shifts[0]  # In [pixel]

    z1_wavediff = shift_x_y_to_zk1_2_wavediff(dx * pixel_sampling)  # Input in [m]
    z2_wavediff = shift_x_y_to_zk1_2_wavediff(dy * pixel_sampling)  # Input in [m]

    return (
        z1_wavediff,
        z2_wavediff,
    )  # Output in Zernike coefficients in wavediff convention

Could you help clarify the intended physics and suggest how to make this dimensionally consistent? I can think of a couple of approaches, but you're the expert and so I'd value your input. Thanks!

Lenguaje dominante
Python
Estrellas
24
Forks
10
Merge medio
2 d 13 min
PR fusionados (30 d)
2

Preparar el entorno

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 CosmoStat/wf-psf

Todos los issues de CosmoStat/wf-psf

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.