Commit 3d983d71 authored by bliss administrator's avatar bliss administrator

- [wip] fixing python3

parent edebb20e
......@@ -184,15 +184,15 @@ def _get_musst_template(master_motor, *other_chans):
template_replacement= { \
"$MOTOR_CHANNEL$": "CH%d"%master_chan,
"$DATA_ALIAS$": string.join(data_alias, "\n"),
"$DATA_STORE$": string.join(data_store, " "),
"$DATA_ALIAS$": "\n".join(data_alias),
"$DATA_STORE$": " ".join(data_store),
}
return template_replacement
def _get_musst_store_list(master_motor, *other_chans):
""" Return list of channel name ordered by channel index """
chan_list= [ master_motor ] + list(other_chans)
def _chan_sort(x, y):
return cmp(x[1], y[1])
chan_list.sort(_chan_sort)
def _chan_sort(x):
return x[1]
chan_list.sort(key=_chan_sort)
return ["timer"] + [ name for (name,_) in chan_list ]
......@@ -51,7 +51,7 @@ def akmap(fast_mot, xmin, xmax, x_nb_points,
musst_acq = MusstAcquisitionDevice(musst_device,
program = 'kmap_simple.mprg',
program_start_name = 'KMAP',
#program_abort_name = 'CLEANUP',
#program_abort_name = 'CLEANUP',ne 369,
store_list = store_list,
vars = {"NPOINTS_LINE" : x_nb_points,
"NLINES" : y_nb_points,
......@@ -113,9 +113,9 @@ def _add_detectors(chain,top_master,enabled_counters_name, vlms_cameras_name,
eiger_cam = setup_globals.eiger
detectors_2d.add(eiger_cam)
eiger_expo_time = expo_time - eiger_cam.proxy.latency_time - latency_time
if frames_per_file is None:
frames_per_file = nb_points
lima_master = LimaAcquisitionMaster(eiger_cam, acq_nb_frames=nb_points,
if frames_per_file is None:
frames_per_file = nb_points
lima_master = LimaAcquisitionMaster(eiger_cam, acq_nb_frames=nb_points,
acq_trigger_mode='EXTERNAL_TRIGGER_MULTI',
saving_format="HDF5BS",
saving_suffix='.h5',
......@@ -125,22 +125,22 @@ def _add_detectors(chain,top_master,enabled_counters_name, vlms_cameras_name,
save_flag=save_flag,
prepare_once=True,
start_once=True)
lima_master.add_counter(eiger_cam.image)
chain.add(top_master, lima_master)
roi_counters = eiger_cam.counter_groups.roi_counters
if roi_counters:
eiger_roi_counters = IntegratingCounterAcquisitionDevice(roi_counters,
lima_master.add_counter(eiger_cam.image)
chain.add(top_master, lima_master)
roi_counters = eiger_cam.counter_groups.roi_counters
if roi_counters:
eiger_roi_counters = IntegratingCounterAcquisitionDevice(roi_counters,
npoints=nb_points,count_time=expo_time)
chain.add(lima_master, eiger_roi_counters)
chain.add(lima_master, eiger_roi_counters)
#vlm 1 and 2
for cam_name in vlms_cameras_name:
cam = getattr(setup_globals,cam_name)
detectors_2d.add(cam)
cam_expo = expo_time - 1e-3 - latency_time
if frames_per_file is None:
frames_per_file = nb_points
lima_master = LimaAcquisitionMaster(cam, acq_nb_frames=nb_points,
if frames_per_file is None:
frames_per_file = nb_points
lima_master = LimaAcquisitionMaster(cam, acq_nb_frames=nb_points,
acq_trigger_mode='EXTERNAL_TRIGGER_MULTI',
#saving_format="HDF5BS",
#saving_suffix='.h5',
......@@ -149,13 +149,13 @@ def _add_detectors(chain,top_master,enabled_counters_name, vlms_cameras_name,
save_flag=save_flag,
prepare_once=True,
start_once=True)
lima_master.add_counter(cam.image)
chain.add(top_master, lima_master)
lima_master.add_counter(cam.image)
chain.add(top_master, lima_master)
roi_counters = cam.counter_groups.roi_counters
if roi_counters:
cam_roi_counters = IntegratingCounterAcquisitionDevice(roi_counters,npoints=nb_points,count_time=expo_time)
chain.add(lima_master, cam_roi_counters)
roi_counters = cam.counter_groups.roi_counters
if roi_counters:
cam_roi_counters = IntegratingCounterAcquisitionDevice(roi_counters,npoints=nb_points,count_time=expo_time)
chain.add(lima_master, cam_roi_counters)
#P201
......@@ -189,10 +189,10 @@ def _add_detectors(chain,top_master,enabled_counters_name, vlms_cameras_name,
def dkmap(fast_mot, xmin, xmax, x_nb_points,
slow_mot, ymin, ymax, y_nb_points,
expo_time,latency_time=0.,save_flag=True):
xmin += fast_mot.position()
xmax += fast_mot.position()
ymin += slow_mot.position()
ymax += slow_mot.position()
xmin += fast_mot.position
xmax += fast_mot.position
ymin += slow_mot.position
ymax += slow_mot.position
with cleanup(fast_mot, slow_mot, restore_list=(cleanup_axis.POS, )):
return akmap(fast_mot, xmin, xmax, x_nb_points, slow_mot, ymin, ymax, y_nb_points, expo_time, latency_time, save_flag)
......@@ -203,6 +203,7 @@ class KmapCScanDisplay(object):
self.mcas = mcas
self.detector_info = dict()
self.channel_name = channel_name
self.last_display = ""
# def on_state(self,state):
# return True
......@@ -268,10 +269,10 @@ def akmap_lut(fast_mot, xmin, xmax, x_nb_points,expo_time,
# get positions to move back after scan
start_motors = [fast_mot]
start_positions = [float(fast_mot.position())]
start_positions = [float(fast_mot.position)]
for mot in slow_motors_positions[::2]:
start_motors.append(mot)
start_positions.append(float(mot.position()))
start_positions.append(float(mot.position))
print('started the scan at :')
print([x.name for x in start_motors])
......@@ -353,7 +354,7 @@ def akmap_lut(fast_mot, xmin, xmax, x_nb_points,expo_time,
rename=dest_name, conversion=conversion)
else:
# synchronize the encoder
c_fast.value = fast_mot.position() * fast_mot.steps_per_unit
c_fast.value = fast_mot.position * fast_mot.steps_per_unit
calc_up_counter = '%s_up' % fast_mot.name
mean_pos = CScanMusstChanTrigCalc(enc_name,_step_per_unit(fast_mot), fast_mot.name)
calc_device = CalcAcquisitionDevice('mean_pos',(musst_acq,),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment