峰形图:分别标出各通道自己的拟合中心

- draw_zoom 给 R/G/B 各画一条同色虚线中心,标题显示通道间分歧与加权所用通道

- 合并后的单条中心不再掩盖通道之间对不上的事实
This commit is contained in:
starcells committed 2026-11-14 15:27:02 +08:00
1 parent 858135f17e
commit 3213a8b36c
1 file changed
+11
+11
View File
@@ -722,7 +722,18 @@ def draw_zoom(ax, spectrum: SpectrumData, line: dict, calibration, args,
ax.plot([peak["center_px"] - 0.5 * peak["fwhm_px"],
peak["center_px"] + 0.5 * peak["fwhm_px"]], [half, half],
color=hq.CHANNEL_COLORS[channel], lw=0.8, marker="|", ms=6)
# Mark every channel's own centre: the merged line centre can hide the fact
# that the channels disagree (a shoulder in one channel drags the average).
if np.isfinite(peak["center_px"]):
ax.axvline(peak["center_px"], color=hq.CHANNEL_COLORS[channel],
lw=0.8, ls="--", alpha=0.8)
ax.axvline(line["sensor_x_px"], color="#34495e", lw=0.9, ls=":")
spread = line.get("center_spread_px", float("nan"))
if np.isfinite(spread) and spread > 0:
used = "+".join(line.get("used_channels") or [])
ax.set_title(f"{line['id']} sensor x {line['sensor_x_px']:.2f} px "
f"channels disagree by {spread:.2f} px" +
(f" (centre from {used})" if used else ""), fontsize=9)
ax.set_xlim(low, high)
ax.set_xlabel("Sensor column / px")
ax.set_ylabel("Net ADU (baseline removed)")