try to cleanup stuff
This commit is contained in:
@@ -518,21 +518,13 @@ class FixTargetFrame(UsrROI):
|
|||||||
|
|
||||||
def get_scan_param(self):
|
def get_scan_param(self):
|
||||||
'returns scan parameters for scanning with deltatau. the format is as used for shapepath'
|
'returns scan parameters for scanning with deltatau. the format is as used for shapepath'
|
||||||
scan=1 # snake motion Y fast, X slow (default)
|
|
||||||
grid=self._dscr['grid']
|
grid=self._dscr['grid']
|
||||||
self._dscr['size']
|
use_trf=self._param.get('use_trf', True) # do not use coordinate transformation
|
||||||
cnt =np.array(grid['count'],np.int32)
|
mode=self._param.get('mode',1)
|
||||||
xx, yy=np.meshgrid(range(cnt[0]), range(cnt[1]))
|
cnt=np.array(grid['count'], np.int32)
|
||||||
if scan==0: # snake motion X fast, Y slow
|
num_pts=cnt.prod()
|
||||||
for i in range(1,cnt[1],2):
|
param={'num_pts':num_pts}
|
||||||
xx[i]=xx[i][::-1]
|
param.update(self._param)
|
||||||
else: # scan==1 # snake motion Y fast, X slow (default)
|
|
||||||
xx=xx.T
|
|
||||||
yy=yy.T
|
|
||||||
for i in range(1, cnt[0], 2):
|
|
||||||
yy[i]=yy[i][::-1]
|
|
||||||
|
|
||||||
pts=np.array([xx.reshape(-1), yy.reshape(-1)], dtype=np.float64).transpose() #*pitch
|
|
||||||
|
|
||||||
# TODO: simplify !!!
|
# TODO: simplify !!!
|
||||||
t=self.transform() #obj_info(t)
|
t=self.transform() #obj_info(t)
|
||||||
@@ -549,9 +541,32 @@ class FixTargetFrame(UsrROI):
|
|||||||
trf2*=np.asmatrix(((1000, 0, 0), (0, 1000, 0), (0, 0, 1)))
|
trf2*=np.asmatrix(((1000, 0, 0), (0, 1000, 0), (0, 0, 1)))
|
||||||
trf3=np.asmatrix(((pitch[0], 0, 0), (0, pitch[1], 0), (pos[0], pos[1], 1)))
|
trf3=np.asmatrix(((pitch[0], 0, 0), (0, pitch[1], 0), (pos[0], pos[1], 1)))
|
||||||
trf=(trf3*trf2)[:, :2]
|
trf=(trf3*trf2)[:, :2]
|
||||||
param={'grid':grid, 'points':pts, 'trf':trf}
|
|
||||||
param.update(self._param)
|
|
||||||
|
|
||||||
|
if mode in (1,3): # needs all points, not grid
|
||||||
|
scan=1 # snake motion Y fast, X slow (default)
|
||||||
|
xx, yy=np.meshgrid(range(cnt[0]), range(cnt[1]))
|
||||||
|
if scan==0: # snake motion X fast, Y slow
|
||||||
|
for i in range(1,cnt[1],2):
|
||||||
|
xx[i]=xx[i][::-1]
|
||||||
|
else: # scan==1 # snake motion Y fast, X slow (default)
|
||||||
|
xx=xx.T
|
||||||
|
yy=yy.T
|
||||||
|
for i in range(1, cnt[0], 2):
|
||||||
|
yy[i]=yy[i][::-1]
|
||||||
|
|
||||||
|
pts=np.array([xx.reshape(-1), yy.reshape(-1)], dtype=np.float64).transpose() #*pitch
|
||||||
|
|
||||||
|
if not use_trf:
|
||||||
|
pts=(np.hstack((pts, np.ones((pts.shape[0], 1))))*trf).A
|
||||||
|
param['trf']=trf
|
||||||
|
param['points']=pts
|
||||||
|
else:
|
||||||
|
if use_trf:
|
||||||
|
param.update({'grid':grid, 'trf':trf})
|
||||||
|
else:
|
||||||
|
g=grid.copy() #has not be tested !
|
||||||
|
g['pos']=tuple((np.array((0,0,1))*trf).A.reshape(-1).tolist())
|
||||||
|
param.update({'grid':p, 'trf':trf})
|
||||||
return param
|
return param
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1535,11 +1535,6 @@ class WndSwissMx(QMainWindow, Ui_MainWindow):
|
|||||||
except AttributeError as e:
|
except AttributeError as e:
|
||||||
_log.warning(f'no scan parameters for object->skipped:{go}')
|
_log.warning(f'no scan parameters for object->skipped:{go}')
|
||||||
continue
|
continue
|
||||||
trf=np.asmatrix(param['trf'])
|
|
||||||
p=param['points']
|
|
||||||
p=(np.hstack((p,np.ones((p.shape[0],1))))*trf).A
|
|
||||||
param['pts_trf']=p # transformed points in um motor coordinates
|
|
||||||
param['num_pts']=p.shape[0]
|
|
||||||
vb=self.vb
|
vb=self.vb
|
||||||
grp=self._goTracked
|
grp=self._goTracked
|
||||||
mft=self._moduleFixTarget
|
mft=self._moduleFixTarget
|
||||||
@@ -2357,10 +2352,6 @@ object settings:
|
|||||||
use_trf=kwargs.get('use_trf', True) # do not use coordinate transformation
|
use_trf=kwargs.get('use_trf', True) # do not use coordinate transformation
|
||||||
if not 'mode' in kwargs:
|
if not 'mode' in kwargs:
|
||||||
kwargs['mode']=1
|
kwargs['mode']=1
|
||||||
if not use_trf:
|
|
||||||
trf=kwargs.pop('trf')
|
|
||||||
points=kwargs['points']
|
|
||||||
kwargs['points']=kwargs.pop('pts_trf')
|
|
||||||
|
|
||||||
sp.setup_sync(verbose=sp.verbose&0x40, timeOfs=dt_misc['time_ofs'], timeCor=dt_misc['time_cor'])
|
sp.setup_sync(verbose=sp.verbose&0x40, timeOfs=dt_misc['time_ofs'], timeCor=dt_misc['time_cor'])
|
||||||
dlg.setLabelText("Download motion program");dlg+=5
|
dlg.setLabelText("Download motion program");dlg+=5
|
||||||
|
|||||||
Reference in New Issue
Block a user