IMFIT - gaussian fitting

Is MIRIAD being a pain? Let us know your experience.

Moderator: Mark.Wieringa

Post Reply
cat001
Posts: 14
Joined: Tue Mar 09, 2010 3:58 pm

IMFIT - gaussian fitting

Post 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
MaximVoronkov
ATCA Expert
Posts: 14
Joined: Wed Jun 02, 2010 1:11 pm

Re: IMFIT - gaussian fitting

Post 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.
hzhangshao2011
Posts: 9
Joined: Sun Dec 18, 2011 2:50 am

Re: IMFIT - gaussian fitting

Post 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
Mark.Wieringa
ATCA Expert
Posts: 298
Joined: Mon Feb 08, 2010 1:37 pm

Re: IMFIT - gaussian fitting

Post 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
Mark.Wieringa
ATCA Expert
Posts: 298
Joined: Mon Feb 08, 2010 1:37 pm

Re: IMFIT - gaussian fitting

Post 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
Post Reply