You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If mosvis.load_data() is run with directory=(path to a directory containing a single JWST NIRSpec S2D file), and instrument=nirspec, it crashes in the load_data() function with an error about not being able to find the 1D spectra. In particular, it raises an exception at:
"site-packages/jdaviz/configs/mosviz/plugins/parsers.py" line 131, with the error:
KeyError: 'ComponentID not found or not unique: 1D Spectra'
Tracing the issue, I see that, in the load_data function, in site-packages/jdaviz/configs/mosviz/helper.py lines 333-346, if directory is specified, then Mosviz automatically runs, at line 417, the link_table function, which fails because it tries to link together 2D and 1D spectra, but an S2D file only contains 2D spectra.
Elsewhere in the helper.py file, if only 2D spectra are specified when running load_data, the variable "allow_link_table" is set to False, which would also solve this particular issue.
How to Reproduce
Install Jdaviz 4.0.0 with "pip install jdaviz"
Download the JWST NIRSpec S2D file jw01211013001_08101_00001_nrs2_s2d.fits from MAST, and put it in a directory by itself.
Run python, import Jdaviz, and import Mosviz
Create a Mosviz() object
Run `mosviz.load_data(directory="directory created in step 2", instrument="nirspec")
An error occurs.
Expected behavior
There should not be an exception, and the mosviz object should be able to load the directory. It probably won't be a very satisfying output, because there's no image and no 1D spectra, but it will at least exist, and be possible to display.
Jdaviz component
Mosviz
Description
If
mosvis.load_data()
is run with directory=(path to a directory containing a single JWST NIRSpec S2D file), and instrument=nirspec, it crashes in theload_data()
function with an error about not being able to find the 1D spectra. In particular, it raises an exception at:"site-packages/jdaviz/configs/mosviz/plugins/parsers.py" line 131, with the error:
KeyError: 'ComponentID not found or not unique: 1D Spectra'
Tracing the issue, I see that, in the load_data function, in site-packages/jdaviz/configs/mosviz/helper.py lines 333-346, if directory is specified, then Mosviz automatically runs, at line 417, the link_table function, which fails because it tries to link together 2D and 1D spectra, but an S2D file only contains 2D spectra.
Elsewhere in the helper.py file, if only 2D spectra are specified when running load_data, the variable "allow_link_table" is set to False, which would also solve this particular issue.
How to Reproduce
Expected behavior
There should not be an exception, and the mosviz object should be able to load the directory. It probably won't be a very satisfying output, because there's no image and no 1D spectra, but it will at least exist, and be possible to display.
Browser
No response
Jupyter
N/A
Software versions
🐱
The text was updated successfully, but these errors were encountered: