redshift/doppler_shift conserving the total flux

Open
#66 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
julia
Domain
data

Research direction

Read the implementations of redshift and doppler_shift to see how they currently transform the spectral axis. Then decide whether flux conservation belongs in those functions or in a separate cosmological observing API, and what options that API needs. Done means agreeing on the intended behavior and API, including how flux scaling relates to luminosity distance.

Written by the indexing model from the issue text.

Description

I noticed that the redshift and doppler_shift functions only shift the spectral_axis according to the redshift or velocity. However, observed cosmologically redshifted or Doppler shifted spectra should also have their flux axis scaled (conserving the flux, or for a full treatment of cosmological redshift and the observed flux density, this would also depend on luminosity distance).

I think this functionality would be good to have in this package, which is the behavior I will be needing. However, I know there are other use cases where the flux scaling is not wanted (template matching comes to mind here). One option could be to add keyword arguments for conserving the total flux, something like:

redshift(spec, z; conserve_flux=false)
doppler_shift(spec, v; relativistic=false, conserve_flux=false)

For the cosmological treatment of observing a redshifted spectrum, perhaps a new function would be more appropriate? For example named observe, observe_redshift, or cosmological_redshift:

observe_redshift(luminosity_spectrum, z; luminosity_distance)
observe_redshift(luminosity_spectrum, z; c::Cosmology) # this could go in a SpectrumBaseCosmologyExt extension

I thought I would first put out these ideas before implementing something concrete. Any thoughts on the general idea or the possible API?

Dominant language
Julia
Stars
5
Forks
9
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaAstro/SpectrumBase.jl

All issues in JuliaAstro/SpectrumBase.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.