View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Automatically fit (and subtract) gaussian/voigt profiles?

Adam wrote on May 28, 2009

Hi folks,
I'm trying to do near-IR (JHK) spectral calibration using IRAF. To deal with atmospheric absorption, I want to divide my spectrum by a high s/n A0 star spectrum and then multiply by some factor / function to get the units right.
std/sensfunc do this for optical spectra, but I DON'T want to smooth over my star spectrum by fitting with a spline or some other function - even the highest order spline does a very poor job of fitting the deep absorption features at 2.01 and 2.06 microns.
I've figured out how to make an artificial blackbody spectrum using mk1dspec. The only step I'm missing now is how do deal with the Brackett and Paschen absorption features in the A0 spectrum. I can go through splot and fit and subtract each individual feature, but this isn't very efficient and I'm trying to write a script to do this non-interactively. So, is there a good way to non-interactively fit a bunch of gaussians/voigts (with a good set of initial guesses and, hopefully, high S/N) and subtract them within IRAF?

Thanks,
Adam

Mike Fitzpatrick wrote on May 28, 2009

If you're getting satisfactory results from SPLOT, then have a look at the BPLOT task which is meant to me something of a "batch-splot". Frank is the expert but is away on vacation through next week, he might have additional suggestions.

-Mike

Francisco Valdes wrote on May 28, 2009

I'm not sure I fully understand what you want to do. So I'll through out some tasks that may be appropriate.

The first one that comes to mind is telluric. This has the scaling and dividing features you mention but I'm not sure that is what you want.

Another one is lineclean. This may be able to fill in lines while not replacing the spectrum with a fit.

As Mike mentioned, you could use BPLOT and the 'x' key to simply replace a line feature by a straight line assuming the spectrum is wavelength calibrated so that the feature has known wavelengths for the edges.

An then there BPLOT to do line fitting and subtraction as Mike was suggesting.

I hope this helps.

Yours,
Frank Valdes

Last post on May 28, 2009