Skip to content
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

specviz does not support x1dints files #1487

Closed
Jdaviz-Triage-Bot opened this issue Jul 14, 2022 · 12 comments
Closed

specviz does not support x1dints files #1487

Jdaviz-Triage-Bot opened this issue Jul 14, 2022 · 12 comments
Labels

Comments

@Jdaviz-Triage-Bot
Copy link

Reporter: Kyle Conroy

We should either implement support or at least in the meantime detect that we do not support the file format and provide a useful error message.  See #1486


DISCLAIMER: This issue was autocreated by the Jdaviz Issue Creation Bot on behalf of the reporter. If any information is incorrect, please contact Duy Nguyen

@kecnry kecnry changed the title specviz does not support x1d files specviz does not support x1dints files Jul 14, 2022
@pllim pllim added bug Something isn't working specviz labels Jul 14, 2022
@pllim
Copy link
Contributor

pllim commented Jul 14, 2022

I encountered that last night and I wasn't sure if it was the software or data. It only has ASDF extension and no FITS extension, which is weird. And the "JWST x1d" loader cannot recognize it over at specutils.

When I inspect the ASDF tree, it is unclear where the flux is stored.

@pllim
Copy link
Contributor

pllim commented Jul 14, 2022

Why is MAST distributing x1dint file anyway? Where is the final x1d?

@duytnguyendtn
Copy link
Collaborator

According to @camipacifici, the x1dints are level 2 products, and only Mosviz is supposed to be able to view level 2 products. Which tool was the user trying to observe in?

@havok2063
Copy link
Collaborator

havok2063 commented Jul 20, 2022

We do not have yet have full x1dints support in MAST. As in those products in MAST do not show up as load-able in Jdaviz. But I believe Specviz can load them as a SpectrumList. I think those files identify as "JWST x1d multi" format. I have successfully loaded these files.

@havok2063
Copy link
Collaborator

Also the file the user was loading in #1486, jw02734-o002_t002_niriss_clear-gr700xd-substrip256_x1dints.fits is a stage 3 product filename. See https://jwst-pipeline.readthedocs.io/en/latest/jwst/data_products/file_naming.html#stage-3-file-names. And they are in the list of stage 3 data products. See https://jwst-pipeline.readthedocs.io/en/latest/jwst/data_products/product_types.html#stage-3-data-products.

@pllim
Copy link
Contributor

pllim commented Jul 21, 2022

@havok2063 , can you please tell me in plain English what is the way forward here for Jdaviz? I don't use the pipeline and the jwst doc is hard to read.

@havok2063
Copy link
Collaborator

There are x1dints files that a user can download that should be supported by Jdaviz. These minimally behave as specutils.SpectrumList objects, identified as "JWST x1d multi" format, and can be loaded into Specviz as a list of spectra. I don't have my computer right now due to an OS upgrade to verify this and provide example code, but I can provide that when I get it back. This doesn't necessarily mean that Specviz is the ideal or preferred viztool for loading x1dints files. That may be Mosviz, but I'm not sure about that.

@havok2063
Copy link
Collaborator

havok2063 commented Jul 22, 2022

Here is some example code that loads a level 3 x1dints file into Specviz. It loads spectra from all the EXTRACT1D extensions found in the file and I believe creates a combined spectrum. I think this got de facto supported after Ivo worked on a similar ticket to get multi-extension x1d files supported.

file = 'jw00721-o012_t004_nircam_f444w-grismr-subgrism256_x1dints.fits'
s = SpecViz()
s.app
s.load_spectrum(file)

and

import specutils
specutils.io.identify_spectrum_format(file, specutils.SpectrumList)
"JWST x1d multi"

@pllim
Copy link
Contributor

pllim commented Jul 22, 2022

So... you are saying it is supposed to work out of the box already, then why is the ERO file crashing?

@havok2063
Copy link
Collaborator

Looking at the original ticket, they are trying to load the spectrum with viz.load_spectrum(jwst_wasp, data_label='JWST Spectrum', format='JWST x1d'). That may be the problem. These spectra do not identify as "JWST x1d". Either the user needs to remove the incorrect format keyword, or specify format='JWST x1d multi'. But without seeing the full traceback of the error message, it's hard to say if this is the issue. It could also be an issue with the latest pipeline data not being correctly handled by Jdaviz anymore.

@pllim
Copy link
Contributor

pllim commented Jul 22, 2022

Thanks, @havok2063 . I think that clarified things enough that I was able to track it to bad header in the data released. See #1486 (comment)

Nothing much we can do here.

@havok2063
Copy link
Collaborator

Sounds good! If it's a pipeline output error, then perhaps the relevant people on jdat-pipeline should be notified so a ticket can get filed for a bug fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants