Repository navigation
wcs.naxis should be determined from NAXIS, not presence of C???? keywords - #323
Conversation
|
Well it's not |
|
This behavior is inherited from wcslib. See here: Admittedly, we should probably copy these notes to the Python documentation -- this issue has come up before for pywcs -- it's a little confusing but apparently how the WCS standard is supposed to work. |
|
If I can paraphrase the reason I was told for this behavior: It's possible that a WCS may want to specify extra dimensions while still having fewer dimensions in the actual data itself (which of course uses NAXIS). Also, it is possible to limit the number of dimensions by passing naxis=2 to the constructor. |
|
But for those kinds of datasets, why not have I guess what confused me was that regardless of this behavior, I would have thought Wouldn't a more sensible behavior be to respect |
|
There is justification for this behavior in Paper I, section 2.2. (I suggest reading that section in its entirety, but it essentially amounts to "the addition of degenerate axes to otherwise n-dimensional data may mean some software will reject it unnecessarily"). None of this precludes what you're suggesting, but I'm wary to deviate from the behavior of wcslib unless there's something that can't be done any other way. In this particular case, one can pass an explicit
EDIT: Changed != to < in proposal #1. |
… determined is somewhat confusing.
|
I've put my proposals into code here so you can play with it. |
|
Sorry for the delay, I will try this out today. |
There was a problem hiding this comment.
Are the changes in this file needed?
There was a problem hiding this comment.
Yes. This header was actually only working by "accident" -- the wcslib parser is fuzzy about FITS headers with carriage returns. It doesn't complain -- it reads some cards that don't overlap an 80 character boundary and silently rejects others. I didn't notice this problem with this header until, in this PR, the header needed to be re-parsed by io.fits in order to read the NAXIS card.
|
I like the addition of the warning and that naxis keywords default to 1. Just a couple of comments:
|
|
I have updated this to @iguananaut: I added a |
|
Ok, this looks good and consistent to me, so feel free to merge! |
wcs.naxis should be determined from NAXIS, not presence of C???? keywords
|
It looks like this caused some failures with Python 3: |
|
Thanks. I think this is fixed in master now. |
… determined is somewhat confusing.
wcs.naxis should be determined from NAXIS, not presence of C???? keywords
Updating bundled sphinx-automodapi to v0.6
If I parse the following header:
with:
the
naxisattribute has the wrong value:as I would imagine
NAXIStakes precedence over anything else. If I try and accessnaxis3for example, I have issues:as expected.