31 lines
715 B
Python
31 lines
715 B
Python
|
|
|
|
def after_read(rec,scan):
|
|
print rec[energy], rec[sin]
|
|
|
|
|
|
|
|
#r = mscan(energy, sin.cache, after_read=after_read)
|
|
|
|
|
|
#Execute the scan: sample undefined number of samples until a condition is met, with auto range
|
|
scan_completed=False
|
|
def after_read(record, scan):
|
|
global scan_completed
|
|
print record[sin]
|
|
if motor.isReady():
|
|
scan_completed=True
|
|
scan.abort()
|
|
|
|
motor.move(0.0)
|
|
motor.moveAsync(3.0)
|
|
try:
|
|
r = mscan(motor.readback, [motor.readback, sin.cache], after_read=after_read, range=[0.0, 3.0], domain_axis=motor.readback.name)
|
|
except ScanAbortedException as ex:
|
|
if not scan_completed: raise
|
|
motor.moveAsync(0.0)
|
|
|
|
print r[sin]
|
|
|
|
#print r[0][sin]
|
|
print r[0][motor.readback] |