Skip to content

Fixes WCS construction for FITS maps with SIP distortion - #8924

Open
rpinho wants to merge 3 commits into
sunpy:mainfrom
rpinho:fix-sip-fits-header
Open

rpinho wants to merge 3 commits into
sunpy:mainfrom
rpinho:fix-sip-fits-header

Conversation

@rpinho

@rpinho rpinho commented Nov 18, 2026

Copy link
Copy Markdown

PR Description

Loading a FITS map with SIP distortion fails when its metadata contains KEYCOMMENTS or COMMENT and HISTORY entries with line breaks. Writing a TAN-SIP FITS image with Astropy and evaluating Map(path).wcs reproduces the failure. The patch converts metadata through fits_header and reads SIP with WCS fixes disabled. The tests compare coordinates and coefficients against the file header and check that pixels and metadata are preserved.

Fixes #8918.

AI Assistance Disclosure

AI tools were used for:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding
  • No AI tools were used

Regardless of AI use, the human contributor remains fully responsible for correctness, design choices, licensing compatibility, and long-term maintainability.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N

CharlesXmf

This comment was marked as low quality.

@rpinho

rpinho commented Nov 19, 2026

Copy link
Copy Markdown
Author

Thanks, that's helpful. I changed those.

This branch has not been deployed

No deployments
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.

Error When Constructing WCS and/or Map Object for FITs files Containing SIP projection

2 participants