implementation of the centroid method for the correction of turbulence