""" Arguments: DRY_RUN = True RANGE_X (tuple (min, max)) RANGE_Y (tuple (min, max)) STEPS (tuple (x, y)) EXPOSURES (list or None) SETTLING_TIME (double) ZIGZAG (BOOLEAN) COMPRESSION (BOOLEAN) """ #Deug if (get_exec_pars().args is None) and (get_exec_pars().script=="Scan2D"): DRY_RUN = True RANGE_X = [-10.0,10.0] RANGE_Y = [-10.0,10.0] EXPOSURES = None # [0.1, 0.5, 1.0] STEPS = [5, 5] #Integers = number of steps, Float = stepoSize SETTLING_TIME = 0.1 ZIGZAG = True COMPRESSION = False print DRY_RUN SENSORS = [sin, scienta.dataMatrix] MOTORS = [m1, m2] RELATIVE = True START = [RANGE_X[0], RANGE_Y[0]] STOP = [RANGE_X[1], RANGE_Y[1]] ENABLED_PLOTS= [sin, scienta.dataMatrix] CUSTOM_PLOT_TYPES = {scienta.dataMatrix:"ch.psi.pshell.plot.MatrixPlotRenderer"} if EXPOSURES: class exposure_index (Writable, Readable): def __init__(self): self.pos=0.0 def read(self): return self.pos def write(self, value): scienta.setExposure(EXPOSURES[int(value)]) self.pos = value class exposure (Readable): def read(self): return scienta.exposure POSITIONERS = MOTORS + [exposure_index()] _SENSORS = SENSORS + [exposure()] START = START + [0.0] STOP = STOP + [float(len(POSITIONERS)-1)] if EXPOSURES: r = ascan(POSITIONERS, _SENSORS , START, STOP, STEPS + [1.0], \ SETTLING_TIME, RELATIVE, zigzag = ZIGZAG, \ compression = COMPRESSION, enabled_plots=ENABLED_PLOTS, \ save=False,keep=False, check_positions=False, plot_types=CUSTOM_PLOT_TYPES) else: r = ascan(MOTORS, SENSORS , START, STOP, STEPS, \ SETTLING_TIME, RELATIVE, zigzag = ZIGZAG, \ compression = COMPRESSION, enabled_plots=ENABLED_PLOTS, \ save=False,keep=False, check_positions=False, plot_types=CUSTOM_PLOT_TYPES) set_return(t)