various fixes (post_sample_tube, timing etc.)

This commit is contained in:
2022-09-28 14:52:13 +02:00
parent 30a9c77230
commit a186d256d3
6 changed files with 29 additions and 20 deletions

View File

@@ -1,24 +1,31 @@
[General] [General]
last_active=1663769422.4605258 last_active=1664276013.1896968
[daq]
bs_channels=['SARES30-LSCP1-CRISTA1:CH0:1']
detector="{'name': 'JF17T16V01', 'adc_to_energy': true, 'compression': true, 'factor': 11.33, 'geometry': true, 'double_pixel_action': 'mask', 'remove_raw_files': false}"
location="{'end_station': 'cristallina', 'p_group': 'p20516'}"
pv_channels=[]
run="{'prefix': '', 'id': 0}"
[default_position] [default_position]
backlight="{'pos_in': -29000.0, 'pos_out': 0.0}" backlight="{'pos_in': -29000.0, 'pos_out': 0.0}"
collimator="{'x_in': 10.00044, 'y_in': -2.322981, 'x_out': 10.00044, 'y_out': -2.322981}" collimator="{'x_in': -12.0, 'y_in': -2.322981, 'x_out': 10.00044, 'y_out': -2.322981}"
detector="{'pos_in': 5.0, 'pos_out': 10.0}" detector="{'pos_in': 5.0, 'pos_out': 50.0}"
post_sample_tube="{'x_in_us': -0.15010000000000012, 'y_in_us': -5.887284999999999, 'x_in_ds': -0.06905500000000053, 'y_in_ds': -5.831288, 'x_out_delta': 0.0, 'y_out_delta': -5.0, 'z_in': -3.53931, 'z_out': -3.53931}" post_sample_tube="{'x_in_us': 2.85, 'y_in_us': 8.35064, 'x_in_ds': 2.93104, 'y_in_ds': 10.62, 'x_out_delta': 0.0, 'y_out_delta': -22.954, 'z_in': -3.53931, 'z_out': -3.539328}"
[deltatau] [deltatau]
host=SAR-CPPM-EXPMX1 host=SAR-CPPM-EXPMX1
miscellaneous="{'show_plots': true, 'vel_scl': 1.0, 'pt2pt_time': 10.0, 'sync_mode': 1, 'sync_flag': 3, 'verbose': 89}" miscellaneous="{'show_plots': true, 'vel_scl': 1.0, 'pt2pt_time': 10.0, 'sync_mode': 1, 'sync_flag': 3, 'verbose': 89}"
[geometry] [geometry]
autofocus="{'range': 1.0, 'velocity': 0.3, 'steps': 40, 'mode': 0}" autofocus="{'range': 1.0, 'velocity': 0.4, 'steps': 40, 'mode': 0}"
beam_pos=86.37327847910599, 189.0894517936895 beam_pos=34.84487958579134, 138.23790974183828
beam_size=30.2, 25.6 beam_size=30.2, 25.6
cam_param="{'gain': 10.0, 'exposure': 3.0, 'binning': [1, 1], 'roi': [500, 1000, 1200, 1000], 'mono8': true}" cam_param="{'gain': 10.0, 'exposure': 3.0, 'binning': [1, 1], 'roi': [500, 1000, 1200, 1000], 'mono8': true}"
cam_trf="[[-1, 0, 0], [0, -1, 0], [0, 0, 1]]" cam_trf="[[-1, 0, 0], [0, -1, 0], [0, 0, 1]]"
find_fiducial="{'sz': 101, 'brd': 8, 'pitch': 120, 'mode': 0}" find_fiducial="{'sz': 101, 'brd': 8, 'pitch': 120, 'mode': 0}"
opt_ctr=737.1648014091753, 30.84271709492559 opt_ctr=737.0380393800098, 37.58539167668356
pix2pos="[[1.0, 200.0, 400.0, 600.0, 800.0, 1000.0], [[[0.0011874776687831395, -3.874764193468664e-05], [-5.4202986411567655e-05, -0.0012020847338041858]], [[0.0008127767655446629, -2.5687142750131126e-05], [-3.525888389999674e-05, -0.000811545167142383]], [[0.0004932915647684639, -1.956448914762613e-05], [-2.260500843716497e-05, -0.0004979981531104616]], [[0.0002968132362841801, -1.3764033542843857e-05], [-1.1834139121941054e-05, -0.00030116315471687166]], [[0.00017925202767093252, -6.260148136189963e-06], [-7.57394284404282e-06, -0.00018089723447695783]], [[0.00010341140632662017, -6.93242588696217e-06], [-4.854849034530776e-06, -0.00010722678626793494]]]]" pix2pos="[[1.0, 200.0, 400.0, 600.0, 800.0, 1000.0], [[[0.0011874776687831395, -3.874764193468664e-05], [-5.4202986411567655e-05, -0.0012020847338041858]], [[0.0008127767655446629, -2.5687142750131126e-05], [-3.525888389999674e-05, -0.000811545167142383]], [[0.0004932915647684639, -1.956448914762613e-05], [-2.260500843716497e-05, -0.0004979981531104616]], [[0.0002968132362841801, -1.3764033542843857e-05], [-1.1834139121941054e-05, -0.00030116315471687166]], [[0.00017925202767093252, -6.260148136189963e-06], [-7.57394284404282e-06, -0.00018089723447695783]], [[0.00010341140632662017, -6.93242588696217e-06], [-4.854849034530776e-06, -0.00010722678626793494]]]]"
[global] [global]
@@ -26,6 +33,6 @@ device_prefix=SAR-EXPMX, SARES30-ESBMX
miscellaneous={'img_trace_len': 16} miscellaneous={'img_trace_len': 16}
[window] [window]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x2\0\0\0\0\x4\xc0\0\0\x2\xa0\0\0\v\xd5\0\0\ax\0\0\x4\xc0\0\0\x2\xc5\0\0\v\xd5\0\0\ax\0\0\0\0\0\0\0\0\xf\0) geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\xb6\0\0\0\x61\0\0\t\x12\0\0\x4\xfc\0\0\0\xb6\0\0\0\x86\0\0\t\x12\0\0\x4\xfc\0\0\0\0\0\0\0\0\n\0\0\0\0\xb6\0\0\0\x86\0\0\t\x12\0\0\x4\xfc)
splitter=534, 871, 397 splitter=757, 969, 403
state=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\a\x16\0\0\x4<\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\xe\0t\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0) state=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\b]\0\0\x3\xff\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\xe\0t\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)

View File

@@ -497,7 +497,9 @@ verbose bits:
s=param.value() s=param.value()
lst=s.split(' ') if len(s)>0 else () lst=s.split(' ') if len(s)>0 else ()
cfg.setValue(nm,lst) cfg.setValue(nm,lst)
elif par_nm in (AppCfg.GBL_MISC,AppCfg.DT_MISC,AppCfg.GEO_FND_FID,AppCfg.GEO_AUTOFOC): elif par_nm in (AppCfg.GBL_MISC,AppCfg.DT_MISC,
AppCfg.GEO_FND_FID,AppCfg.GEO_AUTOFOC,
AppCfg.DAQ_DET,AppCfg.DAQ_LOC,AppCfg.DAQ_RUN):
d=dict(map(lambda x:(x.name(),x.value()), parent.children())) d=dict(map(lambda x:(x.name(),x.value()), parent.children()))
cfg.setValue(par_nm, d) cfg.setValue(par_nm, d)
if par_nm in (AppCfg.GBL_MISC): if par_nm in (AppCfg.GBL_MISC):
@@ -545,8 +547,8 @@ verbose bits:
if pos=='in': if pos=='in':
lut=((0,'tube_usx'),(1,'tube_usy'),(2,'tube_dsx'),(3,'tube_dsy'),(6,'tube_z')) lut=((0,'tube_usx'),(1,'tube_usy'),(2,'tube_dsx'),(3,'tube_dsy'),(6,'tube_z'))
elif pos=='out': elif pos=='out':
cld[4].setValue(cld[0].value()-twk['tube_usx'].get_val()) #x_in_us-x_us cld[4].setValue(twk['tube_usx'].get_val()-cld[0].value()) #x_us-x_in_us
cld[5].setValue(cld[1].value()-twk['tube_usy'].get_val()) #y_in_us-y_us cld[5].setValue(twk['tube_usy'].get_val()-cld[1].value()) #y_us-y_in_us
lut=((7,'tube_z'),) lut=((7,'tube_z'),)
elif dev==AppCfg.DFT_POS_COL: elif dev==AppCfg.DFT_POS_COL:
# k=('x_in', 'y_in', 'x_out', 'y_out') # k=('x_in', 'y_in', 'x_out', 'y_out')

View File

@@ -34,12 +34,12 @@ def assert_tweaker_positions(targets, timeout=60.0):
pend_event() pend_event()
cur=motor.get_rbv() cur=motor.get_rbv()
done=motor.is_done() done=motor.is_done()
_log.debug("check {}[done={}]: {} == {}".format(name, done, cur, target)) s=f"check {name} {cur:.5g} == {target:.5g} [done={done}]"
summary.append("{}[done={}]: {} == {}".format(name, done, cur, target)) _log.debug(s)
summary.append(s)
if done and tolerance>=abs(cur-target): if done and tolerance>=abs(cur-target):
count+=1 count+=1
pend_event(0.1) pend_event(0.1)
if count==num_motors: if count==num_motors:
break break
pend_event(0.1) pend_event(0.1)

View File

@@ -176,7 +176,7 @@ class SmaractMotorTweak(QWidget, Ui_MotorTweak):
if wait: if wait:
self.wait() self.wait()
if assert_position: if assert_position:
assert_tweaker_positions([(self, drive, 0.05)], timeout=3.) assert_tweaker_positions([(self, drive, 0.05)], timeout=10.)
def emit_signals(self, **kw): def emit_signals(self, **kw):
field = kw['source_field'] field = kw['source_field']

View File

@@ -458,7 +458,7 @@ class autofocus:
m=sb.sum() m=sb.sum()
mtr[idx,:]=(p,m) mtr[idx,:]=(p,m)
_log.debug(f'{args} {kwargs} p:{p} mtr={m}') _log.debug(f'{args} {kwargs} p:{p} mtr={m}')
print(p) #print(p,cam._timestamp,m)
if abs(p-self._pDst)<0.01 or idx>mtr.shape[0]: if abs(p-self._pDst)<0.01 or idx>mtr.shape[0]:
_log.debug(f'DONE->{self._idx}') _log.debug(f'DONE->{self._idx}')
del cam.process del cam.process

View File

@@ -2227,7 +2227,7 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
(tw_x_us, x_in_us, 0.1), (tw_x_us, x_in_us, 0.1),
(tw_y_us, y_in_us, 0.1), (tw_y_us, y_in_us, 0.1),
(tw_x_ds, x_in_ds, 0.1), (tw_x_ds, x_in_ds, 0.1),
(tw_y_ds, y_in_ds, 0.1), ],timeout=10.0, (tw_y_ds, y_in_ds, 0.1), ],timeout=20.0,
) )
except app_utils.PositionsNotReached as e: except app_utils.PositionsNotReached as e:
msg=f"failed to move post sample tube {pos}: {e}" msg=f"failed to move post sample tube {pos}: {e}"
@@ -2260,7 +2260,7 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
(tw_x_us, x_out_us, 0.1), (tw_x_us, x_out_us, 0.1),
(tw_y_us, y_out_us, 0.1), (tw_y_us, y_out_us, 0.1),
(tw_x_ds, x_out_ds, 0.1), (tw_x_ds, x_out_ds, 0.1),
(tw_y_ds, y_out_ds, 0.1), ], timeout=10.0, (tw_y_ds, y_out_ds, 0.1), ], timeout=20.0,
) )
except app_utils.PositionsNotReached as e: except app_utils.PositionsNotReached as e:
msg=f"failed to move post sample tube {pos}: {e}" msg=f"failed to move post sample tube {pos}: {e}"