[AstroPy] Extend io.fits class to support wavelength vector?

Tim Jenness tim.jenness at gmail.com
Tue Jul 7 11:47:55 EDT 2015


What you are describing is a specific implementation of a world coordinate
system for wavelength. There are many ways that a spectral axis can be
defined using FITS headers (you also have to worry about reference frames
and observer locations in theory) and this should be handled by a generic
WCS infrastructure rather than trying to teach the FITS reader how to do
it. The starlink-pyast package is designed for this, just as are other WCS
libraries.

-- 
Tim Jenness


On Tue, Jul 7, 2015 at 8:10 AM, Leonard Burtscher <burtscher at mpe.mpg.de>
wrote:

> Hi,
>
> I'm new to this list, but reasonably sure that this question hasn't been
> asked the last year or so.
>
> When opening a FITS file that includes a spectrum I would like to directly
> have access to the wavelength vector and store it in a variable, e.g.
>
> hdu=fits.open("test.fits",ext=2,wave=wave)
>
> where
>
> hdr=hdu[2].header
> wave=(np.arange(hdr['NAXISi'])+1-hdr['CRPIXi'])*hdr['CDELTi']+hdr['CRVALi']
>
> and
>
> i is chosen such that CTYPEi=="WAVE". The unit is given by CUNITi and
> could be converted by default to e.g. meters. In case of more than one WAVE
> axis or missing header information, a warning should be given and the
> routine could fall back to the usual behaviour without constructing the
> wavelength vector.
>
> Since this is a very generically used functionality, wouldn't it make
> sense to implement this into the core of the astropy package?
>
> Cheers,
> Leo
>
> _______________________________________________
> 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/20150707/c6fcdcc0/attachment.html>


More information about the AstroPy mailing list