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

fix combining FITS images #3456

Merged
merged 2 commits into from
Jul 28, 2021
Merged

Conversation

jzuhone
Copy link
Contributor

@jzuhone jzuhone commented Jul 27, 2021

…ed as the PrimaryHDU

PR Summary

The combine_images method of the FITSImageData class allows one to combine multiple images into one, but a FITS file is only valid if the first image is a PrimaryHDU. The previous implementation, when stitching multiple FITSImageData instances together, was attempting to create multiple PrimaryHDU instances (the first image from each instance). This PR fixes it and adds a single line to the FITSImageData tests which ensure that this functionality works correctly.

PR Checklist

  • New features are documented, with docstrings and narrative docs
  • Adds a test for any bugs fixed. Adds tests for new features.

@jzuhone jzuhone added the bug label Jul 27, 2021
Copy link
Member

@neutrinoceros neutrinoceros left a comment

Choose a reason for hiding this comment

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

I don't think the test correctly validates the change: I've tried running the modified test function without the patch in fits_image.py and it still passed.

Copy link
Member

@neutrinoceros neutrinoceros left a comment

Choose a reason for hiding this comment

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

Much better ! the new test correctly fails on the main branch and pass here, confirming the bug and the fix. Thanks John !

@neutrinoceros neutrinoceros merged commit cb1aecc into yt-project:main Jul 28, 2021
@neutrinoceros neutrinoceros mentioned this pull request Oct 12, 2021
42 tasks
@matthewturk
Copy link
Member

@meeseeksdev backport to yt-4.0.x

meeseeksmachine pushed a commit to meeseeksmachine/yt that referenced this pull request Oct 15, 2021
neutrinoceros added a commit that referenced this pull request Oct 16, 2021
…6-on-yt-4.0.x

Backport PR #3456 on branch yt-4.0.x (fix combining FITS images)
@jzuhone jzuhone deleted the fix_join_fits_images branch October 24, 2021 04:46
@neutrinoceros neutrinoceros added this to the 4.0.2 milestone May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants