feat(transforms): add cosmological redshift and Doppler shift support (Issue #28)#46
Open
Akshat1000Sharma wants to merge 1 commit intoJuliaAstro:mainfrom
Open
feat(transforms): add cosmological redshift and Doppler shift support (Issue #28)#46Akshat1000Sharma wants to merge 1 commit intoJuliaAstro:mainfrom
Akshat1000Sharma wants to merge 1 commit intoJuliaAstro:mainfrom
Conversation
…rms; fix Unitful velocity conversion; add docs and tests (Issue JuliaAstro#28)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #46 +/- ##
==========================================
+ Coverage 90.74% 91.71% +0.97%
==========================================
Files 8 9 +1
Lines 162 181 +19
==========================================
+ Hits 147 166 +19
Misses 15 15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Open
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.
Closes #28
Summary
This PR adds cosmological redshift and Doppler shift support to
Spectra.jl, including mutating and non-mutating APIs. It also fixes a Unitful velocity conversion issue in this implementation, adds comprehensive tests, and updates docs. The full test suite passes with no regressions.Issue
Issue #28 (“Tokyo Shift”) requested redshift functionality.
Spectra.jlpreviously had no API to shift the spectral axis by redshiftzor radial velocityv.During implementation, I identified and fixed a Unitful bug where velocities in
km/swere incorrectly scaled due to stripping units without explicit conversion tom/s.Resolution
Added
redshift,redshift!doppler_shift,doppler_shift!transforms.mdFix
Explicit Unitful conversion before stripping:
Review Commands
Run full test suite:
julia --project -e 'using Pkg; Pkg.test()'Run only redshift tests:
julia --project -e 'using Pkg; Pkg.test("Spectra"; test_args="--testset transforms/redshift")'Test Results
All 269 tests pass (including 45 new redshift tests).
No regressions.
Please let me know if any adjustments are needed.