calc_sd_poly function

Perform a polynomial fit, subtract and return the standard deviation of the residuals.