Skip to content

Commit

Permalink
Deprecate load_spectrum
Browse files Browse the repository at this point in the history
  • Loading branch information
duytnguyendtn committed Jun 29, 2023
1 parent 40116b9 commit 0bae347
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion jdaviz/configs/specviz/helper.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import warnings

from astropy import units as u
from astropy.utils.decorators import deprecated_renamed_argument
from astropy.utils.decorators import deprecated_renamed_argument, deprecated
from regions.core.core import Region
from glue.core.subset_group import GroupedSubset
from specutils import SpectralRegion, Spectrum1D
Expand Down Expand Up @@ -41,11 +41,35 @@ def __init__(self, *args, **kwargs):
self.app.hub.subscribe(self, RedshiftMessage,
handler=self._redshift_listener)

@deprecated(since="3.6", alternative="specviz.load_data")
def load_spectrum(self, data, data_label=None, format=None, show_in_viewer=True,
concat_by_file=False):
"""
Loads a data file or `~specutils.Spectrum1D` object into Specviz.
Parameters
----------
data : str, `~specutils.Spectrum1D`, or `~specutils.SpectrumList`
Spectrum1D, SpectrumList, or path to compatible data file.
data_label : str
The Glue data label found in the ``DataCollection``.
format : str
Loader format specification used to indicate data format in
`~specutils.Spectrum1D.read` io method.
show_in_viewer : bool
Show data in viewer(s).
concat_by_file : bool
If True and there is more than one available extension, concatenate
the extensions within each spectrum file passed to the parser and
add a concatenated spectrum to the data collection.
"""
self.load_data(data, data_label, format, show_in_viewer, concat_by_file)

def load_data(self, data, data_label=None, format=None, show_in_viewer=True,
concat_by_file=False):
"""
Loads a data file or `~specutils.Spectrum1D` object into Specviz.
Parameters
----------
data : str, `~specutils.Spectrum1D`, or `~specutils.SpectrumList`
Expand Down

0 comments on commit 0bae347

Please sign in to comment.