-
Type: Task
-
Status: Won't Fix (View Workflow)
-
Priority: Normal
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:
(I'm still looking for a good example in optical but this is an example in n2) but it looks there is a case that the sky = 0 at BAD_FIBERNORMS pixel. Not sure how fiberNorms get nan. FYI, the fiberProfiles and fiberNorms are generated with the DPR version w.2024.42e. The following code reproduces the problem.
butler = Butler("/work/datastore", collections="u/kiyoyabe/calibs/run19/20241026/verification") visit = 115893 spectrograph = 2 arm = "n" dataId = dict(visit=visit, spectrograph=spectrograph, arm=arm) fiberId=865 fig, axe = plt.subplots(figsize=(8,5)) axe.set_xlim(1156, 1171) axe.set_ylim(-1.0e+04, +2.0e+04) axe.set_title(f"{visit}{arm}{spectrograph} (fiberId={fiberId})") pfsConfig = butler.get("pfsConfig", dataId) pfsArm = butler.get("pfsArm", dataId) wav = pfsArm.wavelength[pfsArm.fiberId==fiberId][0] flx = pfsArm.flux[pfsArm.fiberId==fiberId][0] axe.plot(wav, flx, ls='solid', lw=2, color='C0', rasterized=True, label="pfsArm") pfsArm = butler.get("pfsArm", dataId) sky1d = butler.get("sky1d", dataId) subtractSky1d(pfsArm, pfsConfig, sky1d) wav = pfsArm.wavelength[pfsArm.fiberId==fiberId][0] flx = pfsArm.flux[pfsArm.fiberId==fiberId][0] sky = pfsArm.sky[pfsArm.fiberId==fiberId][0] msk = pfsArm.mask[pfsArm.fiberId==fiberId][0] BAD_FIBERNORMS = msk & pfsArm.flags.get('BAD_FIBERNORMS') != 0 axe.scatter(wav[BAD_FIBERNORMS], np.array([15000. for _ in range(len(wav[BAD_FIBERNORMS]))]), s=5, rasterized=True, label="BAD_FIBERNORMS") axe.plot(wav, sky, ls='solid', lw=2, color='C1', rasterized=True, label="sky") axe.plot(wav, flx, ls='solid', lw=2, color='C2', rasterized=True, label="pfsArm (sky-subtracted)") axe.legend(loc="lower right")