Page 1 of 1

IMFIT - gaussian fitting

Posted: Tue Jun 29, 2010 2:55 pm
by cat001
Hi Jamie,

When you do a gaussian fitting with IMFIT. It prints out a peak value +/- an error and a total integrated flux value with no error.
What is the error value for the total integrated flux?
Is there a way to calculate that value?

Many thanks,
Catarina

Re: IMFIT - gaussian fitting

Posted: Sat Aug 28, 2010 1:45 am
by MaximVoronkov
Technically, the uncertainty of the integral can be estimated from uncertainties of the peak and FWHM for a Gaussian. However, just thinking now about this I must say that
I am not entirely sure what integral MIRIAD reports. Is it an integral over component (or components) or measured integral over emission? I suspect the former, so it can also be
calculated analytically. The uncertainty of the true integral of emission may be systematically different from the uncertainty of the integral of the Gaussian component because
the emission may not be well approximated by the Gaussian (or sum of Gaussians).

If the imfit task output is ever going to be changed (although I must say I would have to patch a number of scripts if it happens) it would be nice to report a position ellipse rather than
ra and dec errors as these uncertainties are quite often correlated.

Re: IMFIT - gaussian fitting

Posted: Sun Sep 02, 2012 11:17 am
by hzhangshao2011
Hi, everyone,
I am also puzzeled with this problem. I don't know how to estimate the error for this integrated flux?
I hope someone can solve this problem. Thanks!

Hui

Re: IMFIT - gaussian fitting

Posted: Mon Sep 03, 2012 4:54 pm
by Mark.Wieringa
I just had a look at the code:


tflux = flux(i) * pi/4.0 * fwhm1(i) * fwhm2(i)
if (srctype(i).eq.GAUSSIAN) tflux = tflux / log(2.0)
tflux = tflux / bvol
write(line,35) tflux
35 format(' Total integrated flux:',1pg16.4)


I.e, the total flux is calculated as the product of the fitted peak flux times the fitted component widths (and divided by the beam volume).
As a first approximation the error in the total flux t is thus: st = t*sqrt((sf/f)^2+(sma/ma)^2+(smi/mi)^2), where sf is the error in f, the peak flux, sma is the error in ma, the major axis, and smi is the error in mi, the minor axis. All this assumes the source can actually be fitted by a gaussian, there are no calibration errors/sidelobes and the image noise is gaussian. I could add this noise estimate to the output fairly easily. Changing the position error estimates into an error ellipse will require more work.

The best way to get an estimate of the actual errors is to inject some fake sources in the image (using imgen) in various places and see how they are fitted. This would still not include effects like decorrelation and absolute calibration errors.

Cheers,

Mark

Re: IMFIT - gaussian fitting

Posted: Wed Oct 17, 2012 2:59 pm
by Mark.Wieringa
Imfit has now been updated to provide an error estimate for the total flux and an error ellipse for the position error.
I've tried to keep the formats as similar as possible so as not to confuse any scripts parsing the output, but be aware some adjustments may be needed.

Cheers,

Mark