Adding redshift and radial velocity properties to SpectrumCollection - #1332
Merged
Conversation
…allows only scalar values
keflavich
reviewed
Jun 12, 2026
keflavich
left a comment
Contributor
There was a problem hiding this comment.
I have some minor wording suggestions.
I'm not sure it is ever right to adopt the first redshift out of a collection if they're not all equal
Comment on lines
+81
to
+83
| if redshift is not None and not (isinstance(redshift, (int, float)) or | ||
| (isinstance(redshift, u.Quantity) and redshift.ndim == 0)): | ||
| raise ValueError("Only single-value redshifts are supported at this time.") |
Contributor
There was a problem hiding this comment.
maybe np.isscalar can replace this logic?
Contributor
Author
There was a problem hiding this comment.
Unfortunately it doesn't work on Quantities, so it can't replace everything here.
Co-authored-by: Adam Ginsburg <keflavich@gmail.com>
Contributor
Author
|
@keflavich I addressed your comments and fixed the failing docs build, I think this is ready for another look. |
keflavich
approved these changes
Jun 17, 2026
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.
Currently only allow scalar values (rather than an array of values matching the number of spectra), and allows shifting the spectral axes with
shift_spectrum_tolikeSpectrumdoes. I also added some clarification to the narrative docs about what exactly is happening when you access a single spectrum from a SpectrumCollection. Allowing array redshifts (one per spectrum in the collection) requires some upstream work in Astropy first.Closes #1318.