diff --git a/config/variables.properties b/config/variables.properties index 9c2c7cdb..ba279250 100644 --- a/config/variables.properties +++ b/config/variables.properties @@ -1,4 +1,4 @@ -#Mon Aug 21 11:00:19 CEST 2023 +#Tue Aug 22 11:40:39 CEST 2023 LastRunDate=230821 FileSequentialNumber=18658 -DaySequentialNumber=6 +DaySequentialNumber=0 diff --git a/script/optics/microfocus/ManipulatorScan.py b/script/optics/microfocus/ManipulatorScan.py new file mode 100644 index 00000000..9d5027be --- /dev/null +++ b/script/optics/microfocus/ManipulatorScan.py @@ -0,0 +1,47 @@ +""" +Arguments: + +MOTOR (device) +SENSORS (list) +RANGE (tuple (min, max)) +STEPS (int or tuple) +LATENCY (double) +RELATIVE (BOOLEAN) +FLY_SCAN (BOOLEAN) +ENDSCAN (BOOLEAN) +""" + +#set_preference(Preference.PLOT_TYPES,{'ImageIntegrator':1}) +adjust_sensors() +set_adc_averaging() +set_preference(Preference.PLOT_TYPES, {'Scienta spectrum':1}) +set_exec_pars(compression=True) + +try: + if FLY_SCAN: + # time per scienta acquisition in seconds + trig_scienta() + time1 = time.time() + before_readout() + time.sleep(0.2) + time2 = time.time() + scienta_time = (time2 - time1) + 1. + print "step time: ", scienta_time + + if isinstance(STEPS,int): + raise Exception ("Fly Scan must define step size, and not number of steps") + + STEP = STEPS[0] + SPEED = STEP / scienta_time + fly_time = (RANGE[1] - RANGE[0]) / SPEED + STEPS = int(fly_time / scienta_time) + 1 + + print "speed: ", SPEED + print "scan time: ", fly_time + cscan(MOTOR, SENSORS, RANGE[0], RANGE[1], STEPS, LATENCY, fly_time, RELATIVE, before_read=before_readout, after_read = after_readout, check_positions = False) + else: + lscan(MOTOR, SENSORS, RANGE[0], RANGE[1], STEPS, LATENCY, RELATIVE, before_read=before_readout, after_read = after_readout) +finally: + if ENDSCAN: + after_scan() + \ No newline at end of file