Commit 5bee44bf authored by augustin_s's avatar augustin_s 🐍
Browse files

some overnight scan loops

parent 4bf3d71f
import numpy as np
from slic.utils import nice_arange
from time import sleep
#def kescan3D():
# x0 = 11.0
# y0 = 4.0
# z0 = 0.029
# npulses = 500
# step = 0.0005
# xstart = 10.535
# xstop = 10.575
# ystart = 0.295
# ystop = 0.335
# ntry = "04"
# wait_time = 0.1
# for i in range(100):
## for z_val in nice_arange(z0-1.0, z0+0.2, 0.05):
## for z_val in np.linspace(z0-1.0, z0+0.2, 25):
# for z_val in list(reversed(list(z0 + np.linspace(-1.0, -0.4, 5)) + list(z0 + np.linspace(-0.2, 0.2, 5)))):
# mot_z.set(z_val).wait()
# print(i)
# print(mot_x)
# print(mot_y)
# print(mot_z)
# mot_y.set(y0).wait()
# mot_x.set(xstart).wait()
# scan.scan1D(mot_x, xstart, xstop, step, npulses, f"focus_knifeedge3D_x_scan_{ntry}_{z_val}", return_to_initial_values=False)
# sleep(wait_time)
# print(mot_x)
# print(mot_y)
# print(mot_z)
# mot_x.set(x0).wait()
# mot_y.set(ystart).wait()
# scan.scan1D(mot_y, ystart, ystop, step, npulses, f"focus_knifeedge3D_y_scan_{ntry}_{z_val}", return_to_initial_values=False)
# sleep(wait_time)
# print("-" * 10)
# print()
#from time import time
#def overnight():
# current = mot_z.get_current_value()
# start = time()
# ntry = 7
# for i in range(100):
# si = str(i).zfill(6)
# fname = f"z_hop_{ntry}_coarse_{si}"
# print(fname)
# print(current, mot_z)
# mot_z.set_target_value(current).wait()
## sleep(0.5)
# if np.abs(mot_z.get_current_value() - current) > 0.01:
# break
# print(current, mot_z)
# scan.scan1D(mot_z, -0.1, +0.1, 0.1, 500, fname, relative=True, return_to_initial_values=True)
# print(current, mot_z)
## sleep(0.5)
# fname = f"z_hop_{ntry}_fine_{si}"
# print(fname)
# print(current, mot_z)
# mot_z.set_target_value(current).wait()
## sleep(0.5)
# if np.abs(mot_z.get_current_value() - current) > 0.01:
# break
# print(current, mot_z)
# scan.scan1D(mot_z, -0.01, +0.01, 0.001, 500, fname, relative=True, return_to_initial_values=True)
# print(current, mot_z)
## sleep(0.5)
# now = time()
# deltat = now - start
# print(start, now, deltat, 4*60*60)
# if deltat > 4*60*60:
# break
#def kescan3Dv2():
# x0 = 23.947
# y0 = 0
# npulses = 25 * 100/25
# step = 0.0005
# xstart = 21.897
# xstop = 21.997
# ystart = -2.573
# ystop = -2.713
# wait_time = 0.01
# for i in range(100):
# for z_val in nice_arange(0.2, -1.3, 0.1):
# mot_z.set(z_val).wait()
# print(i)
# print(mot_x)
# print(mot_y)
# print(mot_z)
# mot_y.set(y0).wait()
# mot_x.set(xstart).wait()
# scan.scan1D(mot_x, xstart, xstop, step, npulses, f"focus_knifeedge3D_v2_x_scan_{i}_{z_val}", return_to_initial_values=False)
# sleep(wait_time)
# print(mot_x)
# print(mot_y)
# print(mot_z)
# mot_x.set(x0).wait()
# mot_y.set(ystart).wait()
# scan.scan1D(mot_y, ystart, ystop, step, npulses, f"focus_knifeedge3D_v2_y_scan_{i}_{z_val}", return_to_initial_values=False)
# sleep(wait_time)
# print("-" * 10)
# print()
#def tof_loop():
# for i in range(50):
# fn = f"tof_loop2_{i}"
# daq.acquire(fn, n_pulses=10*10000)
#from time import sleep
#def overnight():
# sig = 101.617
# bkg = sig + 1
# while True:
# delay.set(sig).wait()
# sleep(10)
# daq.acquire("TT_overnight_sig", n_pulses=10 * 10000)
# delay.set(bkg).wait()
# daq.acquire("TT_overnight_bkg", n_pulses=10 * 1000)
# sleep(10)
#def overnight():
# start = 102.1
# stop = 102.4
# step = 0.015
# n_pulses = 10 * 500
# bkg = 103.3
# for i in range(1000):
# print(i, "sig")
# delay.set(start).wait()
# sleep(10)
# scan.scan1D(delay, start, stop, step, n_pulses, f"TT_overnight2_sig_{i:04}", return_to_initial_values=False)
# print(i, "bkg")
# delay.set(bkg).wait()
# daq.acquire(f"TT_overnight2_bkg_{i:04}", n_pulses=n_pulses)
# sleep(10)
#def overnight():
# start = 102.0
# stop = 102.3
# step = 0.0075
# n_pulses = 10 * 500
# bkg = 103.3
# for i in range(1000):
# print(i, "sig")
# delay.set(start).wait()
# sleep(10)
# scan.scan1D(delay, start, stop, step, n_pulses, f"TT_overnight3_sig_{i:04}", return_to_initial_values=False)
# print(i, "bkg")
# delay.set(bkg).wait()
# daq.acquire(f"TT_overnight3_bkg_{i:04}", n_pulses=n_pulses)
# sleep(10)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment