Skip to content

affanadly/Ellipse-Fit-Uncertainty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ellipse Fitting with Errors and Confidence Region

Python library for fitting a 2D ellipse data, estimate the errors for the physical ellipse parameters, and calculate the confidence interval/area. This library was developed for the analysis of VLBI bowshock maser data in tracking a protostellar bowshock.

Process

  1. Ellipse fitting using numerically stable direct least squares based on Fitzgibbon, Pilu, & Fisher, 1996 and Halir & Flusser, 1998.
  2. Estimation of errors by minimizing the $\chi^2$ function based on McDonald, 2014.
  3. Converting the fit parameters to the usual ellipse parameters while propagating the error using the uncertainties package.
  4. Calculation of confidence interval/area using the two-norm distance approximation with Gaussianly-distributed residuals based on O'Leary & Zsombor-Murray, 2004.

Other convienence functions:

  • Generating an ellipse with noise
  • Generating coordinates of the ellipse based on fit parameters
  • Generating a matplotlib Ellipse patch based on fit parameters

Related publication

The code was developed for fitting of double bowshock maser features in the high-mass protostar AFGL 5142 (See Rosli et al., 2023).

Usage

Add the ellipseunc.py in the working directory and import in the Python code using

from ellipseunc import *

For detailed descriptions of the functions, refer to the derivation.ipynb.

References

About

Ellipse fitting with parameter uncertainties, meant for bowshock maser fitting.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published