Skip to content

Commit

Permalink
Make edits suggested by Carlos in Issue Keck-DataReductionPipelines#126
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwalawender committed May 31, 2019
1 parent 7bf8247 commit f896a68
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MOSFIRE/Extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def iterate_spatial_profile(P, DmS, V, f,\
weights=weights[~weights.mask])
fit = np.array([fitted_poly(x) for x in xcoord])
resid = (DmS[i]-f*srow)**2 / V[i]
newmask = (resid > sigma)
newmask = (resid > sigma**2)

weights.mask = weights.mask | newmask
srow.mask = srow.mask | newmask
Expand All @@ -434,7 +434,8 @@ def iterate_spatial_profile(P, DmS, V, f,\
info('Row {:3d}: Reset {:d} negative pixels in fit to 0'.format(\
i, np.sum((fit<0))))
fit[(fit < 0)] = 0
Pnew[i] = fit
fit_masked = np.ma.MaskedArray(data=fit, mask=weights.mask)
Pnew[i] = np.ma.filled(fit_masked, 0.0)

return Pnew

Expand Down

0 comments on commit f896a68

Please sign in to comment.