add DAQ params, better autofocus

This commit is contained in:
2022-09-27 11:11:38 +02:00
parent d8399e901c
commit 30a9c77230
5 changed files with 145 additions and 54 deletions

View File

@@ -447,7 +447,10 @@ class autofocus:
mtr=self._mtr
msk=self._msk
idx=self._idx
p=mot.get_rbv()
p=mot.get_rbv() # the position is only polled at slow rate.
# ŧherefore the received positions are sometimes the same
# could try direct deltatau communications
img16=np.array(cam._pic, np.int16)
sb1=signal.convolve2d(img16, msk, mode='same', boundary='fill', fillvalue=0)
sb2=signal.convolve2d(img16, msk.T, mode='same', boundary='fill', fillvalue=0)
@@ -460,6 +463,8 @@ class autofocus:
_log.debug(f'DONE->{self._idx}')
del cam.process
print(mtr[:idx,:])
mtr[:idx,0]=np.linspace(mtr[0,0],mtr[idx-1,0],idx) # smoothing the positions with equally spaced distances
print(mtr[:idx,:])
mx=mtr[:,1].argmax()
self._af=self.interpolate(mtr[:idx,0], mtr[:idx,1])
return