Skip to main content

Fit conic sections (ellipse, parabola, hyperbola) to a set of 2d points

Project description

🎊 Confitti 🎊 - for Conics Fitting

Fit conic sections (ellipse, parabola, hyperbola) to a set of points

See the presentation

What's new

  • 2026-03-13: Version 0.2.4 released. Updated build process to uv and added grant acknowledgements
  • For more details, see the full change log.

Installation

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

Usage

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 also shows how to save the best-fit parameters to a file.
  • demo04-other-proplyd.ipynb is a second example application to a different bow shock, which turns out very differently because the best-fit arc is an ellipse, rather than a hyperbola
  • demo05-quadrants.ipynb tests that the code can handle axis orientations in all four quadrants and close to the wrap angle of 360 degrees
  • demo06-read-save-files.ipynb demonstrates how to read in the multiple saved files from previous fits.

Prior art

This is the successor project to circle-fit

Some of the literature on the topic of fitting conic sections to points is described here.

Funding

We gratefully acknowledge financial support provided by Dirección General de Asuntos del Personal Académico, Universidad Nacional Autónoma de México, through grant IN109823 of the ‘Programa de Apoyo a Proyectos de Investigación e Inovación Tecnológica’.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

confitti-0.2.5.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

confitti-0.2.5-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file confitti-0.2.5.tar.gz.

File metadata

  • Download URL: confitti-0.2.5.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for confitti-0.2.5.tar.gz
Algorithm Hash digest
SHA256 3a2699697338f5370e55f7ddfa0370de4ef5620704d422c1dec5c507963b73c1
MD5 eef4c8351ba92d5e6573273b268cf96a
BLAKE2b-256 f1a2f4d63f18b45cf70d41dbdaeabd458b041f94ca02d37a81bc3ea4b7a6cad5

See more details on using hashes here.

File details

Details for the file confitti-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: confitti-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for confitti-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5ff742dbb7663fcfc39bccc5a6228a61c1e462e5a5dc55921cdf669a04a19b1a
MD5 50e063f8fd2337344dbc1e13239da99a
BLAKE2b-256 cca04c77b37588cc00d8079413c3735398a8ac73b01daf6f98cc7986b7d42d7f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page