major fixes in coordinate systems

This commit is contained in:
2022-09-02 15:30:14 +02:00
parent 45e8ab680f
commit 6e3e1cd8ab
3 changed files with 34 additions and 13 deletions

View File

@@ -170,7 +170,7 @@ class Fiducial(pg.ROI):
#p.drawText(24, 20, 'beam marker')
ctr=tuple(self.pos()+self.size()/2)
sz=tuple(self.size())
print((*ctr,self._z))
#print((*ctr,self._z))
#p.drawText(5, 25, 'x{:.4g}\ny{:.4g}\nz{:.4g}'.format(*ctr,self._z))
p.drawText(52, 10,40,40,Qt.TextWordWrap, 'x{:.5g}\ny{:.5g}\nz{:.5g}'.format(*ctr,self._z))
@@ -504,9 +504,11 @@ class FixTargetFrame(pg.ROI):
t=self.transform()
p=np.array(self.pos())
s=self.size()/self._dscr['size']
trf=np.array(((t.m11(),t.m12(),0),(t.m21(),t.m22(),0)))
trf[:,2]=p
trf[:,:2]*=s
trf=np.array(((t.m11(),t.m12()),(t.m21(),t.m22()),(0,0)))
trf[2,:]=p # shift origin
#trf[:2, 0]*=s[0];trf[:2, 1]*=s[1] #scaling (before rotation shear)
trf[:2,:]=(trf[:2,:].T*s).T # same as np.asmatrix(np.diag(s))*trf[:2,:], trf[:2,:]*=s not working, scale before rot / shear
# trf*'gridpos in um' -> motor pos in mm
param['trf']=trf
return param