Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`shift_x_y_to_zk1_2_wavediff()` function has dimensional inconsistencies

オープン
#175 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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!

主要言語
Python
スター
24
フォーク
10
平均マージ
2日 13分
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CosmoStat/wf-psf のほかの issue

CosmoStat/wf-psf の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。