The derivatives in Moffat1D are wrong:
|
def fit_deriv(x, amplitude, x_0, gamma, alpha): |
They should be replaced by:
@staticmethod
def fit_deriv(x, amplitude, x_0, gamma, alpha):
"""One dimensional Moffat model derivative with respect to parameters"""
fac = (1 + (x - x_0) ** 2 / gamma ** 2)
d_A = fac ** (-alpha)
d_x_0 = (2 * amplitude * alpha * (x - x_0) * d_A / (fac * gamma ** 2))
d_gamma = (2 * amplitude * alpha * (x - x_0) ** 2 * d_A /
(fac * gamma ** 3))
d_alpha = -amplitude * d_A * np.log(fac)
return [d_A, d_x_0, d_gamma, d_alpha]
In Moffat2D:
|
def fit_deriv(x, y, amplitude, x_0, y_0, gamma, alpha): |
only derivative wrt gamma is wrong. It should be
d_gamma = 2 * amplitude * alpha * d_A * rr_gg / ((1 + rr_gg) * gamma ** 3)
The derivatives in Moffat1D are wrong:
astropy/astropy/modeling/functional_models.py
Line 2223 in 2b8fe13
They should be replaced by:
In Moffat2D:
astropy/astropy/modeling/functional_models.py
Line 2301 in 2b8fe13
only derivative wrt gamma is wrong. It should be