From 54e4d65cf5a54c2c92212ef2b1d5a38a32de9e3b Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Wed, 11 Oct 2023 14:09:27 -0400 Subject: [PATCH] BUG: Cubeviz to recognize VLT MUSE data --- CHANGES.rst | 2 ++ jdaviz/configs/cubeviz/plugins/parsers.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 700e34caec..0e7a024dd0 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -86,6 +86,8 @@ Cubeviz - Fixed moment map losing WCS when being written out to FITS file. [#2431] +- Fixed parsing for VLT MUSE data cube so spectral axis unit is correctly converted. [#2504] + Imviz ^^^^^ diff --git a/jdaviz/configs/cubeviz/plugins/parsers.py b/jdaviz/configs/cubeviz/plugins/parsers.py index 54f8463074..91ee444427 100644 --- a/jdaviz/configs/cubeviz/plugins/parsers.py +++ b/jdaviz/configs/cubeviz/plugins/parsers.py @@ -143,7 +143,7 @@ def _return_spectrum_with_correct_units(flux, wcs, metadata, data_type, target_w if target_wave_unit is None and hdulist is not None: found_target = False - for ext in ('SCI', 'FLUX', 'PRIMARY'): # In priority order + for ext in ('SCI', 'FLUX', 'PRIMARY', 'DATA'): # In priority order if found_target: break if ext not in hdulist: @@ -153,7 +153,7 @@ def _return_spectrum_with_correct_units(flux, wcs, metadata, data_type, target_w for cunit_num in (3, 1): cunit_key = f"CUNIT{cunit_num}" ctype_key = f"CTYPE{cunit_num}" - if cunit_key in hdr and 'WAVE' in hdr[ctype_key]: + if cunit_key in hdr and 'WAV' in hdr[ctype_key]: target_wave_unit = u.Unit(hdr[cunit_key]) found_target = True break