Jonathan, Sure, that approach can work. But it isn't terribly efficient. It would however be less computationally intensive if I detrend first. That's the first step. So if you have a notion on a least squares linear fit line, that would be most welcome.