Least squares fit of a surface to a 3D cloud of points in Python (with ridiculous application)