Skip to content

Commit

Permalink
simplify apodization code
Browse files Browse the repository at this point in the history
  • Loading branch information
dstndstn committed Jun 8, 2020
1 parent c08ba9a commit 8e4c196
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions py/legacypipe/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,29 +519,17 @@ def get_tractor_image(self, slc=None, radecpoly=None,
rampy = np.arctan(xx)
rampy = (rampy - rampy.min()) / (rampy.max() - rampy.min())

apo = False
#if y0 == 0:
if True:
#debug('Apodize bottom')
invvar[:len(rampy),:] *= rampy[:,np.newaxis]
apo = True
#if x0 == 0:
if True:
#debug('Apodize left')
invvar[:,:len(rampx)] *= rampx[np.newaxis,:]
apo = True
#if y1 >= H:
if True:
#debug('Apodize top')
invvar[-len(rampy):,:] *= rampy[::-1][:,np.newaxis]
apo = True
#if x1 >= W:
if True:
#debug('Apodize right')
invvar[:,-len(rampx):] *= rampx[::-1][np.newaxis,:]
apo = True

if apo and False:
apo = True
# bottom
invvar[:len(rampy),:] *= rampy[:,np.newaxis]
# left
invvar[:,:len(rampx)] *= rampx[np.newaxis,:]
# top
invvar[-len(rampy):,:] *= rampy[::-1][:,np.newaxis]
# right
invvar[:,-len(rampx):] *= rampx[::-1][np.newaxis,:]

if False:
import pylab as plt
plt.clf()
plt.imshow(invvar, interpolation='nearest', origin='lower')
Expand Down

0 comments on commit 8e4c196

Please sign in to comment.