GreenBankObservatory / dysh

https://dysh.readthedocs.io
Other
9 stars 3 forks source link

Plotting changes `spectral_axis` of a `Spectrum` #372

Open astrofle opened 2 months ago

astrofle commented 2 months ago

Describe the bug Plotting changes the underlying Spectrum object. This was unexpected.

How to Reproduce

from dysh.spectra import Spectrum
s = Spectrum.fake_spectrum()
ss = s._copy()
ss.plot(xaxis_unit="km/s", vel_frame="icrs")
# Now s and ss are different.
mpound commented 2 months ago

ah, spectrum.velocity_axis_to should call with_frame() not set_frame(). that's my guess.