-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] MOSVIZ raises an exception on loading a JWST S2D file. #3300
Comments
Can I work on this? |
The issue with "allow_link_table" not being set to False occurs because:
|
If it helps, what I did in my quick patch was trying to build the link table in a try/except block around line 334, and set allow_link_table to False if there was an exception (because, of course, when given a directory, there may or may not be linked 2D and 1D spectra provided). Because of the current way that we're using jdaviz in our quicklook, where we're investigating individual files, we're currently bypassing the entire thing by treating an s2d file as a list of 2D spectra, where we use a Solara dropdown menu to let the user decide which spectrum to look at, and only load that slit using Specviz2d (because in our normal use case, getting a spectrum up quickly is more important than having everything loaded, because the user will tend to only want to see a couple of slits anyway). Hope I'm not telling you too many things you already know. |
@MarianConstantinMarica - sure, that would be great! No one is actively working on this at the moment, so feel free to open a PR if you find a solution (or reach out here if you have any questions). |
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: