jdaviz: jwst x1d data no longer loadable in specviz
When trying to load JWST x1d spectrum, I now get the following error when loading the data in SpecViz, RuntimeError: Keyword SRCTYPE is None. It should be 'POINT' or 'EXTENDED'. Can't decide between "flux" and "surf_bright" columns.
You can download a notebook for this data using the following url, http://dlarchcf1.stsci.edu:7000/viz/specviz?&filename=jw00736-o039_t001_miri_ch1-long_x1d.fits , and clicking “Open Data in Jupyter”. You may need to setup a MAST API token, at https://auth.mast.stsci.edu. Or just ping me and I can share the data.
Full traceback
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-10-fd670cca78eb> in <module>
1 output='/Users/bcherinka/.astropy/cache/download/url/10be1add87fe0b5d8cd18b1f55e7631d/contents'
----> 2 app.load_data(output)
~/Work/git/havok2063/jdaviz/jdaviz/app.py in load_data(self, file_obj, parser_reference, **kwargs)
295 # If the parser returns something other than known, assume it's
296 # a message we want to make the user aware of.
--> 297 msg = parser(self, file_obj, **kwargs)
298
299 if msg is not None:
~/Work/git/havok2063/jdaviz/jdaviz/configs/specviz/plugins/parsers.py in specviz_spectrum1d_parser(app, data, data_label, format, show_in_viewer)
36
37 if path.is_file():
---> 38 data = Spectrum1D.read(str(path), format=format)
39 else:
40 raise FileNotFoundError("No such file: " + str(path))
~/anaconda3/envs/havokve/lib/python3.8/site-packages/astropy/nddata/mixins/ndio.py in __call__(self, *args, **kwargs)
56
57 def __call__(self, *args, **kwargs):
---> 58 return registry.read(self._cls, *args, **kwargs)
59
60
~/anaconda3/envs/havokve/lib/python3.8/site-packages/astropy/io/registry.py in read(cls, format, cache, *args, **kwargs)
518
519 reader = get_reader(format, cls)
--> 520 data = reader(*args, **kwargs)
521
522 if not isinstance(data, cls):
~/Work/git/havok2063/specutils/specutils/io/default_loaders/jwst_reader.py in jwst_x1d_single_loader(file_obj, **kwargs)
92 The spectrum contained in the file.
93 """
---> 94 spectrum_list = _jwst_x1d_loader(file_obj, **kwargs)
95 if len(spectrum_list) == 1:
96 return spectrum_list[0]
~/Work/git/havok2063/specutils/specutils/io/default_loaders/jwst_reader.py in _jwst_x1d_loader(file_obj, **kwargs)
166
167 else:
--> 168 raise RuntimeError(f"Keyword SRCTYPE is {srctype}. It should "
169 "be 'POINT' or 'EXTENDED'. Can't decide between `flux` and "
170 "`surf_bright` columns.")
RuntimeError: Keyword SRCTYPE is None. It should be 'POINT' or 'EXTENDED'. Can't decide between `flux` and `surf_bright` columns.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 27 (4 by maintainers)
Yeah I think this is resolved and can be closed.
For x1d products the SRCTYPE keyword should always appear in the “EXTRACT1D” extension header. Upstream products, such as “s2d”, “s3d”, “cal” (which are all higher dimensionality, i.e. 2-D or 3-D data) it appears in the “SCI” extension header.
The source_type step in the jwst cal pipeline should be determining a value for SRCTYPE when SRCTYAPT=‘UNKNOWN’. We (the jwst cal pipeline folks) just need to get our hands on the data files to try to figure out why that didn’t happen in these cases. And there’s no one universal answer as to why, because the logic for determining SRCTYPE is dependent on the observing mode.