I'm making an application to get the best focus for an instrument. I'm using a Moffat1D model to fit the profile and for some reason gamma is negative (which does not matter and I assume it is correct) but when I get the FWHM is negative as well, which as far as I know does not make sense in astronomical images (or any). It seems to me that there is a mistake regarding the formula, see this comment: https://github.com/astropy/astropy/pull/6027#issuecomment-300380649
from the second-last to the last line
and thus (should be)
and using the notation in astropy's documentation the FWHM should be:
Hopefully someone has a better insight in this, I will workaround this making gamma
absolute value always.
I can make a PR if this is really something worth doing.
The model
Model: Moffat1D
Inputs: ('x',)
Outputs: ('y',)
Model set size: 1
Parameters:
amplitude x_0 gamma alpha
------------- ------------ -------------- ------------
248.392233095 2065.9401953 -90.3411844413 1161.3273732
@ysBach, what do you think?
@pllim Sorry for not being respondent for few days.
I think @simontorres is absolutely right.
Due to the squaring, the sign of the "core" parameter (gamma
of astropy = alpha
of IRAF = R of Moffat's original work) does not matter in Moffat profile calculation, but it does for the current FWHM calculation...
@simontorres , pull request is welcome. Please refer to http://docs.astropy.org/en/stable/development/workflow/development_workflow.html . Thank you!