spectrochempy.PeakFindingResult
- class PeakFindingResult(peaks, properties=None, *, sample_index=None, sample_position=None, sample_height=None)[source]
Structured result returned by
find_peaks.- Parameters
peaks (NDDataset or None) – Dataset containing identified peak positions and heights.
properties (dict or None) – Peak properties returned by
scipy.signal.find_peaks.
Notes
The object is intentionally dependency-light. It exposes Python-native table helpers and does not require pandas.
Attributes Summary
Return a dependency-light tabular view of the detected peaks.
Methods Summary
to_csv(path, *[, delimiter])Write peak information to a CSV file.
to_dict()Return peak information as a list of dictionaries.
Attributes Documentation
- peaks
- properties
- sample_index
- sample_position
- sample_height
- table
Return a dependency-light tabular view of the detected peaks.
Methods Documentation
- to_csv(path, *, delimiter=',')[source]
Write peak information to a CSV file.
- Parameters
path (str or pathlib.Path) – Destination path.
delimiter (str, default=’,’) – CSV delimiter.
- Returns
pathlib.Path – The written path.
- to_dict()[source]
Return peak information as a list of dictionaries.
Each dictionary contains
index(the row identifier), refinedpositionandheight, available discrete sample fields, plus any per-peak properties whose length matches the number of detected peaks. Values keep their native units when they are unit-bearing quantities.
Examples using spectrochempy.PeakFindingResult