Skip to content

Commit

Permalink
adding support for manga cubes
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorris3 committed Apr 10, 2023
1 parent fa65b0d commit 2027a5a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions jdaviz/core/data_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@ def identify_helper(filename, ext=1):
elif n_axes == 1:
return 'specviz'

try:
# try using the specutils registry:
valid_format, config = identify_data(filename)
return config
except ValueError:
# if file type not recognized:
pass

if n_axes == 2 and not has_spectral_axis:
# at this point, non-spectral 2D data are likely images:
return 'imviz'
Expand Down
12 changes: 12 additions & 0 deletions jdaviz/core/tests/test_data_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,15 @@ def test_auto_config_detection(uri, expected_helper):
fn = download_file(url, cache=True)
helper_name = identify_helper(fn)
assert helper_name == expected_helper


@pytest.mark.remote_data
@pytest.mark.filterwarnings(r"ignore::astropy.wcs.wcs.FITSFixedWarning")
def test_auto_config_manga():
# Check that MaNGA cubes go to cubeviz. This file is
# originally from
# https://data.sdss.org/sas/dr14/manga/spectro/redux/v2_1_2/7495/stack/manga-7495-12704-LOGCUBE.fits.gz
URL = 'https://stsci.box.com/shared/static/28a88k1qfipo4yxc4p4d40v4axtlal8y.fits'
fn = download_file(URL, cache=True)
helper_name = identify_helper(fn)
assert helper_name == 'cubeviz'

0 comments on commit 2027a5a

Please sign in to comment.