Fit conic sections (ellipse, parabola, hyperbola) to a set of points
See the presentation
pip install confitti
or
uv pip install confitti
will install the package plus the required dependencies (numpy, scipy, lmfit).
Optional dependencies, which are used in the example notebooks, may be pip-installed separately:
- emcee for MCMC sampling
- matplotlib, seaborn, and corner for plotting
- astropy and regions for dealing with celestial coordinates
See the example jupyter notebooks in the notebooks directory. For example,
- demo01-basic.ipynb demonstrates basic usage: finding the best-fit parabola (or general conic) to a set of (x, y) points
- demo02-emcee.ipynb explores uncertainty in the parameters of the best-fit curve by means of mcmc
- demo03-proplyd.ipynb is an example application to real astronomical data (HST image of a bow shock in the Orion Nebula)
This is the successor project to circle-fit
Some of the literature on the topic of fitting conic sections to points is described here.