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

Add new module shift with gravitational redshift function #452

Closed
wants to merge 1 commit into from
Closed

Add new module shift with gravitational redshift function #452

wants to merge 1 commit into from

Conversation

tiagopereira
Copy link
Contributor

Here is a suggestion to add a new module shift.py inside specutils.manipulation. This can serve as a place to put functions to perform changes in the spectral axis.

As a first function I added gravitational_redshift, to calculate the redshift due to gravity of a distant object. This is relevant for precision spectroscopy when comparing synthetic and observed spectra. The function assumes an observer on the surface of Earth, as I suspect it is of limited usefulness to make it general. But this should be straightforward to change, if needed. Currently the function only returns a scalar, but one can in the future write an interface for Spectrum1D or similar.

@eteq
Copy link
Member

eteq commented Feb 26, 2019

@tiagopereira - thanks for your idea here! One clarification before more review: this is certainly useful but it looks more like it's about computing the redshift/velocity shift, not actually manipulating spectra. I wonder if this means it's general enough to belong in core astropy? That is, the astropy.coordinates package has some functionality related to this already (e.g. the barycentric correction). Perhaps this should go there (or be integrated into the existing functions) and we should implement manipulation tools that work with that?

@tiagopereira
Copy link
Contributor Author

Hi @eteq , you raise a good point. I didn't notice the coordinates module already had some tools for radial velocity corrections. The current code just gives a Doppler shift, which could easily be converted to line-of-sight velocity. I think this would be general enough for core astropy, but I'm not sure how to best include it in astropy.coordinates. While the gravitational redshift depends on the coordinates of the remote and observing bodies, it is a GR effect that results in photons gaining/losing energy. So this is not really a velocity correction, but more relevant for absolute wavelength calibration.

The current function does not manipulate spectra, but the idea is to have this (and other functions) manipulate the wavelength axis of spectra or the spectral intensity. For example, you can calculate a synthetic spectrum from a model atmosphere. To compare it with an observed spectrum, you need to add the star's gravitational redshift so that both spectra match. You can either transform the synthetic wavelength scale to account for the redshift, or you can keep the same wavelength array and interpolate the spectral data for the new positions. So the point of the shift.py module in specutils.manipulation was to have a place for such tools.

I'm happy to move the gravitational redshift part somewhere else if you think it's useful. Just let me know which location works best. Maybe something like SkyCoord.gravitational_redshift?

SaOgaz pushed a commit that referenced this pull request Mar 25, 2019
@nmearl
Copy link
Contributor

nmearl commented Jun 27, 2019

@eteq, @tiagopereira was there ever consensus on where this should live? Currently, specutils's manipulation module is more concerned with manipulating spectral data, instead of dispersion information, which biases me (slightly) toward this being part of astropy.coordinates. However, I could be convinced either way.

@tiagopereira
Copy link
Contributor Author

@nmearl I don't really mind. To me, it logically makes more sense in specutils since this is dealing with a wavelength calibration of spectra. But on the other hand, having it inside astropy seems better because it is more mature and more widely available.

It also seems that I accidentally deleted the fork where this was coming from (it's been so long that I forgot). Honestly, I've been reluctant to contribute more towards specutils because of the time it takes until the code is made widely available. My last PR was merged into master in February and it still hasn't been put into a release. It is too much work to ask students and collaborators to manually install from git, and so it just doesn't get used.

@nmearl
Copy link
Contributor

nmearl commented Jun 8, 2020

@eteq is this still something we should attempt to put up in astropy proper?

@eteq eteq closed this Mar 22, 2021
@eteq eteq deleted the branch astropy:master March 22, 2021 15:52
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.

None yet

3 participants