mioXpektron.detection.peak_analysis

Functions

load_and_measure_peaks_polars(path, mz_min, ...)

Read ToF-SIMS TXT with columns [Channel, m/z, Intensity], filter m/z range, detect peaks, and compute [m/z_center, FWHM, height].

mioXpektron.detection.peak_analysis.load_and_measure_peaks_polars(path, mz_min, mz_max, min_height=None, prominence=None, distance_pts=None, save_csv=None)[source]

Read ToF-SIMS TXT with columns [Channel, m/z, Intensity], filter m/z range, detect peaks, and compute [m/z_center, FWHM, height].

Parameters:
  • path (str) – Path to TXT (tab-delimited). Lines starting with ‘#’ are ignored.

  • mz_min (float) – m/z selection window (inclusive).

  • mz_max (float) – m/z selection window (inclusive).

  • min_height (float or None) – Minimum peak height for detection (scipy find_peaks ‘height’).

  • prominence (float or None) – Peak prominence threshold (recommended for robustness).

  • distance_pts (int or None) – Minimum horizontal distance (in data points) between neighboring peaks.

  • save_csv (str or None) – If provided, save the results to this CSV path.

Returns:

Polars DataFrame with columns

Return type:

‘m/z’, ‘FWHM’, ‘height’