Skip to content

bug in Moffat2D

@johannes.zabl @johan.richard @nicolas.bouche

in mpdaf 2.3.dev2405, there is a bug in the moffat_fit() function in Image.py

Early in the code, v[3] / v[5] is used to fit a and e (alpha and axis ratio). I.e. (b=a . e) But later, in saving the results, e is used in a division:

    fwhm[0] = a * (2 * np.sqrt(2 ** (1.0 / n) - 1.0))
    fwhm[1] = fwhm[0] / e

I believe (and sure after extensive tests) that e should be multiplied.

I include my image.py where I also added the saving of alpha and e. (with ensuring e<1).

image.py

See this PSF with a fwhm of 0.88" and aligned with the x-axis as an example: psf_moffat_fwhm088_rot0.fits