Wednesday, July 4, 2007

Gaussian Fitting

Here is a request from an anonymous reader; any advice, anyone?

Can you please help me with the following? I have an image with 5 substructures in it. The peaks inthe image decrease in size from left to right, the leftmost two are the brightest. All of them are close to each other. With AIPS jmfit I can fit not more than 4 gaussians. I played around a bit and noticed that dividing the whole image into two parts and fitting 2 gaussians and 3 gaussians respectively in the two parts does not work properly and gives a bad fit. So I came up with this idea. I can first fit four gaussians to first four peaks, and then from the whole image subtract the brightest two. To the residual image now I fit 3 gaussians. I checked whether this technique gives me a good fit to a slice of data (Wrote my own fortran programs for that). It seems to work but my problem is how to do it in aips.

So my problem is the following. I want to fit 4 gaussians to a selected range of data. Then subtract only the brightest two gaussian from the whole image. Then fit other three gaussians to another restricted part of the data. Could anyone please help me on this?


7 comments:

Laura said...

Have you tried SAD? I'm not sure I really understand what the fundamental issue is with your current setup. but it looks like SAD will find the gaussians for you, and there can be more than four...

SAD will give you a residual image...so if you set the parameters so that it only detects the two brightest sources, and then use the residual images to fit the remaing three, that might work...

Anonymous said...

I will try this out. If not, I will return with a more graphical view of the data... Thanks a lot.

Kisha said...

There's also a program called VSAD which the NRL people (I think) developed (and is related to SAD). I don't think it's rolled into the latest version of AIPS but it might be. If not, let me know and I can see about finding/sending it to you.

Ian said...

SAD storing the fits as clean components will come in handy for source subtraction.

Check out BOX2CC, CCEDT and UVSUB.

Kelley said...
This comment has been removed by the author.
Kelley said...
This comment has been removed by the author.
Kelley said...

As an alternative, if you have GIPSY installed on your computer, you can run GAUFIT, GAUSSCUBE, and SUB to get what you want. Yes, it takes three steps, but the data manipulation is pretty powerful. I then view these in kvis, but you can write the files as FITS and import them back into AIPS. You can fit more than four gaussians at a time.