-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseftot1.py
executable file
·67 lines (61 loc) · 1.35 KB
/
seftot1.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/python
import glob
import re
import itertools
import numpy as np
import scipy as sp
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, Button, CheckButtons
#text.usetex: True
###
### variablen zuweisen ordner durchfilzen
###
sef=glob.glob('*K.sef')
sef.sort()
sdf=glob.glob('*K.sdf')
sdf.sort()
plt.figure(1)
title=raw_input("enter plot title: ")
plt.title(title)
plt.xlabel("f in MHz")
plt.ylabel("T 1 in s")
plt.xscale('log')
plt.yscale('log')
markers = itertools.cycle(['o','s','v','x'])
sefdata=[]
temps=[]
for filename in sef:
fin=open(filename,'r')
sefdata=fin.readlines()
for i in range(0,4): sefdata.pop(0)
brlx=[]
t1=[]
percerr=[]
zone=[]
relativefile=[]
for data in sefdata:
liste=data.split()
# liste = re.findall(r"[\w.][\f]+",data)
brlx.append(float(liste[0]))
t1.append(float(liste[1]))
percerr.append(float(liste[3]))
zone.append(int(liste[5]))
relativefile.append(liste[6])
fin2=open(relativefile[1],'r')
sdfdata=fin2.readlines()
temp=sdfdata[
sdfdata.index(
'ZONE=\t'+str(zone[
sef.index(filename)])+'\r\n')+7]
temp=temp[6:]
temp=temp.rstrip()
temps.append(float(temp))
#print repr(temp)
for i,b in enumerate(brlx):
brlx[i]=brlx[i]*1e6
plt.plot(brlx,t1,
label=temp+' K',
marker=markers.next(),linestyle='None')
plt.legend()
plt.show()