hit-and-return first release candidate

This commit is contained in:
2024-11-25 16:22:40 +01:00
parent f545812bc1
commit 9888377e13
2 changed files with 71 additions and 43 deletions

View File

@@ -24,6 +24,7 @@ mode:
3 pvt motion using inverse fft velocity
4 pvt motion short code using grid parameters
5 pvt motion short code using grid parameters. Instead of continous motion it moves and waits as give in the parameter time
6 pvt motion 'hit and return using grid parameters. continous motion on 2n ells to pump then same 2n wells to probe, then go 2 rows down
sync:
0 real start and frame trigger with sync
@@ -70,6 +71,7 @@ _log=logging.getLogger(__name__)
import os, sys, time, re
import numpy as np
from hit_return_sim import HitReturnSim
import matplotlib.pyplot as plt
if __name__=="__main__":
@@ -725,7 +727,8 @@ class ShapePath(MotionBase):
common kwargs plus:
trf : transformation that will be done on 'grid points'
grid: grid parameters: {orig:(0,0),pitch(10,10),cnt:(10,10),mode:0}
mode:5 pvt motion short code using grid parameters. Instead of continous motion it moves and waits as give in the parameterstime
mode:5 pvt motion 'stop and go' short code using grid parameters.
Instead of continous motion it moves and waits as given in the parameters
common kwargs plus:
trf : transformation that will be done on 'grid points'
grid: grid parameters: {orig:(0,0),pitch(10,10),cnt:(10,10),mode:0}
@@ -738,7 +741,7 @@ class ShapePath(MotionBase):
grid : grid parameters: {orig:(0,0),pitch(10,10),cnt:(10,10),mode:0}
ssz : section size (in wells)
smv : time(in num of shots) to move to next section (horiz/vert)
default is (ssz[0]-1,ssz[1]+1)
default is (ssz[0]-1,ssz[1])
sdelay: shots count of delay. Default is ssz[0]*ssz[1]
'''
#scan=0 # snake motion X fast, Y slow
@@ -835,11 +838,9 @@ class ShapePath(MotionBase):
g=kwargs['grid']
nx,ny=g['count'] #total count of wells
#TODO: rework pt calculation
xx, yy=np.meshgrid(range(nx), range(ny))
xx=xx.T
yy=yy.T
pt=np.array([xx.reshape(-1), yy.reshape(-1)], dtype=np.float64).transpose() #*pitch
pt=np.tile(pt,(2,1)) # not yet perfect... but at least roughly ok
hrs=HitReturnSim()
pt=hrs.sim_motion(mode=0xff if verb&0x20 else 0x00 , **kwargs)
pt=np.array(pt)[:,:2]
try:
trf=kwargs['trf']
except KeyError as e:
@@ -1341,12 +1342,20 @@ if __name__=='__main__':
sp.setup_motion(fnPrg=fn+'.prg',scale=1.,cnt=1,dwell=100,mode=5,grid=grid,tmove=tmove,twait=twait)
elif mode==6:
grid={'pos':(-1000, -1200), 'pitch':(120, 120), 'count':(16, 20)}
# section size (in wells)
#ssz=(4, 5)
ssz=(6, 10)
#ssz=(2, 5)
#sdelay=ssz[0]*ssz[1] # wait after <swait> section for motion trigger. swait=0:never wait
ssz=(6, 10) # section size (in wells)
smv=(ssz[0]-1+4,ssz[1]+1+8) # time(in num of shots) to move to next section (horiz/vert)
sdelay=ssz[0]*ssz[1]+5 # wait after <swait> section for motion trigger. swait=0:never wait
sp.setup_motion(fnPrg=fn+'.prg',scale=1.,cnt=1,dwell=100,mode=6,grid=grid,ssz=ssz,smv=smv,sdelay=sdelay)
elif mode==61: #other mode 6
grid={'pos':(-1000, -1200), 'pitch':(120, 120), 'count':(85, 60)}
ssz=(20, 12) # section size (in wells)
sp.setup_motion(fnPrg=fn+'.prg',scale=1.,cnt=1,dwell=100,mode=6,grid=grid,ssz=ssz)
elif mode==62: #other mode 6
grid={'pos':(-1000, -1200), 'pitch':(120, 120), 'count':(30, 20)}
ssz=(2, 10) # section size (in wells)
sp.setup_motion(fnPrg=fn+'.prg',scale=1.,cnt=1,dwell=100,mode=6,grid=grid,ssz=ssz)
else:
raise(ValueError(f'unsupported mode:{mode}'))
@@ -1378,6 +1387,9 @@ if __name__=='__main__':
'--host=SAR-CPPM-EXPMX1 -v0x5d',
'--host=localhost:10001:10002 -v0x59',
'--host=SAR-CPPM-EXPMX1 -v0x5d -m5',
'--host=localhost:10001:10002 -v0x7d -m6',
'--host=localhost:10001:10002 -v0x5d -m61',
'--host=localhost:10001:10002 -v0x7d -m62'
)
epilog=__doc__+'\nExamples:'+''.join(map(lambda s:cmd+s, exampleCmd))+'\n '
parser=argparse.ArgumentParser(epilog=epilog, formatter_class=argparse.RawDescriptionHelpFormatter)