-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfiltertest.py
48 lines (36 loc) · 903 Bytes
/
filtertest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 04 12:06:32 2012
Quick Filter Test
@author: bram
"""
import SRS830
import time
import numpy
import matplotlib
from pylab import *
stepTime = 5
stepsize = 0.001
freq = numpy.logspace(0,5,100)
n = len(freq)
lockin = SRS830.device('GPIB1::14')
lockin.set_freq(freq[0])
# Plotter
#ion()
#fig = figure()
#fig.canvas.set_window_title("Frequency Sweep")
#ax = fig.add_subplot (111)
dat_file = open ("C:\\Users\\keyan\\Documents\\Data\\Filter\\nitrogen.dat", 'w')
dat_file.write("Frequency(hz) \t X(V) \t Y(V) \n")
print("Frequency(hz) \t X(V) \t Y(V) \n")
x = []
y = []
for i in range(0,n-1):
lockin.set_freq(freq[i])
time.sleep(10)
x.append(lockin.read_input(1))
y.append(lockin.read_input(2))
line = "%f \t %s \t %s \n" % (freq[i],x[i],y[i])
print(line)
dat_file.write(line)
print ("Sweep Finished")