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)*Provenance: astrostack.py — ASTROSTACK 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.