spacetelescope / cubeviz

Data analysis package for cubes. https://cubeviz.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
15 stars 25 forks source link

Converting from Observed to Rest-frame Wavelengths in SpecViz #193

Closed kassin closed 6 years ago

kassin commented 6 years ago

From @bethanjames:

"It would be very useful for the user to apply a redshift value near the wavelength selection tool, that way you could offset the wavelength array and move through the cube in the rest-frame wavelengths."

@nmearl I know this is implemented in the stand-along SpecViz. Do you have a suggestion as how it would work in CubeViz?

@brechmos-stsci

brechmos-stsci commented 6 years ago

@kassin There is some functionality that Jesse is working on for the unit conversion stuff that we could leverage for cubeviz. Is it just a matter of the user having the ability to define an offset the redshift?

kassin commented 6 years ago

Yes, the user would enter the redshift and the spectrum would be shifted to the rest-frame.

brechmos-stsci commented 6 years ago

So, from the non-specviz side of this, I think it would just end up being a change in the internal wavelengths variable for display.

Any change in the redshift, though, we would have to propagate down to specviz.

@nmearl I suspect we are going to want a Message sent from cubeviz or specviz about a redshift change so that both can operate on it. Does that make the most sense?

nmearl commented 6 years ago

@brechmos-stsci indeed! The redshifting behavior only requires that a single float value be provided, so something like

specviz_dispatch.change_redshift.emit(redshift=0.01)

Would be all that's needed from cubeviz.

brechmos-stsci commented 6 years ago

@kassin @hcferguson Is there a specific range of redshifts which are acceptable? (z>0? should it be less than a certain value? or is any numerical value acceptable?)

brechmos-stsci commented 6 years ago

@nmearl I don't see a reshift_changed (or redshift_changed) in specviz. Is that something I need to add or am I just not seeing where it is in specviz?

nmearl commented 6 years ago

Do you want to this change the non-redshift x-axis wavelength values, or just activate the top axis red shift display mode?

brechmos-stsci commented 6 years ago

@nmearl I would assume they are going to want to see the top axis red shift display mode otherwise I think users will find it confusing. What is the name of the dispatch message? I didn't see it.

brechmos-stsci commented 6 years ago

@kassin When you have a minute, could you please see the question above?

nmearl commented 6 years ago

@brechmos-stsci Try pulling specviz master; I think it wasn't exposed properly. But the call should look like

specviz_dispatch.change_redshift.emit(redshift=0.01)
hcferguson commented 6 years ago

@brechmos-stsci While the extragalactic case usually has positive redshift, other science can have sources with both positive and negative radial velocities. For those cases, usually the shifts are expressed in km/s rather than z, though, and those can be positive and negative.

brechmos-stsci commented 6 years ago

@nmearl I think I am not understanding the parameter to change_redshift. Is this the z value in that rest_wavelength = obs_wavelength * (1 + z)?

image

If I put 1 in for the "Axis Mode" Redshift... the bottom axis shows 0.6, I would have though the top "redshifted" axis would be 0.6 * (1 + z) = 1.2 (with redshift z = 1). (I understand that 1 is a huge redshift but it makes the math easier in my head.)

Am I mis-interpreting the redshift value?

kassin commented 6 years ago

@brechmos-stsci The spectrum is at a given redshift. This "deredshifts" it so that it is shown in rest (not observed) wavelengths.

Btw, z=1 is not a large z. I am on a JWST proposal to observe a z=11 lensed galaxy.