Closed boada closed 7 years ago
I wrote a work around to get everything converted to the right type. Now the problem is that SCAMP adds a bunch of non standard keywords to the FITS header. This causes problems when trying to read one of the calibrated images with something like astropy
.
Sorry for being late on this. I use something similar already in diagnostics.py
and it seems to work as a workaround:
# turn relevant header keys into floats
# astropy.io.fits bug
for key, val in list(header.items()):
if 'CD1_' in key or 'CD2_' in key or \
'CRVAL' in key or 'CRPIX' in key or \
'EQUINOX' in key:
header[key] = float(val)
On the converted header I can then apply astropy.wcs
functions.
What are you doing with the SCAMP header keywords? Because it sounds like they aren't supported by astropy.
https://mail.scipy.org/pipermail/astropy/2014-April/003156.html
Nothing specifically. astropy might simply ignore them, but I've never had problems with them...
Hmmm. Ok. Seems ok to me.
I don't know if this is an issue with PP or with SCAMP. After the pipeline has completed and all of the header keywords have been updated, the values are often given as strings. For example:
If you wanna do something like run Sextractor on the image with everything all updated, it works fine. However, Sextractor gives the coordinates of the objects in
X_IMAGE
andY_IMAGE
so you'll need to convert those intoRA
andDEC
using the WCS of the image.Ok. So you fire up
astropy
and get a copy of the header/WCS information, but because the values of the keywords are strings and not floating point numbersastropy
doesn't know what to do and the conversion fromX_IMAGE
toRA
fails. This is probably something that should be changed in astropy, but if it is an easy fix in PP then we could do that too.I'm not sure where the header keywords are getting written by PP or if the problem is really something with SCAMP and I'll need to write a work around.