View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

gaussian minima in FXCOR

Ella Braden wrote on Aug 18, 2006

I'm attempting to use FXCOR to fit cross correlation functions, and would like to constrain the gaussian so that it has a minumum value of 0. With the current parameters that I have set, I'm getting fwhm which are measured a negative values. I want to force the gaussian to a minimum of 0 so that the fwhm has a meaningful value. Any tips?

Cheers,
-Ella Braden

Mike Fitzpatrick wrote on Aug 18, 2006

'm attempting to use FXCOR to fit cross correlation functions, and would like to constrain the gaussian so that it has a minumum value of 0.


Set the 'background' parameter to 0.0 to contrain the fit, see also the 'width' parameter to control the number of points. I'm not sure how you could be getting a negative FWHM so long as you're fitting a peak in the CCF and not a trough.

Cheers,
-Mike[/quote]

Ella Braden wrote on Aug 18, 2006

The fwhm is positive. The problem is that the gaussian that if fitted has a minimum of much less than one, so its fwhm doesn't represent the shape of the ccf it is fit to.
I'm trying to constrain the gaussian between values of 1.0 and 0.0.
I'm unclear on what the height parameter sets. It is nominally the " Starting height of fit", but changing it between 0.0 and 1.0 (where all the values of the ccf lie) doesn't change the output fwhm at all.

Cheers,
-Ella

Mike Fitzpatrick wrote on Aug 18, 2006

The 'height' param is like the 'y' keystroke, i.e. the task find the max value in the ccf (or specified search window) and uses that as a starting guess. To figure out how many points to be fit the height param can be used such that all point left or right of the max and above that height are used in the fit. If the peak param is set then this value is a fraction of the peak height (e.g. height=0.2 means anything above 20% of the peak height when peak=yes, otherwise it means ccf values above 0.2 regardless of peak height).

Neither of these constraint the fit the way you want. The 'background' can be fixed so it isn't a free param in the fit, however the height of the gaussian is a fit parameter and can exceed 1.0. You might try a Lorentzian fit? It is also possible to write out the ccf to a file/image if you want to do the fit separately (but then you have to do the velocity conversion stuff yourself).

-Mike

Last post on Aug 18, 2006