diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2021-01-15 10:31:42 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2021-01-15 10:31:42 +0100 |
commit | 93e518db1c3b5536fc1b37a739101aaaf3e95e2b (patch) | |
tree | d9ef7978d6e5be96a9c9773033d5a50f3085f5b5 | |
parent | 0480bdd2cf7793a8801858f404c01c54189534cd (diff) |
Remove useless trailing changepoint
-rwxr-xr-x | bin/msp430-etv | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/msp430-etv b/bin/msp430-etv index 439d694..61447b7 100755 --- a/bin/msp430-etv +++ b/bin/msp430-etv @@ -147,6 +147,10 @@ class PELT: prev_val = num_bkpts middle_of_plateau = longest_start + (longest_start - longest_start) // 2 changepoints = np.array(changepoints_by_penalty[middle_of_plateau]) + + if len(changepoints) and changepoints[-1] == len(self.signal): + changepoints = changepoints[:-1] + return changepoints |