Skip to content

Commit

Permalink
assuming fits in imviz parser if extension not recognized
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorris3 committed Nov 4, 2022
1 parent b60872b commit 049b59a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions jdaviz/configs/imviz/plugins/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,16 @@ def parse_data(app, file_obj, ext=None, data_label=None):
pf = rgb2gray(im)
pf = pf[::-1, :] # Flip it
_parse_image(app, pf, data_label, ext=ext)
elif file_obj_lower.endswith('.fits'):
with fits.open(file_obj) as pf:
_parse_image(app, pf, data_label, ext=ext)
elif file_obj_lower.endswith('.asdf'):
if rdd is not None:
pf = rdd.open(file_obj)
_parse_image(app, pf, data_label, ext=ext)
else:
with asdf.open(file_obj) as pf:
_parse_image(app, pf, data_label, ext=ext)
else:
raise NotImplementedError(f'File extension is not implemented: {file_obj}')
else: # Assume fits:
with fits.open(file_obj) as pf:
_parse_image(app, pf, data_label, ext=ext)
else:
_parse_image(app, file_obj, data_label, ext=ext)

Expand Down

0 comments on commit 049b59a

Please # to comment.