test params

This commit is contained in:
JohannesDittloff 2025-05-02 17:36:41 +02:00
parent a5e2105668
commit 09b15068c7

13
test.py
View File

@ -1,5 +1,3 @@
from zipfile import stringFileHeader
if __name__ == "__main__":
import sys
if __package__ is None:
@ -51,12 +49,18 @@ def _measure_both(monochromator: Bentham, lockin: SR830, shutter: ShutterProbe,
sample_rate = 512
timeout_s = 60
timeout_interval = 0.5
lockin.run("SENS 17") # 1 mV/nA
# lockin.run("OFLT 5") # 3 ms
# lockin.run("SENS 17") # 1 mV/nA
lockin.run("SENS 20") # 10 mV/nA
# trigger on the falling edge, since the light comes through when the ref signal is low
# could of course also trigger on rising and apply 180° shift
lockin.run("RSLP 2")
# since we dont expect changes in our signal, we can use large time constants and aggresive filter slope
# for better signal to noise
# lockin.run("OFLT 5") # 3 ms
lockin.run("RMOD 2") # low noise (small reserve)
lockin.run("OFLT 8") # 100 ms
lockin.run("OFSL 3") # 24dB/Oct ms
lockin.run("SYNC 0") # test without sync filter
if AC:
input("Plug the detector into lock-in port 'A/I' (front panel) and press enter > ")
input("Make sure the laser is turned on and press enter > ")
@ -74,7 +78,6 @@ def _measure_both(monochromator: Bentham, lockin: SR830, shutter: ShutterProbe,
if t < 0: raise RuntimeError("Timed out waiting for buffer measurement to finish")
arr = lockin.buffer_get_data(CH1=True, CH2=True)
data_raw.append([wl, arr])
arr[1] += 180
# calculate means, for theta use circular mean
dR = np.mean(arr[0,:])
sdR = np.std(arr[0,:])