sgnts.transforms.threshold
¶
Threshold
dataclass
¶
Bases: TSTransform
Only allow data above or below a threshold to pass. data will otherwise be marked as gap.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
threshold
|
float
|
float, the absolute value threshold above which to allow data to pass |
float('+inf')
|
invert
|
bool
|
bool, If False, only data above a threshold will pass. If True: only data below a threshold will pass |
False
|
startwn
|
int
|
int, the number of samples ahead of the crossing to allow data to pass |
0
|
stopwn
|
int
|
int, the number of samples after the crossing to allow data to pass |
0
|
Source code in sgnts/transforms/threshold.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
__split_above_threshold(buffer, threshold, start_window=0, stop_window=0)
¶
Find subslices in buffer whose data are above threshold, along with start_window samples ahead of and stop_window samples after the crossing.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
buffer
|
SeriesBuffer
|
SeriesBuffer, the buffer from which to extract subslices |
required |
threshold
|
float
|
float, the crossing threshold |
required |
start_window
|
int
|
int, the number of samples ahead of the crossing to allow data to pass |
0
|
stop_window
|
int
|
int, the number of samples after the crossing to allow data to pass |
0
|
Returns:
Type | Description |
---|---|
list[TSSlice]
|
list[TSSlice], a list of TSSlices whose data value crossed a threshold, |
list[TSSlice]
|
along with a window around the crossing |
Source code in sgnts/transforms/threshold.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|