aperture_photometry — ASTROSTACK photometry op

Data kinds: image2d × keypointstable

Call: import astrostack; astrostack.aperture_photometry(image, centers, r_aperture=5.0, r_inner=8.0, r_outer=12.0, read_sigma=0.0, gain=1.0, supersample=8) (or opsastrostack.get("aperture_photometry"))

Usage

Photometry with a circular aperture and an annular background (classical CCD photometry).

> The detailed description below is the original text — the summary and the headings are translated.

開口内の画素は副画素で重み付けする(`supersample^2` 点の標本化)ので、

半径が整数でなくても面積が階段状に飛ばない。背景は `r_innerr_outer`

の環の中央値(隣の星が環に入っても引きずられない)。

フラックスは `sum(w * (I - background))`、S/N は古典的な CCD 方程式

(Merline & Howell, *Exp. Astron.* 6, 163 (1995); Howell, *Handbook of CCD

Astronomy*)::

SNR = F / sqrt(F/gain + A*(B/gain + read_sigma^2))

ここで `A は開口の実効画素数、B は背景レベル。read_sigma=0` かつ

`gain=1 なら純 Poisson の F/sqrt(F + A*B)` に落ちる。

Returns 各星 1 つの dict の `list(table 語彙)。キーは row` /

`col / flux / background(1 画素あたり)/ area_px`(開口の実効

画素数)/ `n_annulus / snr / flux_error / mag_instrumental`

(`-2.5 log10(flux)、フラックスが非正なら nan`)。

Ground truth it reproduces(`tests/test_astrostack.py`): ノイズ無しの

ガウシアン星(フラックス 10000 e-)に対して、半径 `r` の開口が拾う割合は

`1 - exp(-r^2/(2 sigma^2))`。開口を広げれば厳密に一致する ——

`r = 8 sigma` では sigma = 1.0 / 1.5 / 2.0 / 3.0 のどれでも

測定 10000.00000、誤差 -0.0000 %。

小さい開口には系統的な負のずれが残る、という正直な話。 `r = 3 sigma`

では実測が理論を下回る::

sigma = 1.0 -> 9798.57 / 9888.91 = -0.914 %

sigma = 1.5 -> 9850.70 / 9888.91 = -0.386 %

sigma = 2.0 -> 9868.61 / 9888.91 = -0.205 %

sigma = 3.0 -> 9879.86 / 9888.91 = -0.092 %

これはバグではなく画素化そのもの。閉形式は連続なガウシアンを円で積分した

値だが、こちらは「画素の総フラックス × 円に入る面積の割合」を足している。

開口の縁にある画素では、円の内側(中心寄り)の方が実際には明るいので、

画素平均で代表すると必ず少なく出る。誤差が `sigma` の 2 乗に反比例

して減る(1.0→3.0 で 10 倍)のがその証拠で、標本化が良くなるほど画素平均と

真の分布の差が縮む。開口を広げれば縁の画素の寄与自体が消えるので誤差も消える。

`supersample は**円の面積**の離散化だけを直す(実測: r=4.5` で

`pi r^2 に対し相対 1.6e-3、r=3` で 2.5e-4)。上のずれとは別の話で、

上げても縁の画素平均の偏りは消えない。

Raises `ValueError: 半径の順序が `0 < r_aperture <= r_inner <

r_outer`` でない / *supersample* が 1 未満 / *gain* が非正 /

*centers* が `(N, 2)` でない場合。

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

astro_stackingpy -3.11 examples/astro_stacking.py

poc_astro_photometrypy -3.11 examples/poc_astro_photometry.py

poc_nuclei_ploidypy -3.11 examples/poc_nuclei_ploidy.py

Ops the type connects to (they accept table as input)

Same category (photometry)

star_detect · psf_fit


*Provenance: astrostack.py — ASTROSTACK operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.