-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to get WCS information from fits files #46
Comments
Hi Lilah Thanks for raising this. It helps us keep track of any solutions and time spent on them. As you may have seen there is quite strong feeling about from astropy.io import fits
from astropy.wcs import WCS
h = fits.open('01a57801o0580o_diff.fits')
header = h[0].header
w = WCS(header)
# whines about SIP but then will also barf out with an error.
# Delete the corner info
del header['CNPIX1']
del header['CNPIX2']
# Now try again - still whines about SIP but should't crash this time.
w = WCS(header) |
This seems to have solved the problem, thank you! As a follow up question, I noticed that when the pixel position changes from say (200,200) to (199,200), instead of just the RA value changing, both the RA and DEC values change. This seems unusual to me and I was wondering if there is a reason for this? |
Nothing unusual I don't think - let us know if you see something particularly unusual. Is the dec change particularly large? Although it's an equatorial mount there will be slight variations in the orientation of the camera, plus the source image is a very large field of view (29 sq degrees), so astrometric corrections will have been applied to account for distortion, etc. |
Excellent. Thank you Ken! |
In addition to using a few keywords in ways we shouldn't, the reduced ATLAS images actually contain two different WCS solutions. A first pass is performed using astrometry.net that installs SIP terms. A second solve adjusts the solution and saves its result using the PV distortion convention (TPV CTYPE). Unless you modify the headers, you will be getting the TPV solution. I use the following code to clean things up on-the-fly and take the SIP solution:
|
Rob's solution above is the definitive one. Please use it, rather than my hack! |
I have downloaded the difference images and read in the fits files to a jupyter notebook using astropy. The problem I am having is I cannot convert the pixels to WCS coordinates. Whenever I attempt this I get an error. Here is how the image is read in:
And here is the error I encounter:
I'm not sure how to fix this problem.
The text was updated successfully, but these errors were encountered: