diff --git a/jdaviz/configs/specviz/helper.py b/jdaviz/configs/specviz/helper.py index ca491f2ac0..dd3791cce0 100644 --- a/jdaviz/configs/specviz/helper.py +++ b/jdaviz/configs/specviz/helper.py @@ -76,7 +76,7 @@ def load_data(self, data, data_label=None, format=None, show_in_viewer=True, `~astropy.utils.data.download_file` or `~astroquery.mast.Conf.timeout`). """ - parser = data_formats.get_parser(data) + parser = data_formats.get_parser(data, load_as_list=load_as_list) if not self._dev_deconfig and parser != 'specviz-spectrum1d-parser': raise NotImplementedError("Only Spectrum1D data is supported in Specviz.") diff --git a/jdaviz/core/data_formats.py b/jdaviz/core/data_formats.py index e959391ade..604c9f1e3f 100644 --- a/jdaviz/core/data_formats.py +++ b/jdaviz/core/data_formats.py @@ -87,7 +87,7 @@ def get_valid_format(filename): return valid_file_format, recommended_config -def get_parser(obj): +def get_parser(obj, show_as_list=False): """ Identify the data parser from a filename or data object @@ -107,7 +107,8 @@ def get_parser(obj): if obj.flux.ndim == 1: return 'specviz-spectrum1d-parser' else: - # TODO: how to determine if multiple spectra or an image? + if show_as_list: + return 'specviz-spectrumlist-parser' return 'mosviz-spec2d-parser' _, config = get_valid_format(obj) parsers = {'specviz': 'specviz-spectrum1d-parser', 'specviz2d': 'mosviz-spec2d-parser'}