Skip to content

Pixel area must be positive#878

Merged
oczoske merged 1 commit intomainfrom
oc/fix_cube_source
Feb 18, 2026
Merged

Pixel area must be positive#878
oczoske merged 1 commit intomainfrom
oc/fix_cube_source

Conversation

@oczoske
Copy link
Copy Markdown
Collaborator

@oczoske oczoske commented Feb 18, 2026

The METIS/IFU notebook used an input cube in which CDELT1 was negative. This resulted in a negative source trace imprinted on positive background. The reason is that OpticalTrain.prepare_source() divides the cube data by the pixel area (solid angle), which was computed from CDELT1 and CDELT2 and came out negative. This PR uses the absolute value of the pixel area so that the cube data remain positive.

@oczoske oczoske requested a review from teutoburg February 18, 2026 08:47
@oczoske oczoske self-assigned this Feb 18, 2026
@oczoske oczoske added the bugfix PR resolving one or more bugs (use "Bug" type for issues, not this label) label Feb 18, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.82%. Comparing base (67be391) to head (7b1d048).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
scopesim/optics/optical_train.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #878      +/-   ##
==========================================
- Coverage   74.83%   74.82%   -0.01%     
==========================================
  Files          69       69              
  Lines        8868     8869       +1     
==========================================
  Hits         6636     6636              
- Misses       2232     2233       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@teutoburg teutoburg moved this to 👀 Awaiting Review in ScopeSim-development Feb 18, 2026
Copy link
Copy Markdown
Contributor

@teutoburg teutoburg left a comment

Choose a reason for hiding this comment

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

Always surprising to find such rather obvious things...

@oczoske oczoske merged commit d630726 into main Feb 18, 2026
28 of 29 checks passed
@oczoske oczoske deleted the oc/fix_cube_source branch February 18, 2026 15:38
@github-project-automation github-project-automation bot moved this from 👀 Awaiting Review to ✅ Done in ScopeSim-development Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR resolving one or more bugs (use "Bug" type for issues, not this label)

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants