[AstroPy] Reading in wavelength-calibrated spectra

Andy Casey acasey at mso.anu.edu.au
Tue Aug 14 11:54:57 EDT 2012


In the past I've done what Kelle has suggested (and I hope AstroPy will eventually be able to parse all of this, even if I end up writing it myself), but just for reference:

http://iraf.net/irafdocs/specwcs.php

Provides a good overview on the different dispersion representations that you'll typically find in FITS headers.

Cheers,
Andy

On 14/08/2012, at 11:47 AM, Ian Crossfield wrote:

> It's not quite what you're looking for, but I have Python code to generate a wavelength array from the "ec" echelle database IRAF generates:
> http://www.astro.ucla.edu/~ianc/python/nsdata.html#nsdata.dispeval
> 
> Kelle's suggestion is probably the easiest, though likely not the fastest.
> 
> -Ian
> 
> 
> On 8/14/12 5:10 PM, Kevin Gullikson wrote:
>> 
>> Hi,
>> 
>> I have some spectra that were reduced in iraf, and I would like to read them in to python to do some fitting that I already have code for. However, I am having trouble reading in the wavelength calibration. The spectra are echelle, and the wavelengths are defined with this thing in the header that looks like this:
>> 
>> "
>> WAT2_001= 'wtype=multispec spec1 = "1 32 2 10672.221264362 0.086046403007761 20'
>> WAT2_002= '46 0. 6.65 26.40 1. 0. 1 5 1. 2046. 10761.5346117191 87.998952480064'
>> WAT2_003= ' -1.32409633589482 -0.0165054046288388 -0.00680394594704411" spec2 ='
>> WAT2_004= ' "2 33 2 10348.8582697 0.083445037904806 2046 0. 34.60 58.07 1. 0. 1'
>> WAT2_005= ' 5 1. 2046. 10435.4699172677 85.3379030819273 -1.2833101652519 -0.01'
>> WAT2_006= '53518242619121 -0.0057861452751027" spec3 = "3 34 2 10043.881872825 '
>> ...
>> "
>> 
>> The numbers give the conversion from pixel coordinates to wavelength coordinates.
>> I was wondering if there was a python function that could correctly read all that in, parse it, and give me a spectrum in flux vs wavelength? I have tried playing with pywcs but that seems only to work for images?
>> 
>> Cheers,
>> 
>> Kevin Gullikson
>> 
>> _______________________________________________
>> AstroPy mailing list
>> AstroPy at scipy.org
>> http://mail.scipy.org/mailman/listinfo/astropy
> 
> 
> -- 
> Ian Crossfield
> Max-Planck-Institüt für Astronomie
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20120814/d250bbb5/attachment.html>


More information about the AstroPy mailing list