45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
"""
|
|
Flying hologram scan (work in progress)
|
|
|
|
Arguments:
|
|
|
|
SENSORS (list)
|
|
PHI_RANGE (tuple (min, max))
|
|
THETA_RANGE (tuple (min, max))
|
|
STEPS (tuple (phi, theta))
|
|
ZIGZAG (BOOLEAN)
|
|
"""
|
|
|
|
|
|
#set_preference(Preference.ENABLED_PLOTS, [ManipulatorPhi, ManipulatorTheta, Scienta.dataMatrix, ImageIntegrator])
|
|
#set_preference(Preference.PLOT_TYPES,{'ImageIntegrator':1})
|
|
adjust_sensors()
|
|
set_adc_averaging()
|
|
set_preference(Preference.PLOT_TYPES, {'Scienta spectrum':1})
|
|
|
|
# time per scienta acquisition in seconds
|
|
time1 = time.time()
|
|
trig_scienta()
|
|
time2 = time.time()
|
|
scienta_time = (time2 - time1) * 1.01
|
|
|
|
# time for one theta scan in seconds
|
|
THETA_NSTEPS = round((THETA_RANGE[1] - THETA_RANGE[0]) / THETA_STEP) + 1
|
|
theta_time = scienta_time * THETA_STEPS
|
|
|
|
PHI_STEP = 40.0
|
|
PHI_NSTEPS = round((PHI_RANGE[1] - PHI_RANGE[0]) / PHI_STEP) + 1
|
|
phi_positions = [PHI_RANGE[0] + PHI_STEP * i for i in range(PHI_NSTEPS)]
|
|
|
|
try:
|
|
for phi in phi_positions:
|
|
ManipulatorPhi.write(phi)
|
|
ManipulatorPhi.waitValueInRange(phi, 1.0, 100)
|
|
cscan(ManipulatorTheta, SENSORS, THETA_RANGE[0], THETA_RANGE[1], STEPS, time=TIME, before_read=before_readout, after_read = after_readout)
|
|
if ZIGZAG:
|
|
THETA_RANGE = (THETA_RANGE[1], THETA_RANGE[0])
|
|
|
|
finally:
|
|
if ENDSCAN:
|
|
after_scan()
|
|
|