[AstroPy] [pywcs] Unit question
jturner at gemini.edu
Fri Apr 1 12:24:20 EDT 2011
> h = pyfits.ImageHDU(
> data = hdu.data[int(pix_coords):int(pix_coords)+1,:, :],
> header = hdu.header)
> # Here comes the funny stuff
> start = [0, 0, int(pix_coords)]
> h.header['CRVAL3'] = wcs.wcs_pix2sky([start], 1)
> The problem here is that "pix2sky" returns the wavelength in meters
> while I want to put it in the unit that was used in the original file.
> Is there an easy way to convert this?
Don't you just need to set CUNIT3 in the header?
See paper I, S2.3:
More information about the AstroPy