Skip to content

Commit

Permalink
copy data out of specutils .meta
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Nov 20, 2023
1 parent b59b10a commit d9f7eb0
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions py/desispec/spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,13 +761,32 @@ def from_specutils(cls, spectra):
#
# Load objects that are independent of band from the first item.
#
fibermap = sl[0].meta.get('fibermap', None)
exp_fibermap = sl[0].meta.get('exp_fibermap', None)
meta = sl[0].meta.get('desi_meta', None)
single = sl[0].meta.get('single', False)
scores = sl[0].meta.get('scores', None)
scores_comments = sl[0].meta.get('scores_comments', None)
extra_catalog = sl[0].meta.get('extra_catalog', None)
meta = fibermap = exp_fibermap = scores = scores_comments = extra_catalog = None
try:
meta = sl[0].meta['desi_meta'].copy()
except (KeyError, AttributeError):
pass
try:
fibermap = sl[0].meta['fibermap'].copy()
except (KeyError, AttributeError):
pass
try:
exp_fibermap = sl[0].meta['exp_fibermap'].copy()
except (KeyError, AttributeError):
pass
try:
scores = sl[0].meta['scores'].copy()
except (KeyError, AttributeError):
pass
try:
scores_comments = sl[0].meta['scores_comments'].copy()
except (KeyError, AttributeError):
pass
try:
extra_catalog = sl[0].meta['extra_catalog'].copy()
except (KeyError, AttributeError):
pass
#
# Load band-dependent quantities.
#
Expand Down

0 comments on commit d9f7eb0

Please sign in to comment.