# fit_first_and_second_harmonics¶

photutils.isophote.fit_first_and_second_harmonics(phi, intensities)[source]

Fit the first and second harmonic function values to a set of (angle, intensity) pairs.

This function is used to compute corrections for ellipse fitting:

$f(phi) = y0 + a1*\sin(phi) + b1*\cos(phi) + a2*\sin(2*phi) + b2*\cos(2*phi)$
Parameters
phifloat or ndarray

The angle(s) along the elliptical path, going towards the positive y axis, starting coincident with the position angle. That is, the angles are defined from the semimajor axis that lies in the positive x quadrant.

intensitiesndarray

The intensities measured along the elliptical path, at the angles defined by the phi parameter.

Returns
y0, a1, b1, a2, b2float

The fitted harmonic coefficent values.