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):