Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_spectra with subset of targetids returns an incomplete exp_fibermap #2125

Closed
moustakas opened this issue Oct 9, 2023 · 0 comments · Fixed by #2126
Closed

read_spectra with subset of targetids returns an incomplete exp_fibermap #2125

moustakas opened this issue Oct 9, 2023 · 0 comments · Fixed by #2126
Labels

Comments

@moustakas
Copy link
Member

#2052 added the option of reading just a subset of targets from a coadd on-disk. However, exp_fibermap returns just one, not all of the targets. E.g.,

import fitsio
from astropy.table import Table
from desispec.io import read_spectra

coaddfile = '/global/cfs/cdirs/desi/spectro/redux/iron/healpix/main/dark/80/8043/coadd-main-dark-8043.fits'

ss = read_spectra(coaddfile)
tid = ss.target_ids()[0]
ss.exp_fibermap[ss.exp_fibermap['TARGETID'] == tid]
<Table length=3>
     TARGETID     PRIORITY     SUBPRIORITY      NIGHT   EXPID  ... DELTA_Y      FIBER_RA          FIBER_DEC     PSF_TO_FIBER_SPECFLUX
      int64        int32         float64        int32   int32  ... float64      float64            float64             float64
----------------- -------- ------------------- -------- ------ ... ------- ------------------ ----------------- ---------------------
39633548168137112     3400 0.08978516089535116 20211026 106241 ...   0.003 139.35589008405674 78.91534653373253    0.7889999999999998
39633548168137112     3400 0.08978516089535116 20211028 106465 ...   0.001 139.35615839768957 78.91535250082687    0.7889999999999998
39633548168137112     3400 0.08978516089535116 20211029 106615 ...   0.003 139.35603447569784 78.91534572805577    0.7889999999999998

But then

s2 = read_spectra(coaddfile, targetids=tid)
s2.exp_fibermap
<Table length=1>
     TARGETID     PRIORITY     SUBPRIORITY      NIGHT   EXPID  ... DELTA_Y      FIBER_RA          FIBER_DEC     PSF_TO_FIBER_SPECFLUX
      int64        int32         float64        int32   int32  ... float64      float64            float64             float64
----------------- -------- ------------------- -------- ------ ... ------- ------------------ ----------------- ---------------------
39633548168137112     3400 0.08978516089535116 20211026 106241 ...   0.003 139.35589008405674 78.91534653373253    0.7889999999999998
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant