Skip to content

Commit

Permalink
Add more spectral x-att options, fix codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
rosteen committed Mar 21, 2022
1 parent 502ca82 commit 80a78bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jdaviz/configs/cubeviz/plugins/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ def _parse_hdu(app, hdulist, file_name=None):

app.add_data(sc, data_label)

# Get id for correct x axis attribute

# If the data type is some kind of integer, assume it's the mask/dq
if hdu.data.dtype in (int, np.uint, np.uint32) or \
any(x in hdu.name.lower() for x in EXT_TYPES['mask']):
Expand All @@ -136,7 +138,10 @@ def _parse_hdu(app, hdulist, file_name=None):
# Add flux to spectrum viewer
app.add_data_to_viewer('spectrum-viewer', data_label)
viewer = app.get_viewer('spectrum-viewer')
viewer.state.x_att = app.data_collection[data_label].id['Wave']
for att_name in ["Wave", "Wavelength", "Freq", "Frequency"]:
if att_name in app.data_collection[data_label].component_ids():
viewer.state.x_att = app.data_collection[data_label].id[att_name]


def _parse_jwst_s3d(app, hdulist, data_label, ext='SCI', viewer_name='flux-viewer'):
from specutils import Spectrum1D
Expand Down

0 comments on commit 80a78bb

Please sign in to comment.