Ignore wcs for spectra - #17
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The orientation fallback can still apply a transform to mixed non-imaging frames; the distinction must be preserved.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates WCS-based orientation handling to avoid rotating spectrum and calibration frames.
Changes:
- Excludes
SPECTRUM,ARC, andLAMPFLATframe types. - Adds regression tests for excluded and normal frames.
File summaries
| File | Summary and final comments |
|---|---|
tests/test_orientation.py |
Adds coverage for excluded frame behavior. |
fits2image/orientation.py |
Skips WCS orientation for non-imaging frames. Nit (3 votes): fix “rotatating” typo. Moderate (1 vote): distinguish non-imaging frames from frames without WCS to prevent inheriting a sibling’s transform. |
Review details
Suppressed comments (1)
fits2image/orientation.py:61
- Returning
Noneconflates a deliberately non-imaging frame with a frame that simply has no WCS. The shared conversion paths treat everyNoneas eligible to receive the first sibling's transform, so mixing aSPECTRUM/ARC/LAMPFLATwith a normal frame can still apply a quarter-turn to the spectrum—the failure this guard is intended to prevent. Preserve a distinct no-orientation state or make shared resolution fall back for all inputs when one is non-imaging.
if header is not None and header.get('OBSTYPE') in NON_IMAGING_OBSTYPES:
return None
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Don't attempt image orientation wrt WCS for spectrum image types.