Skip to content

Ignore wcs for spectra - #17

Merged
sfoale merged 3 commits into
masterfrom
ignore-wcs-for-spectra
Sep 16, 2026
Merged

sfoale merged 3 commits into
masterfrom
ignore-wcs-for-spectra

Conversation

@sfoale

@sfoale sfoale commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Don't attempt image orientation wrt WCS for spectrum image types.

@sfoale
sfoale requested review from markBowman and a lite review from Copilot September 16, 2026 12:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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, and LAMPFLAT frame 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 None conflates a deliberately non-imaging frame with a frame that simply has no WCS. The shared conversion paths treat every None as eligible to receive the first sibling's transform, so mixing a SPECTRUM/ARC/LAMPFLAT with 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.

Comment thread fits2image/orientation.py Outdated

@markBowman markBowman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Excellent.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@sfoale
sfoale merged commit 93e0cf4 into master Sep 16, 2026
5 checks passed
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.

3 participants