Improve algorithm to detect subscans for bidirectional scans
- Detect changes in the absolute value of second derivative (instead of the derivative of the absolute value of first derivative)
- Since this can lead to start/stop being one index apart (i.e
start = stop - 1
), I no longer useenergy[stop - 1] - energy[start]
to detect if the energy is increasing. I instead of withenergy_slope[stop - 2] > 0
.
Honestly, I don't get why it works but it does both for the BM23 scans and the test case (previous algo in squares, new algo in stars, different colors means different detected subscans):
BM23 data | Test data | |
---|---|---|
Increasing | ||
Decreasing |
Notice how the previous algo was one off for the test data.
Edited by Loic Huder