You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It must be possible to change the Doppler convention used between "radio", "optical" and "relativistic".
specutils.Spectrum1D provides a with_velocity_convention() method that can handle this, however, it conflicts with the current definition of the dysh.spectra.Spectrum class. An example follows.
The solution does not need to use specutils.Spectrum1D.with_velocity_convention, but it would be good if dysh does not break its functionality.
fromdysh.fits.gbtfitsloadimportGBTFITSLoadfromastropy.utils.dataimportdownload_fileraw_data="http://www.gb.nrao.edu/dysh/example_data/onoff-L/data/TGBT21A_501_11.raw.vegas.fits"raw_data_path=download_file(raw_data)
sdf=GBTFITSLoad(raw_data_path)
tp=sdf.gettp(152, ifnum=0, plnum=0)
ta=tp.timeaverage()
ta[0].with_velocity_convention("radio")
---------------------------------------------------------------------------AttributeErrorTraceback (mostrecentcalllast)
CellIn[44], line1---->1ta[0].with_velocity_convention("radio")
File/home/sandboxes/psalas/Dysh/py3.11-dysh-note/lib/python3.11/site-packages/specutils/spectra/spectrum_mixin.py:132, inOneDSpectrumMixin.with_velocity_convention(self, velocity_convention)
131defwith_velocity_convention(self, velocity_convention):
-->132returnself.__class__(flux=self.flux, wcs=self.wcs, meta=self.meta,
133velocity_convention=velocity_convention)
File/home/sandboxes/psalas/Dysh/dysh/src/dysh/spectra/spectrum.py:61, inSpectrum.__init__(self, *args, **kwargs)
59self._obstime=None60if"CTYPE1"inself.meta:
--->61self._target.topocentric=is_topocentric(self.meta["CTYPE1"])
62self.topocentric=is_topocentric(self.meta["CTYPE1"])
64# if mask is not set via the flux input (NaNs in flux or flux.mask),65# then set the mask to all False == goodAttributeError: 'NoneType'objecthasnoattribute'topocentric'
The text was updated successfully, but these errors were encountered:
It must be possible to change the Doppler convention used between
"radio"
,"optical"
and"relativistic"
.specutils.Spectrum1D
provides awith_velocity_convention()
method that can handle this, however, it conflicts with the current definition of thedysh.spectra.Spectrum
class. An example follows.The solution does not need to use
specutils.Spectrum1D.with_velocity_convention
, but it would be good ifdysh
does not break its functionality.The text was updated successfully, but these errors were encountered: