Skip to content

Fitting conic sections to data: Parabolae, ellipses, and hyperbolae

License

Notifications You must be signed in to change notification settings

dawg-at-irya/conics-talk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fitting parabolas and other conic sections to a set of points

William Henney - DAWGI Meeting - 2024-02-28

Abstract

I will demonstrate a method for finding the orientation of the symmetry axis of an observed bow shock or other curved emission arc. The method consists in fitting a parabola (or ellipse, or hyperbola) to a set of points. A simple trick allows a suitable objective function to be defined without needing to explicitly calculate the distance of the points from the curve. The objective function can be minimized to find the best-fit conic section, and MCMC can be used to check for the presence of multiple local minima.

Ajuste de parábolas y otras secciones cónicas a un conjunto de puntos

Voy a demostrar un método para encontrar la orientación del eje de simetría de un arco de emisión observado. El método consiste en ajustar una parábola (o elipse, o hipérbola) a un conjunto de puntos. Un truco simple permite definir una función objetivo adecuada sin necesidad de calcular explícitamente la distancia de los puntos a la curva. La función objetivo se puede minimizar para encontrar la mejor sección cónica de ajuste, y MCMC se puede utilizar para comprobar la presencia de múltiples mínimos locales.

Python package

Animation

Animated GIF of presentation

Individual slides

Title page

Fitting conic sections to data: Parabolae, ellipses, and hyperbolae

001

What?

002

From image … to points … to fitted curve

I can give another talk later on Stage 1

003

Why?

004

Curved emission arcs in H II regions

005

Also in infrared …

And radio wavelengths too

006

… and not just in Orion

007

By fitting a conic section, we can measure

For instance, we may wish to know the orientation in order to identify the exciting source, or to compare with the magnetic field direction, etc

008

But what if the shape is not a conic section?

009

How?

010

Algebraic distance versus geometric distance

011

Disadvantages of algebraic distance

No clear intuitive interpretation of A, B, C, etc

012

Geometric Euclidean distance

013

Yes there is a simpler way

014

This can be generalized to other forms of conics

Focal radius r and directrix distance d are trivial to calculate

015

If this is so clever, why did nobody else do it?

016

Implementation: my confit python package

lmfit is for when astropy.modeling isn’t enough

The objective function calculates a vector of residuals, for which the Minimizer tries to minimize the sum of squares

By default it uses a Levenberg-Marquardt algorithm

017

Examples

018

A simple curve with 7 points

019

General conic versus parabola

020

Unwanted spurious solutions

021

Back to normal!

022

With freely varying eccentricity we still have issues

This is a case where the covariance matrix underestimates the true uncertainties

Better to use a parabola when the number of data points is small

023

Test on real data

024

A success

025

But some edge cases still need to be finessed

026

Conclusions

027

Fitting conic sections can be useful, easy, and fun

028

About

Fitting conic sections to data: Parabolae, ellipses, and hyperbolae

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published