Skip to content

Commit

Permalink
Keep explicit implementation of chop-nod function
Browse files Browse the repository at this point in the history
  • Loading branch information
teutoburg committed Sep 17, 2024
1 parent dca1269 commit a66b971
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scopesim/effects/obs_strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ def chop_nod_image(img, chop_offsets, nod_offsets=None):
if nod_offsets is None:
nod_offsets = tuple(-np.array(chop_offsets))

def _comb_img(_img, offsets):
return _img - np.roll(_img, offsets, (1, 0))
im_aa = np.copy(img)
im_ab = np.roll(im_aa, chop_offsets, (1, 0))
im_ba = np.roll(im_aa, nod_offsets, (1, 0))
im_bb = np.roll(im_ba, chop_offsets, (1, 0))

return _comb_img(_comb_img(img, chop_offsets), nod_offsets)
im_comb = (im_aa - im_ab) - (im_ba - im_bb)
return im_comb

0 comments on commit a66b971

Please sign in to comment.