Opening Sloan DR10 spectra with IRAF
Vital wrote on Feb 21, 2014
Hello everyone! I wonder if anyone could help me with a small issue regarding the 10th release from the telescope sloan.
This would be such a file I am using:
https://www.dropbox.com/s/4sj0w47k0129o55/spec-0394-51913-0472.fits
(which I got from the website: http://dr10.sdss3.org/basicSpectra)
I understand that the issue lies in the fact that the spectrum header does not include any straight forward indication on the number of pixels or images number... However, it is evident that the files have some kind of flux information... I read some spectra are compressed and this could give you the same error: (ERROR: MWCS: dimension mismatch (mw_open)) but I tried with funpack,fpack but no luck
What I am doing wrong?
Mike Fitzpatrick wrote on Feb 21, 2014
The problem is that the spectra are stored as FITS binary tables and not in the spectral format IRAF tasks currently understand. We are working on tools to make files like this usable directly, however for the moment you'll need to do something like use TDUMP (or other TABLES package tasks) to write out the bintable as wavelength/flux pairs, and then RSPECTEXT to read them into a format the ONEDSPEC tasks can understand.
Vital wrote on Feb 21, 2014
Dear Fitz,
Thank you very much for your reply. I am not familiar with those steps you described... Do you know where I could find them described in a bit more detail?
On the other hand, I have some experience with pyfits... would you know if someone has created a script to transform these spectra into an IRAF-readable configuration?
Thanks again for your time
Mike Fitzpatrick wrote on Feb 21, 2014
Thank you very much for your reply. I am not familiar with those steps you described... Do you know where I could find them described in a bit more detail?
See the help pages for the tasks, particularly the examples section.
On the other hand, I have some experience with pyfits... would you know if someone has created a script to transform these spectra into an IRAF-readable configuration?
Not off hand, but you could Google it and I'm sure something will turn up.
Vital wrote on Feb 24, 2014
I did not find the right procedure to open the dr10 SDSS release with IRAF but with python/pyfits, the right procedure is the following:
import pyfits
FitsFile = pyfits.open(FolderName + FileName)
Spectra = FitsFile[1].data
Int = Spectra['flux']
WavelenRange = 10.0**Spectra['loglam']
FitsFile.close()
Last post on Feb 24, 2014