desihub / desisim

DESI simulations
BSD 3-Clause "New" or "Revised" License
16 stars 22 forks source link

Same TARGETID,RA,DEC assigned to different simulated targets in MAPLE sim #141

Closed cballand closed 8 years ago

cballand commented 8 years ago

Different targets (with different type and redshift) have been assigned the same TARGETID and (RA,DEC) in different exps of the MAPLE simulation.

As an example, TARGETID=5755267226444861799 corresponds to an ELG at z=1.55605 in exp 7 of night 20160607 and to a STAR at z=0.0005 in exp 13 of the same night:

from astropy.io import fits
simspec7 = fits.getdata('/scratch1/scratchdirs/sjbailey/desi/spectro/sim/maple/20160607/simspec-00000007.fits','METADATA')
simspec13 = fits.getdata('/scratch1/scratchdirs/sjbailey/desi/spectro/sim/maple/20160607/simspec-00000013.fits','METADATA')
fibermap7 = fits.getdata('/scratch1/scratchdirs/sjbailey/desi/spectro/sim/maple/20160607/fibermap-00000007.fits',1)
fibermap13 = fits.getdata('/scratch1/scratchdirs/sjbailey/desi/spectro/sim/maple/20160607/fibermap-00000013.fits',1)
j, = np.where(fibermap7['TARGETID']==5755267226444861799)
k, = np.where(fibermap13['TARGETID']==5755267226444861799)
print j,k,fibermap7['TARGETID'][j],fibermap13['TARGETID'][k],simspec7['REDSHIFT'][j],simspec13['REDSHIFT'][k],simspec7['OBJTYPE'][j],simspec13['OBJTYPE'][k]

[978] [980] [5755267226444861799] [5755267226444861799] [ 1.55605257] [ 0.00049941] ['ELG'] ['MWS_STAR']

The two targets with TARGETID=5755267226444861799 are plotted below from the bricks: brick-{b,r,z}-3125p100.fits. The lower spectrum is an ELG at z=1.55605 (small [OII] emission is visible around 9526 A when zooming).

bug_maple

I've checked that the hemlock simulation does not have this bug.

julienguy commented 8 years ago

This bug prevents us from using the output of redmonster from the maple simulation run because redmonster uses all exposures of a given targetid (a mix of spectra with this bug) in a brick to fit the redshifts.

It would be useful to fix this soon and rerun the pixel level simulations now that the pipeline runs smoothly. This would be useful to check efficiencies, failures, and design a lookup table for quickcat (Christophe and Bob are working on it) on more stats. than zDC1 with all the pipeline artifacts (cosmic rays, sky & calibration errors).

sbailey commented 8 years ago

Argh, I missed seeing this go by. This was fixed with PR #133 (unless there is another bug with the same symptom), but I had forgotten that madrone/maple were generated before that fix was in. I will generate a new simulation and check for consistency of duplicates. I'll post the new simulation location to this ticket before closing it.

sbailey commented 8 years ago

Update:

Investigating...