Skip to content

Commit

Permalink
sort the fibermap table for zbest files
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Sep 3, 2024
1 parent 98338bb commit 0c52075
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions py/desispec/scripts/zcatalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,14 @@ def read_redrock(rrfile, group=None, recoadd_fibermap=False, minimal=False, pert
log.info('Recoadding fibermap from %s', os.path.basename(spectra_filename))
fibermap_orig = read_table(spectra_filename)
fibermap, expfibermap = coadd_fibermap(fibermap_orig, onetile=pertile)
if zbest_file:
fibermap.sort(['TARGETID'])
else:
fibermap = Table(fx['FIBERMAP'].read())
expfibermap = fx['EXP_FIBERMAP'].read()

assert np.all(redshifts['TARGETID'] == fibermap['TARGETID'])

try:
tsnr2 = fx['TSNR2'].read()
except IOError:
Expand All @@ -150,8 +154,8 @@ def read_redrock(rrfile, group=None, recoadd_fibermap=False, minimal=False, pert
#
tsnr2 = None

assert np.all(redshifts['TARGETID'] == fibermap['TARGETID'])
assert np.all(redshifts['TARGETID'] == tsnr2['TARGETID'])
if tsnr2 is not None:
assert np.all(redshifts['TARGETID'] == tsnr2['TARGETID'])

if minimal:
# basic set of target information
Expand Down

0 comments on commit 0c52075

Please sign in to comment.