The flatten function computes the trend and then divides it into the input flux to get the output flux. That implies that the trend comes back from the estimator centred on a value of 1, but for Huber spline it doesn't; all the Huber-spline trends for my data are coming back centred on 0. This inevitably produces wild excursions in the middle where the trend is close to zero, even when the shape of the trend is reasonable.
The flatten function computes the trend and then divides it into the input flux to get the output flux. That implies that the trend comes back from the estimator centred on a value of 1, but for Huber spline it doesn't; all the Huber-spline trends for my data are coming back centred on 0. This inevitably produces wild excursions in the middle where the trend is close to zero, even when the shape of the trend is reasonable.