Skip to content
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

ImageFileCollection fails if the fits headers contain the keyword 'FILE' #726

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jensjessenhansen
Copy link

There's an assert statement on line 503 in image_collection.py in method _dict_from_fits_header:
assert 'file' not in h
to catch and raise the problem - but no handling is implemented.
If not caught the 'file' value list in the summary dictionary would get a filename appended twice for each image.
This will cause the generation of the summary_table to fail.

The suggested way to fix this is to remove the header 'FILE' keyword if present.
This should be okay since it will either be the same as the input filename or likely incorrect - I guess?

Please have a look at the following list and replace the "[ ]" with a "[x]" if
the answer to this question is yes.

  • For new contributors: Did you add yourself to the "Authors.rst" file?

For documentation changes:

  • For documentation changes: Does your commit message include a "[skip ci]"?
    Note that it should not if you changed any examples!

For bugfixes:

  • Did you add an entry to the "Changes.rst" file?
  • Did you add a regression test?
  • Does the commit message include a "Fixes #issue_number" (replace "issue_number").
  • Does this PR add, rename, move or remove any existing functions or parameters?

For new functionality:

  • Did you add an entry to the "Changes.rst" file?
  • Did you include a meaningful docstring with Parameters, Returns and Examples?
  • Does the commit message include a "Fixes #issue_number" (replace "issue_number").
  • Did you include tests for the new functionality?
  • Does this PR add, rename, move or remove any existing functions or parameters?

Please note that the last point is not a requirement. It is meant as a check if
the pull request potentially breaks backwards-compatibility.


There's an assert statement on line 503:
assert 'file' not in h
to catch and raise the problem - but no handling is implemented. 
If not caught the 'file' value list in the summary dictionary would get a filename appended twice for each image.
This will cause the generation of the summary_table to fail.

The suggested way to fix this is to remove the header 'FILE' keyword if present.
This should be okay since it will either be the same as the input filename or likely incorrect - I guess?
@mwcraig
Copy link
Member

mwcraig commented Jan 15, 2020

@jensjessenhansen -- thanks for the PR! I will take a look at it this evening and give you some feedback. This is definitely a case we need to handle better.

Base automatically changed from master to main March 16, 2021 13:40
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.

2 participants