Skip to content

re-insert the WCSAXES keyword to precede other WCS keywords - #219

Merged
jchiang87 merged 2 commits into
masterfrom
u/jchiang/move_WCSAXES_keyword
Jun 9, 2019
Merged

jchiang87 merged 2 commits into
masterfrom
u/jchiang/move_WCSAXES_keyword

Conversation

@jchiang87

Copy link
Copy Markdown
Collaborator

No description provided.

@jchiang87
jchiang87 requested a review from cwwalter June 6, 2019 22:00
@coveralls

coveralls commented Jun 6, 2019 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.04%) to 73.497% when pulling ef7e897 on u/jchiang/move_WCSAXES_keyword into d0231cc on master.

@cwwalter cwwalter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry... missed this before.

This code looks OK. But, is there a reason it can't be written first originally? Is the point that we don't know this part of the WCS when the e-image is written for some reason?

@jchiang87

Copy link
Copy Markdown
Collaborator Author

I would have hoped that the line

output[0].header = self.eimage[0].header

would just copy the keywords in the same order as in the eimage, but perhaps because the .header acts like an unordered dict, the keywords end up in mostly random order. If I explicitly loop through the keywords in the self.eimage[0].header, they are added in the correct order, but astropy can't write the file for some reason. I didn't want to debug that, so deleting and inserting it at a location that was guaranteed to appear before the other WCS keywords was the most expedient solution to address something we shouldn't have to spend any time on at all anyways.

@cwwalter

cwwalter commented Jun 9, 2019

Copy link
Copy Markdown
Member

Weird. OK, I understand, thanks.

@cwwalter

cwwalter commented Jun 9, 2019

Copy link
Copy Markdown
Member

I guess it might be good to write something in the comments there that says the reason it is being done is that the

output[0].header = self.eimage[0].header

is randomizing the order so someone looking at it knows why it is needs to be re-inserted.

@jchiang87
jchiang87 merged commit 8b0bc21 into master Jun 9, 2019
@jchiang87
jchiang87 deleted the u/jchiang/move_WCSAXES_keyword branch June 9, 2019 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants