minor changes

This commit is contained in:
2022-08-30 10:07:50 +02:00
parent f47e111e65
commit d52a6cebba
6 changed files with 49 additions and 16 deletions

View File

@@ -1256,4 +1256,22 @@ lsof -i -n | grep '127.0.0.1:1000'
. .
Make z to move over the grid.
&0
#1->0
#2->0
#3->0
#4->0
#5->0
#6->0
#7->0
#8->0
&1
#1->y
#2->x
#5->.1x+.1y-1400
?? what are the PV for the camera, zoom etc ???

View File

@@ -17,11 +17,11 @@ file asyn.template {{P="$(P_M)1", PORT=$(PORT_M)}}
file PPMACMotor.template { file PPMACMotor.template {
pattern{ DESC , P , M , PORT , ADDR, DIR, VELO, HVEL, ACCL, JAR, MRES , PREC, EGU , DHLM, DLLM} pattern{ DESC , P , M , PORT , ADDR, DIR, VELO, HVEL, ACCL, JAR, MRES , PREC, EGU , DHLM, DLLM}
{ "Sample F-Trans Y", "$(P_M)", "MOT_FY" , "$(PORT_M)", 1 , 0 , 2 , 2 , 0.1 , 20 , 0.001, 3 , "mm" , 0 , 0 } { "Sample F-Trans Y", "$(P_M)", "MOT_FY" , "$(PORT_M)", 1 , 0 , 2 , 2 , 0.1 , 20 , 0.001, 4 , "mm" , 0 , 0 }
{ "Sample F-Trans X", "$(P_M)", "MOT_FX" , "$(PORT_M)", 2 , 1 , 2 , 2 , 0.1 , 20 , 0.001, 3 , "mm" , 0 , 0 } { "Sample F-Trans X", "$(P_M)", "MOT_FX" , "$(PORT_M)", 2 , 1 , 2 , 2 , 0.1 , 20 , 0.001, 4 , "mm" , 0 , 0 }
{ "Rotation Y" , "$(P_M)", "MOT_ROT_Y", "$(PORT_M)", 3 , 0 , 50 , 50 , 0.1 , 20 , 0.001, 3 , "deg", 0 , 0 } { "Rotation Y" , "$(P_M)", "MOT_ROT_Y", "$(PORT_M)", 3 , 0 , 50 , 50 , 0.1 , 20 , 0.001, 4 , "deg", 0 , 0 }
{ "Sample C-Trans X", "$(P_M)", "MOT_CX" , "$(PORT_M)", 4 , 1 , 2 , 2 , 0.1 , 20 , 0.001, 3 , "mm" , 0 , 0 } { "Sample C-Trans X", "$(P_M)", "MOT_CX" , "$(PORT_M)", 4 , 1 , 2 , 2 , 0.1 , 20 , 0.001, 4 , "mm" , 0 , 0 }
{ "Sample C-Trans Z", "$(P_M)", "MOT_CZ" , "$(PORT_M)", 5 , 1 , 2 , 2 , 0.1 , 20 , 0.001, 3 , "mm" , 0 , 0 } { "Sample C-Trans Z", "$(P_M)", "MOT_CZ" , "$(PORT_M)", 5 , 1 , 2 , 2 , 0.1 , 20 , 0.001, 4 , "mm" , 0 , 0 }
{ "Interfero Y" , "$(P_M)", "ENC_FY" , "$(PORT_M)", 6 , 0 , 2 , 2 , 0.1 , 20 , 0.001, 3 , "mm" , 0 , 0 } { "Interfero Y" , "$(P_M)", "ENC_FY" , "$(PORT_M)", 6 , 0 , 2 , 2 , 0.1 , 20 , 0.001, 4 , "mm" , 0 , 0 }
{ "Interfero X" , "$(P_M)", "ENC_FX" , "$(PORT_M)", 7 , 0 , 2 , 2 , 0.1 , 20 , 0.001, 3 , "mm" , 0 , 0 } { "Interfero X" , "$(P_M)", "ENC_FX" , "$(PORT_M)", 7 , 0 , 2 , 2 , 0.1 , 20 , 0.001, 4 , "mm" , 0 , 0 }
} }

View File

@@ -269,7 +269,7 @@ class MPLCanvasImg(FigureCanvas):
#print scale,vS #print scale,vS
colBar.norm.vmin = vS-scale*(vS-vmin) colBar.norm.vmin = vS-scale*(vS-vmin)
colBar.norm.vmax = vS-scale*(vS-vmax) colBar.norm.vmax = vS-scale*(vS-vmax)
self.img.set_norm(colBar.norm)#force image to redraw self._goImg.set_norm(colBar.norm)#force image to redraw
colBar.patch.figure.canvas.draw() colBar.patch.figure.canvas.draw()
def OnKeyPress(self, event): def OnKeyPress(self, event):

View File

@@ -49,7 +49,7 @@ Implemented messages
def OpenFile(self, fn_npz): def OpenFile(self, fn_npz):
try: try:
self.fh=fh=np.load(fn_npz) self.fh=fh=np.load(fn_npz,allow_pickle=True)
except IOError as e: except IOError as e:
sys.stderr.write('Unable to open File: '+fn_npz+'\n') sys.stderr.write('Unable to open File: '+fn_npz+'\n')
else: else:

View File

@@ -354,7 +354,7 @@ class DlgColBarSetup(wx.Dialog):
colBar=canvas.colBar colBar=canvas.colBar
cmap=colBar.cmap cmap=colBar.cmap
nrm=colBar.norm nrm=colBar.norm
img=canvas.img img=canvas._goImg
ax=img.get_axes() ax=img.get_axes()
data=img.get_array() data=img.get_array()
@@ -462,10 +462,10 @@ class HdfImageFrame(wx.Frame):
try: try:
tomoNorm=imgFrm.tomoNorm tomoNorm=imgFrm.tomoNorm
except AttributeError: except AttributeError:
imgFrm.canvas.img.set_array(data) imgFrm.canvas._goImg.set_array(data)
else: else:
data=data*tomoNorm data=data*tomoNorm
imgFrm.canvas.img.set_array(data) imgFrm.canvas._goImg.set_array(data)
imgFrm.canvas.draw() imgFrm.canvas.draw()
pass pass

View File

@@ -46,6 +46,15 @@ Port 22 on PowerBrick is the ssh server port
Port 2332 on PowerBrick is the gather port of gather_server Port 2332 on PowerBrick is the gather port of gather_server
PPMAC=SAR-CPPM-EXPMX1 PPMAC=SAR-CPPM-EXPMX1
rsync -vai ~/Documents/prj/SwissFEL/PBTools/pbtools/gather/gather_server root@$PPMAC:/tmp/
ssh root@$PPMAC
LD_LIBRARY_PATH=/opt/ppmac/libppmac/ /tmp/gather_server
rsync -vai ~/Documents/prj/SwissFEL/PBTools/pbtools/gather/gather_server root@$PPMAC:/tmp
ssh -L 10001:localhost:22 root@$PPMAC 'uname -a' ssh -L 10001:localhost:22 root@$PPMAC 'uname -a'
ssh -L 10002:localhost:2332 root@$PPMAC 'uname -a' ssh -L 10002:localhost:2332 root@$PPMAC 'uname -a'
-> this tunnels port 22 and 2332 of $PPMAC to 10001 and 10002 of localhost -> this tunnels port 22 and 2332 of $PPMAC to 10001 and 10002 of localhost
@@ -635,11 +644,11 @@ class ShapePath(MotionBase):
self.ptsCorr=ptsCorr self.ptsCorr=ptsCorr
print(ptsCorr) print(ptsCorr)
def setup_gather(self,acq_per=1): def setup_gather(self,acq_per=None):
''' '''
setup the channels to gather setup the channels to gather
kwargs: kwargs:
acq_per : acquire period: acquire data all acq_per servo loops (default=1) acq_per : acquire period: acquire data all acq_per servo loops (default=None->calc best, =1-> fastest)
''' '''
if self.comm is None: return if self.comm is None: return
comm=self.comm comm=self.comm
@@ -650,8 +659,12 @@ class ShapePath(MotionBase):
else: else:
address=("Motor[1].ActPos","Motor[2].ActPos","Motor[1].DesPos","Motor[2].DesPos","Gate3[1].Chan[1].UserFlag") address=("Motor[1].ActPos","Motor[2].ActPos","Motor[1].DesPos","Motor[2].DesPos","Gate3[1].Chan[1].UserFlag")
gt.set_address(*address) gtMaxLn=gt.set_address(*address)
if acq_per is None:
ovhdTime=100
acq_per=int(np.ceil((self.meta['pt2pt_time']*self.points.shape[0]+ovhdTime)/(gtMaxLn*self.meta['srv_per'])))
gt.set_property(MaxSamples=1000000, Period=acq_per) gt.set_property(MaxSamples=1000000, Period=acq_per)
#gt.set_property(Period=acq_per)
self.meta.update({'acq_per':acq_per,'address':address}) self.meta.update({'acq_per':acq_per,'address':address})
def setup_coord_trf(self): def setup_coord_trf(self):
@@ -896,7 +909,9 @@ if __name__=='__main__':
#sp.gen_spiral_points(rStart=100,rInc=10,numSeg=4,numCir=60, ofs=(0, 0)) #sp.gen_spiral_points(rStart=100,rInc=10,numSeg=4,numCir=60, ofs=(0, 0))
#sp.gen_spiral_points(rStart=100,rInc=130,numSeg=4,numCir=2, ofs=(0, 0)) #sp.gen_spiral_points(rStart=100,rInc=130,numSeg=4,numCir=2, ofs=(0, 0))
#sp.gen_grid_points(w=20,h=20,pitch=100,rnd=0,ofs=(0,+2000));sp.sort_points(False); #sp.gen_grid_points(w=20,h=20,pitch=100,rnd=0,ofs=(0,+2000));sp.sort_points(False);
sp.gen_grid_points(w=5,h=10,pitch=100,rnd=0,ofs=(0,+2000));sp.sort_points(False,10); #sp.gen_grid_points(w=5,h=10,pitch=100,rnd=0,ofs=(0,+2000));sp.sort_points(False,10);
sp.gen_grid_points(w=125,h=125,pitch=3,rnd=0,ofs=(0,+2000));sp.sort_points(False,125); sp.meta['pt2pt_time']=5
#sp.gen_grid_points(w=1,h=10,pitch=100,rnd=0,ofs=(0,0)) #sp.gen_grid_points(w=1,h=10,pitch=100,rnd=0,ofs=(0,0))
#sp.gen_spiral_points(rStart=100,rInc=20,numSeg=8,numCir=32, ofs=(0, 0)) #sp.gen_spiral_points(rStart=100,rInc=20,numSeg=8,numCir=32, ofs=(0, 0))
#sp.gen_spiral_points(rStart=100,rInc=10,numSeg=2,numCir=32, phase=45, ofs=(0, 0)) #sp.gen_spiral_points(rStart=100,rInc=10,numSeg=2,numCir=32, phase=45, ofs=(0, 0))