I have several time series where there sometimes are abrupt continuous shifts in the data (see example below).
Specifically these are measurements so the reference level (RL) must have changed. E.g., in the plot attached the RL could have been about 345 before the shift and after the shift it is ~359.
I want to develop an automatic method to find both the index (time) of the shift and the magnitude of the shift (the absolute values of the RL don't interest me and there is no way for me to know them).
I tried the simple way of calculating the diffs and taking the largest one and it works in the clear example below but it doesn't work in more nuanced or noisy cases.
I write in python. But also just the method is fine.
