""" XAS on-the-fly scan SCRIPT NOT RUNNING! TO DO: probably need to wrap the mono in a ch.psi.pshell.device.Motor or ch.psi.pshell.device.MotorGroupBase """ # scan parameters START_ENERGY = 400.0 END_ENERGY = 410.0 # total scan time in seconds SCAN_TIME = 60.0 # dwell time (per step) in seconds DWELL = 0.1 # True = close shutter and turn off detectors at end, False = leave beam and detectors on ENDSCAN = False # --- do not edit below --- mm = ch.psi.pshell.device.Motor("X03DA-PGM:MI") gm = ch.psi.pshell.device.Motor("X03DA-PGM:GR") POSITIONERS = (MonoBetaMotor, MonoThetaMotor) SENSORS = (MonoEnergy, MonoCff, MonoBeta, MonoTheta, SampleCurrent, RefCurrent, MachineCurrent) STARTPOS = (beta1, theta1) ENDPOS = (beta2, theta2) caput('X03DA-PGM:energy', END_ENERGY) time.sleep(0.05) beta1 = caget('X03DA-PGM:beta') theta1 = caget('X03DA-PGM:theta') print "end: energy = {en}, beta = {be}, theta = {th}".format(en=END_ENERGY, be=beta1, th=theta1) caput('X03DA-PGM:energy', START_ENERGY) time.sleep(0.05) beta2 = caget('X03DA-PGM:beta') theta2 = caget('X03DA-PGM:theta') print "start: energy = {en}, beta = {be}, theta = {th}".format(en=END_ENERGY, be=beta1, th=theta1) Eph.write(START_ENERGY) LATENCY = 0. adjust_sensors() set_adc_averaging() try: prepare_keithleys(DWELL) cscan(POSITIONERS, SENSORS, STARTPOS, ENDPOS, NSTEPS-1, time=scan_time, before_read=before_readout, after_read=after_readout) finally: if ENDSCAN: after_scan()