ccdproc icon indicating copy to clipboard operation
ccdproc copied to clipboard

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

Open jensjessenhansen opened this issue 5 years ago • 1 comments

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.


jensjessenhansen avatar Jan 14 '20 15:01 jensjessenhansen

@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.

mwcraig avatar Jan 15 '20 14:01 mwcraig