Skip to content

Commit

Permalink
set x nudge offset to zero in anticipation of new nudge model, modify…
Browse files Browse the repository at this point in the history
… nudge model behavior to clip nudges at the threshold rather than ignore them
  • Loading branch information
csayres committed Sep 13, 2023
1 parent a3d0b87 commit 45b93e8
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/coordio/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,13 +850,20 @@ def applyNudgeModel(
dx = X @ beta_x
dy = X @ beta_y

rejectInds = (numpy.abs(dx) > dxythresh) | (numpy.abs(dy) > dxythresh)
# clip dxs and dys at thresh value
dx[dx>dxythresh] = dxythresh
dy[dy>dxythresh] = dxythresh

dx[dx<-dxythresh] = -dxythresh
dy[dy<-dxythresh] = -dxythresh

# rejectInds = (numpy.abs(dx) > dxythresh) | (numpy.abs(dy) > dxythresh)

newX = x - dx
newY = y - dy

newX[rejectInds] = x[rejectInds]
newY[rejectInds] = y[rejectInds]
# newX[rejectInds] = x[rejectInds]
# newY[rejectInds] = y[rejectInds]

return newX, newY

Expand Down Expand Up @@ -890,7 +897,7 @@ class FVCTransformAPO(object):
rotAngDir = 1
centType = "zbplus2"
telescopePlateScale = 0.060 # mm/arcsec
nudgeOffX = 1000 # fix nudge model after FVC resize
nudgeOffX = 0 #1000 # fix nudge model after FVC resize
site = "APO"
centroidMinNpix = 100

Expand Down Expand Up @@ -1176,7 +1183,6 @@ def extractCentroids(
clipDim = numpy.argmax(self.data_sub.shape)

if clipDim == 0:
print("slicing y")
yOff = int((self.data_sub.shape[0]-self.data_sub.shape[1])/2)
im = self.data_sub[yOff:-yOff, :].copy()

Expand All @@ -1186,7 +1192,6 @@ def extractCentroids(
)
ySimple = ySimple + yOff
else:
print("slicing x")
xOff = int((self.data_sub.shape[1]-self.data_sub.shape[0])/2)
im = self.data_sub[:, xOff:-xOff].copy()

Expand Down

0 comments on commit 45b93e8

Please sign in to comment.