Wavelength and spectrum separated
yaelnaze wrote on Nov 30, 2009
Hello,
I've an echelle spectrum (flux = fct of pixel number) on the one hand, and wavelength calib (lambda = fct of pixel number) on the other. Both are provided as fits files (in multispec format).
How can I associate them without fitting the wavelength (cf. task mkmultispec) ?
or alternatively : how can I save both files as ascii, and then transform a merged ascii into a fits again (either multispec or a series of onedspec)?
Regards,
I've an echelle spectrum (flux = fct of pixel number) on the one hand, and wavelength calib (lambda = fct of pixel number) on the other. Both are provided as fits files (in multispec format).
How can I associate them without fitting the wavelength (cf. task mkmultispec) ?
or alternatively : how can I save both files as ascii, and then transform a merged ascii into a fits again (either multispec or a series of onedspec)?
Regards,
Mike Fitzpatrick wrote on Nov 30, 2009
If by 'associate' you mean you want the flux from one file and the wavelength from the other ..... WSPECTEXT will convert a FITS file to ascii, FIELDS can select a single column from a text table and JOINLINES can be used to paste columns. Lastly, RSPECTEXT can convert this back to a fits image. Note however that you need to be careful not to have RSPECTEXT try to apply its own dispersion solution to the header.
See the help pages for each task for details.
See the help pages for each task for details.
yaelnaze wrote on Nov 30, 2009
Indeed, I thought of this solution, but I was thinking there was a much "simpler" (one command) solution... Going through at least 17*2*39 files is not fun : )
Mike Fitzpatrick wrote on Nov 30, 2009
Well, you can always write a script and make it a one-command solution ....
Last post on Nov 30, 2009