Skip to content

Commit

Permalink
avoid zero objprofile for failed local sky
Browse files Browse the repository at this point in the history
  • Loading branch information
debora-pe committed Aug 19, 2024
1 parent 5477a59 commit 60a2eac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pypeit/core/skysub.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,10 +974,12 @@ def local_skysub_extract(sciimg, sciivar, tilts, waveimg, global_sky, thismask,
else:
msgs.warn('ERROR: Bspline sky subtraction failed after 4 iterations of bkpt spacing')
msgs.warn(' Moving on......')
obj_profiles = np.zeros_like(obj_profiles)
# obj_profiles = np.zeros_like(obj_profiles)
isub, = np.where(localmask.flatten())
# Just replace with the global sky
skyimage.flat[isub] = global_sky.flat[isub]
if iiter == niter:
msgs.warn('WARNING: LOCAL SKY SUBTRACTION NOT PERFORMED')

outmask_extract = outmask if use_2dmodel_mask else inmask

Expand Down

0 comments on commit 60a2eac

Please sign in to comment.