diff --git a/script/local.py b/script/local.py index f2e91f9..d325df6 100644 --- a/script/local.py +++ b/script/local.py @@ -475,63 +475,48 @@ def relscan(motor, start, end, number_of_steps, count_time): Relative scan """ set_count_time(count_time) - detectors = [mythen, mythen.acquire_time, pixel, pixel.image_filename, image.intensity,image.corrected_intensity, image.matrix] - #TODO: Set based on experiment context - pixel.set_path("../../expdata/bml_20190703/pixel/", "images") - #TODO: should be set automatically - set_roi(173,88,285,136) show_panel(detector_image) pixel.show() pixel.assert_ready() - return lscan (motor, detectors, start, end, int(number_of_steps), relative=True, before_read=before_sample, after_read=after_sample) + return lscan (motor, detectors, start, end, int(number_of_steps), relative=True, before_read=before_sample, after_read=after_sample, name="relscan") def absscan(motor, start, end, number_of_steps, count_time): """ Absolute scan """ set_count_time(count_time) - detectors = [mythen, mythen.acquire_time, pixel, pixel.image_filename, image.intensity,image.corrected_intensity, image.matrix] - #TODO: Set based on experiment context - pixel.set_path("../../expdata/bml_20190703/pixel/", "images") - #TODO: should be set automatically - set_roi(173,88,285,136) show_panel(detector_image) pixel.show() pixel.assert_ready() - return lscan (motor, detectors, start, end, int(number_of_steps), relative=False, before_read=before_sample, after_read=after_sample) + return lscan (motor, get_detectors(), start, end, int(number_of_steps), relative=False, before_read=before_sample, after_read=after_sample, name="absscan") def abs2scan(motor1, start1, end1, motor2, start2, end2, number_of_steps, count_time): """ Absolute scan of 2 motors """ set_count_time(count_time) - detectors = [mythen, mythen.acquire_time, pixel, pixel.image_filename, image.intensity,image.corrected_intensity, image.matrix] - #TODO: Set based on experiment context - pixel.set_path("../../expdata/bml_20190703/pixel/", "images") - #TODO: should be set automatically - set_roi(173,88,285,136) show_panel(detector_image) pixel.show() pixel.assert_ready() - return lscan ([motor1, motor2], detectors, [start1, start2], [end1, end2], int(number_of_steps), relative=False, before_read=before_sample, after_read=after_sample) + return lscan ([motor1, motor2], get_detectors(), [start1, start2], [end1, end2], int(number_of_steps), relative=False, before_read=before_sample, after_read=after_sample, name="abs2scan") def hrodscan(start, end, number_of_steps, count_time): """ - Scan on l + Scan on h """ - return absscan (h, start, end, number_of_steps, count_time) + return absscan (h, start, end, number_of_steps, count_time, name="hrodscan") def krodscan(start, end, number_of_steps, count_time): """ Scan on k """ - return absscan (k, start, end, number_of_steps, count_time) + return absscan (k, start, end, number_of_steps, count_time, name="hrodscan") def lrodscan(start, end, number_of_steps, count_time): """ Scan on l """ - return absscan (l, start, end, number_of_steps, count_time) + return absscan (l, start, end, number_of_steps, count_time, name="lrodscan") def hkllinscan(hstart, hfinish, kstart, kfinish, lstart, lfinish, number_of_steps, count_time): @@ -549,18 +534,23 @@ def hkllinscan(hstart, hfinish, kstart, kfinish, lstart, lfinish, number_of_step vector.append([hp, kp, lp] ) set_count_time(count_time) - detectors = [mythen, mythen.acquire_time, pixel, pixel.image_filename, image.intensity,image.corrected_intensity, image.matrix] - #TODO: Set based on experiment context - pixel.set_path("../../expdata/bml_20190703/pixel/", "images") - #TODO: should be set automatically - set_roi(173,88,285,136) show_panel(detector_image) pixel.show() pixel.assert_ready() - return hklscan(vector, detectors,latency = 0.0, before_read=before_sample, after_read=after_sample) - + return hklscan(vector, get_detectors(),latency = 0.0, before_read=before_sample, after_read=after_sample, name="hkllinscan") +def ct(count_time): + """ + Samples the detectors + """ + if count_time: set_count_time(count_time) + tscan(get_detectors(), 1, 1.0 , before_read=before_sample, after_read=after_sample, name="ct") + + +def get_detectors(): + return [mythen, mythen.acquire_time, pixel, pixel.image_filename, image.intensity,image.corrected_intensity, image.matrix] + ################################################################################################### # Configuration ###################################################################################################