Skip to content

Commit

Permalink
Include docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
nmearl committed Jun 22, 2020
1 parent dde320d commit 200a9b0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion jdaviz/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def load_data(self, data, data_label=None, format=None):
raise TypeError("`SpectrumCollection` detected. Please "
"provide a `Spectrum1D`.")
elif type(data) is not Spectrum1D:
raise TypeError("Data is not a Spectrum1D object or compatible file")
raise TypeError("Data is not a Spectrum1D object or "
"compatible file.")
self._app.add_data(data, data_label)
self._app.add_data_to_viewer('spectrum-viewer', data_label)

Expand All @@ -63,6 +64,16 @@ def get_spectra(self):
return self._app.get_data_from_viewer('spectrum-viewer')

def get_regions(self):
"""
Retrieves glue subset objects from the spectrum viewer and converts
them to `~specutils.SpectralRegion` objects.
Returns
-------
spec_regs : dict
Dictionary wherein the values are the converted subsets and the
keys are the name reference of the subset objects.
"""
regions = self._app.get_subsets_from_viewer('spectrum-viewer')

spec_regs = {}
Expand Down

0 comments on commit 200a9b0

Please sign in to comment.