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

  • 2024-11-03: 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.4.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.4-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: confitti-0.2.4.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.4.tar.gz
Algorithm Hash digest
SHA256 8226774d9641ef89917d3065bdee183987e5ad2ba2f2b020657ff06e185608a8
MD5 f58eb9f26b6f102aa59546f2185a57db
BLAKE2b-256 b616337ed7963d920b5c48db757d4abb9e77f0d4779bf8a1f1e22c0bd2727e46

See more details on using hashes here.

File details

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

File metadata

  • Download URL: confitti-0.2.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 55c0b7616e0f8ce7390058e8f463201f4f7a118043c621a022eac763f5469461
MD5 2b0cb190c67fc52e4cda52ab9e398b43
BLAKE2b-256 f00e672f2228cd792020d3ffc479587c7a9906932bdbf83c1c73c5f65d5ad190

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