damaris-script-library/Scripts/Miscellaneous/PhaseTest/phase_exp.py
2018-11-27 17:53:06 +01:00

26 lines
832 B
Python
Executable File

import numpy as N
# connect PTS RF source to ADC card, set to generate a few MHz
# result should be a fulle period of sine/cosine
def experiment():
#step = 0.36 # for PTS 500
step = 0.225 # for PTS 310
for i in list(xrange(1)): # number of periods
samples = 2048
print samples
for phase in N.arange(0,360,step):
#phase=ph
e=Experiment()
#e.set_frequency(1e6,0)
e.wait(20e-6)
e.set_description("phase", phase)
e.set_description("i", i)
e.set_phase(0.0)
#e.loop_start(1)
e.wait(20e-6)
e.record(samples, 20e6,sensitivity=10)
e.set_phase(phase)
e.wait(20e-6)
#e.loop_end()
e.record(samples, 20e6,sensitivity=10)
yield e