aperture_photometry — ASTROSTACK photometry op

• 資料種類:image2d × keypoints → table

• 呼叫: import fullseye as fs; fs.ledger.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)(要直接呼叫實作,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);從台帳取用則 opsastrostack.get("aperture_photometry"))

用法

圓形孔徑 + 環形背景的測光(經典 CCD 測光)。

孔徑內的像素以次像素加權(supersample^2 點取樣),因此即使半徑不是整數,面積也不會階梯式跳變。背景是 r_inner〜r_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 每顆星一個 dict 的 list(table 詞彙)。鍵為 row / col / flux / background(每像素)/ 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 %

這不是 bug,而是像素化本身。閉合式是把連續高斯在圓上積分的值,而這裡累加的是「像素總通量 × 落在圓內的面積比例」。在孔徑邊緣的像素中,圓的內側(靠近中心)實際上較亮,以像素平均來代表必然偏少。誤差與 sigma 的平方成反比地減小(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) 時。

參考(範例資料、文獻)

• 範例資料目錄(下載 URL / 授權) —— 2-D 用 skimage.data(BSD/公有領域)加合成圖,3-D 給出真實資料源(Stanford/PDS 等)的下載 URL。

• 運算子來歷與參考文獻 —— 該運算子族所依據的研究/方法出處。

• 演算法的正典(作者、年份)與用途見上面的族使用指南。

可執行的範例(實際呼叫該運算子並已驗證的樣例)

• astro_stacking — py -3.11 examples/astro_stacking.py

• poc_astro_photometry — py -3.11 examples/poc_astro_photometry.py

• poc_exoplanet_transit — py -3.11 examples/poc_exoplanet_transit.py

• poc_nuclei_ploidy — py -3.11 examples/poc_nuclei_ploidy.py

• poc_real_sky_photometry — py -3.11 examples/poc_real_sky_photometry.py

型別可銜接的下一個運算子(可接受 table 作為輸入)

—

同類別(photometry)

star_detect · psf_fit


*Provenance: astrostack.py — ASTROSTACK 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*

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