taubin_circle_fit#

ctapipe.image.muon.taubin_circle_fit(x, y, mask, weights=None, r_initial=None, xc_initial=None, yc_initial=None)[source]#

Perform a Taubin circle fit with weights (optional).

The minimized loss function in this method tends to maximize the radius of the ring, whereas using a simple ring equation systematically results in a smaller radius. Adding weights mitigates both effects and yields a more accurate fit.

Parameters:
xarray-like or astropy.units.Quantity

x-coordinates of the points.

yarray-like or astropy.units.Quantity

y-coordinates of the points.

maskarray-like of bool

Boolean mask indicating which pixels survive the cleaning process.

weightsarray-like of float, optional

Weights for the points. If not provided, all points are assigned equal weights (1).

r_initialastropy.units.Quantity, optional

Initial guess for the radius of the circle. If not provided, it defaults to 1.1 deg. 1.1 deg. is the approximate Cherenkov photon angle produced by muons in the atmosphere at La Palma altitude (2426 m a.s.l.), with momentum greater than 15 GeV.

xc_initialastropy.units.Quantity, optional

Initial guess for the x-coordinate of the circle center. Defaults to 0.

yc_initialastropy.units.Quantity, optional

Initial guess for the y-coordinate of the circle center. Defaults to 0.

Returns:
radiusastropy.units.Quantity

Fitted radius of the circle.

center_xastropy.units.Quantity

Fitted x-coordinate of the circle center.

center_yastropy.units.Quantity

Fitted y-coordinate of the circle center.

radius_errastropy.units.Quantity

Fitted radius of the circle error.

center_x_errastropy.units.Quantity

Fitted x-coordinate of the circle center error.

center_y_errastropy.units.Quantity

Fitted y-coordinate of the circle center error.

Raises:
OptionalDependencyMissing

If the iminuit package is not installed.

Notes

The Taubin circle fit minimizes a specific loss function that balances the squared residuals of the points from the circle with the weights. This method is particularly useful for fitting circles to noisy data.

References

  • Barcelona_Muons_TPA_final.pdf (slide 6)