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

A workaround for unfixable header keys in ImageFileCollection #743

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Alphabetical list of code contributors
* Nathan Walker (@walkerna22)
* Benjamin Weiner (@bjweiner)
* Jiyong Youn (@hletrd)
* Michael Gully-Santiago (@gully)

Additional contributors
-----------------------
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ Bug Fixes
- Logging now preserves all of the arguments when the keyword argument
names are not used. [#756]

- Workaround malformed header keyword names [#743]

2.1.0 (2019-12-24)
------------------

Expand Down
10 changes: 10 additions & 0 deletions ccdproc/image_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,16 @@ def _fits_summary(self, header_keywords):
file_path, e)
continue

## Bugfix: Unfixable header keywords sometimes yield duplicate
# entries (probably arises the `_dict_from_fits_header` above)
# For now just check if there are more values than files and
# if so, fill with None for now.
if summary_dict is not None:
for key in summary_dict.keys():
if len(summary_dict[key]) > len(summary_dict['file']):
logger.warning('malformed header keyword %s cannot be understood.',key)
summary_dict[key] = [None]*len(summary_dict['file'])

summary_table = Table(summary_dict, masked=True)

for column in summary_table.colnames:
Expand Down
1 change: 1 addition & 0 deletions ccdproc/log_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import ccdproc # Really only need Keyword from ccdproc


__all__ = []

_LOG_ARGUMENT = 'add_keyword'
Expand Down