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 mixed unit spectral region extraction #1187

Merged
merged 6 commits into from
Oct 15, 2024

Conversation

rosteen
Copy link
Contributor

@rosteen rosteen commented Oct 15, 2024

The left and right index bounds were ending up reversed if the spectrum was in wavelength units and the region was in frequency units, or vice versa, leading to a zero-length extracted spectrum. I confirmed visually in Jdaviz that this now extracts the correct region in those cases, and will add a test shortly. [edit: test that fails on main added]

@rosteen
Copy link
Contributor Author

rosteen commented Oct 15, 2024

This also gets rid of some more pointless random calls because now that @pllim pointed it out, I can't unsee it.

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.89%. Comparing base (2329d11) to head (6231a8b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1187      +/-   ##
==========================================
+ Coverage   86.87%   86.89%   +0.02%     
==========================================
  Files          63       63              
  Lines        4556     4564       +8     
==========================================
+ Hits         3958     3966       +8     
  Misses        598      598              

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

Copy link
Member

@pllim pllim left a comment

Choose a reason for hiding this comment

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

LGTM FWIW FFTM. Thanks!

@rosteen
Copy link
Contributor Author

rosteen commented Oct 15, 2024

Remote test failures are unrelated, merging.

@rosteen rosteen merged commit 781a027 into astropy:main Oct 15, 2024
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug manipulation Spectral manipulation tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants