-
Notifications
You must be signed in to change notification settings - Fork 21
WCS — KeyError: u"Keyword 'A_0_0' not found." #82
Comments
This looks a lot like a problem caused by non-standard WCS keywords, which (that's the problem with... non-standard stuff) cause AstroPy to die amidst screams and explosions. These are images from the good'n old CAHA, right? I remember experiencing a very similar problem in the past, if not exactly the same. What I ended up doing was to remove all the WCS keywords that CAHA wrote to the headers, and them run |
It is true I have a script in repipy to remove the WCS from the headers, called wipe_wcs.py, actually. |
Thank you two for the input (and for rephrasing of the issue title). Indeed these are CAHA observatory images. I am doing this again as we speak though... and It still raises the same error:
No error, and right after wiping+adding WCS, I run the photometry routine:
|
Could it be that the keyword 'A_0_0' were in the original FITS headers, but
|
Yes, "A_0_0" keyword is present in every original FITS file header (as well as in those upon which photometry is being run) and no, Javier's scripts are not deleting or modifying it at any point. IMHO, the question should be then rephrased to: why can not the Or a less obvious but far more usual: might this user be misunderstanding the use of Just FYI, this is how I understood the use of the task:
|
Addendum. Part of the FITS file header of the image: where the
|
You can easily remove all these TAN-SIP keywords using missfits: if your camera's distortions are not too bad, it should not compromise the analysis. |
Thanks for your input @hbouy. I guess that could help if I needed to remove the A_0_0 etc. keywords but the error seems to point the other way round, doesn't it? Not finding the keyword is bothering the script so removing it should cause a similar behavior. The problem I see is that while the keyword does exist, the script does not detect it. |
You're right that the error message complains that keyword "A_0_0" is not found, but if this indeed is being caused by non-standard WCS keywords this could bite us in many shapes and forms. In other words: the keywords may be there, but AstroPy —this is just a guess, though— fail to read them at some point because they fail to conform to the standard. My approach to test whether this theory makes sense would be: (a) removing all the existing WCS keywords, as suggested by @hbouy — thanks! and then (b) running the [Your understanding of how |
Update: A different error raises when running Here are the steps and returned outputs:
(all seems good)
(all good here)
This time, the case is more simple: GAIN keyword is not found.
but I am not sure of which one is necessary. |
You don't need to modify the headers. From the help of
So you just need to run the command again with [By the way, |
I had completely missed that one, thanks @vterron. And well, it all has finally worked! Thanks a lot @hbouy and @vterron for your fantastic inputs. |
Well, this is unexpected:
Returns:
Extra warning:
This seems to be fine but when checking out the database, it seems to be empty:
I can't really figure out why it is empty... Is it really relevant which source image I take, considering that in terms of counts and image quality, the one I chose is as good as the rest? |
I can't tell for sure because Also, just to make doubly sure — I assume that if you open the database with |
Apologies. I keep mixing tasks from both packages Ok. Thanks guys for all the help provided so far! |
I agree that's the most sensible approach. Let's close this issue and please open as many as you need if you come across other problems. One last note, for the record — although using one of the images for sources detection (the first one passed to |
Dear PyBro,
Trying to perform photometry over a selection of images (all equal in header keywords):
photometry.py --overwrite cig/cig96_20120911_CousinsR_001-b-o-f-c-t.fits cig/*-t.fits cig/cig96.db
returns an error that I do not understand:
To prevent another error I was getting when using photometry.py, and just FYI (it ignore if this might be relevant for the current error) did as follows:
While my original images had the filter keyword labeled as "INSFLNAM" (beats me why astronomers thought that would be a suitable keyword name for the filter), I have manually added a new keyword "FILTER" with the same filter value.
This is:
INSFLAN = "Cousins R"
INSFLAN = "Cousins R"
FILTER = "Cousins R"
In my eyes, this filter keyword seems unrelated to the current error (coordinates related?) but it might be relevant somehow so I preferred to post it anyway, just in case.
If my suspicion about the coordinates is by any chance close to the problem, I must add that I have checked that all images have their proper WCS coordinates.
Any light over this dark path?
Thanks!
The text was updated successfully, but these errors were encountered: