From d03b4b0979567a1f55baf6984532e4598664242a Mon Sep 17 00:00:00 2001 From: StarCells Date: Sat, 14 Nov 2026 16:23:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E8=A1=A8=E6=94=B9=E7=94=A8=E5=8D=8A?= =?UTF-8?q?=E9=AB=98=E5=A4=84=E7=9A=84=E5=B7=A6=E5=8F=B3=E5=B1=95=E5=AE=BD?= =?UTF-8?q?=EF=BC=8810%=20=E5=A4=84=E5=AE=B9=E6=98=93=E8=A2=AB=E9=82=BB?= =?UTF-8?q?=E8=BF=91=E7=BB=93=E6=9E=84=E6=B1=A1=E6=9F=93=E6=88=90=20nan=20?= =?UTF-8?q?=E6=88=96=E5=81=87=E6=AF=94=E5=80=BC=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- peak_finder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/peak_finder.py b/peak_finder.py index 4e06e93..b8c62c3 100644 --- a/peak_finder.py +++ b/peak_finder.py @@ -837,7 +837,7 @@ def _clean_output(directory: Path) -> None: def ten_percent_widths(spectrum: "SpectrumData", line: dict, - fraction: float = 0.10, + fraction: float = 0.50, limit_px: float = float("nan")) -> dict: """Left and right half-widths where the profile falls to ``fraction`` of the peak. @@ -1516,7 +1516,7 @@ def run(args) -> int: limit = 0.5 * min(gaps) if gaps else float("nan") shapes.append(ten_percent_widths(spectrum, line, limit_px=limit)) write_csv(result["output"] / "peak_summary.csv", - ["id", "x_px", "left_10pct_px", "right_10pct_px", "ratio_right_over_left"], + ["id", "x_px", "left_half_px", "right_half_px", "ratio_right_over_left"], ([line["id"], _num(line["sensor_x_px"], 4), _num(shape["left_px"], 4), _num(shape["right_px"], 4), _num(shape["ratio"], 4)] for line, shape in zip(lines, shapes))) @@ -1543,7 +1543,7 @@ def run(args) -> int: tell(f"{len(lines)} line(s) from {total} channel peak(s); {len(selected)} selected.") if lines: tell("") - tell("10% height widths (asymmetry = right / left):") + tell("half-height widths (asymmetry = right / left):") tell(f"{'id':6s}{'x_px':>11s}{'left':>9s}{'right':>9s}{'ratio':>8s}") for line, shape in zip(lines, shapes): def _shape(value):