Skip to content

Unit Error when using JWST wasp-96 spectrum fits file in SpecViz. #1486

Answered by pllim
prashant050701 asked this question in Q&A
Discussion options

You must be logged in to vote

I think the table header is missing TUNIT1 that defines the wavelength unit (in addition to format that should be format='JWST x1d multi'), which I think the data provider needs to fix. cc @havok2063

If you download the file first to a local disk, you can fix it yourself like this:

from astropy.io import fits

filename = 'jw02734-o002_t002_niriss_clear-gr700xd-substrip256_x1dints.fits'

with fits.open(filename, mode='update') as pf:
    for hdu in pf:
        if hdu.name == 'EXTRACT1D' and 'TUNIT1' not in hdu.header:
            hdu.header['TUNIT1'] = 'um'

That said, after the fix is applied and Specviz not longer crashes, it took a long time to load all 840 spectra from that file. Do peo…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pllim
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working Upstream fix required
4 participants