Add centroid functionality to CubeFile library