Geometric.Peaklike#
Geometric.Peaklike.py
- judge_peaklike_segment(x, y, mi, points, segments, entire_height, i, debug=False)#
Judge if the segment at index i is peak-like.
- Parameters:
x (array-like) – The x-values of the data.
y (array-like) – The y-values of the data.
mi (MappingInfo) – The mapping information.
points (list of int) – The breakpoints of the segments.
segments (list of Linesegment) – The list of line segments.
entire_height (float) – The entire height between the highest and lowest segments.
i (int) – The index of the segment to judge.
debug (bool, optional) – If True, enables debug mode for more verbose output.
- Returns:
If the segment is peak-like, returns (points, segments, j, k, new y), where j and k are the indices of the breakpoints around the peak-like segment, and new_y is the modified y-values. If not peak-like, returns None.
- Return type:
tuple or None
- check_peaklike_segment(x, y, mt, points, segments, debug=False)#
Check if there is a peak-like segment in the data. :param x: The x-values of the data. :type x: array-like :param y: The y-values of the data. :type y: array-like :param mt: The mapping information. :type mt: MappingInfo :param points: The breakpoints of the segments. :type points: list of int :param segments: The list of line segments. :type segments: list of Linesegment :param debug: If True, enables debug mode for more verbose output. :type debug: bool, optional
- Returns:
If a peak-like segment is found, returns (points, segments, j, k, new_y, sign), where j and k are the indices of the breakpoints around the peak-like segment, new_y is the modified y-values, and sign is +1 for positive peak-like and -1 for negative peak-like. If no peak-like segment is found, returns (None, 0).
- Return type:
tuple or (None, 0)