fit_ellipse.py for production