Serendipitous discovery of multi-layered PSF bug

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
numpy, python
領域
data, testing

調査の方向性

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.

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

説明

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.

主要言語
Python
スター
42
フォーク
30
平均マージ
2日 22時間
マージ済み PR(30日)
7

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

AstarVienna/ScopeSim のほかの issue

AstarVienna/ScopeSim の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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