-
Notifications
You must be signed in to change notification settings - Fork 1
/
process_cobalt.py
167 lines (141 loc) · 4.95 KB
/
process_cobalt.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('seaborn-bright')
plt.rcParams['font.family'] = 'Times New Roman'
plt.rcParams['font.size'] = 16
plt.rcParams['lines.linewidth'] = 1.5
plt.rcParams['figure.figsize'] = 8, 5
plt.rcParams.update({'figure.autolayout': True})
plt.rcParams['mathtext.default'] = 'regular'
def process_single_cobalt_x():
widths = [10 * j for j in range(8, 11)]
for w in widths:
df = pd.read_csv('./data/single/cobalt/x/x-' + str(w) + '.txt')
x = df[' Bx']
y = df[' mx']
plt.plot(x, y, label=str(w)+'nm')
plt.legend()
# plt.savefig('x-cobalt-single-sweep.pdf', dpi=1000)
plt.show()
def process_single_cobalt_y():
widths = [10 * j for j in range(5, 11)]
for w in widths:
df = pd.read_csv('./data/single/cobalt/y/y-' + str(w) + 'nm.txt')
x = df[' By']
y = df[' my']
plt.plot(x, y, label=str(w)+'nm')
plt.legend()
# plt.savefig('y-cobalt-single-sweep.pdf', dpi=1000)
plt.show()
def process_double_cobalt_varygap_y():
widths = [10 * j for j in range(4, 16, 2)]
for w in widths:
df = pd.read_csv('./data/double/cobalt/vary_gap/y/y-100-' + str(w) + '-150.txt')
x = df[' By']
y = df[' my']
plt.plot(x, y, label=str(w)+'nm')
plt.legend()
# plt.savefig('y-cobalt-double-vary-gap.pdf', dpi=1000)
plt.show()
def process_double_cobalt_varywidth_y():
widths = [10 * j for j in range(8, 20, 2)]
for w in widths:
df = pd.read_csv('./data/double/cobalt/vary_width/y/y-100-50-' + str(w) + '.txt')
x = df[' By']
y = df[' my']
plt.plot(x, y, label=str(w)+'nm')
plt.legend()
plt.savefig('y-cobalt-double-vary-width.pdf', dpi=1000)
plt.show()
def process_double_cobalt_varywidth_x():
widths = [10 * j for j in range(10, 16, 2)]
for w in widths:
df = pd.read_csv('./data/double/cobalt/vary_width/x/x-100-50-' + str(w) + '.txt')
x = df[' Bx']
y = df[' mx']
plt.plot(x, y, label=str(w)+'nm')
plt.legend()
plt.savefig('x-cobalt-double-vary-width.pdf', dpi=1000)
plt.show()
def process_double_cobalt_varygap_x():
widths = [10 * j for j in range(4, 12, 2)]
for w in widths:
df = pd.read_csv('./data/double/cobalt/vary_gap/x/x-100-' + str(w) + '-150.txt')
x = df[' Bx']
y = df[' mx']
plt.plot(x, y, label=str(w)+'nm')
plt.legend()
plt.savefig('x-cobalt-double-vary-gap.pdf', dpi=1000)
plt.show()
def process_double_cobalt_mumax():
df = pd.read_csv('./data/mumax/test.txt', delimiter="\t")
x = df['B_exty (T)']
y = df['my ()']
plt.plot(x, y)
plt.legend()
# plt.savefig('x-cobalt-double-vary-gap.pdf', dpi=1000)
plt.show()
df = pd.read_csv('./data/mumax/cobalt_double-100-50-100.txt', delimiter="\t")
x = df['B_exty (T)']
y = df['my ()']
plt.plot(x, y)
plt.legend()
plt.show()
def process_mumax_single_cobalt_x():
widths = [10 * i for i in range(4, 12, 2)]
for w in widths:
df = pd.read_csv('./data/mumax/single/cobalt/x-' + str(w) + '.txt', delimiter="\t")
x = df['B_extx (T)']
y = df['mx ()']
plt.plot(x, y, label=str(w)+'nm')
plt.legend()
# plt.savefig('x-cobalt-single.pdf', dpi=1000)
plt.show()
def process_mumax_single_cobalt_y():
widths = [10 * i for i in range(4, 12, 2)]
for w in widths:
df = pd.read_csv('./data/mumax/single/cobalt/y-' + str(w) + '.txt', delimiter="\t")
x = df['B_exty (T)']
y = df['my ()']
plt.plot(x, y, label=str(w)+'nm')
plt.legend()
# plt.savefig('y-cobalt-single.pdf', dpi=1000)
plt.show()
def process_mumax_double_cobalt_x():
widths = [10 * i for i in range(10, 22, 2)]
for w in widths:
df = pd.read_csv('./data/mumax/double/cobalt/x-100-' + str(w) + '-100.txt', delimiter="\t")
x = df['B_extx (T)']
y = df['mx ()']
plt.plot(x, y, label=str(w)+'nm')
plt.legend()
# plt.savefig('x-cobalt-double-vary-gap.pdf', dpi=1000)
plt.show()
def process_mumax_double_cobalt_y():
widths = [10 * i for i in range(10, 22, 2)]
for w in widths:
df = pd.read_csv('./data/mumax/double/cobalt/y-100-' + str(w) + '-100.txt', delimiter="\t")
x = df['B_exty (T)']
y = df['my ()']
plt.plot(x, y, label=str(w)+'nm')
plt.legend()
# plt.savefig('y-cobalt-double-vary-gap.pdf', dpi=1000)
plt.show()
def test():
df = pd.read_csv('./data/y-100-100-100-test.txt', delimiter="\t")
x = df['B_exty (T)']
y = df['my ()']
plt.plot(x, y)
plt.show()
# process_single_cobalt_x()
# process_single_cobalt_y()
# process_double_cobalt_varygap_y()
# process_double_cobalt_varywidth_y()
# process_double_cobalt_varywidth_x()
# process_double_cobalt_varygap_x()
# process_double_cobalt_mumax()
# process_mumax_single_cobalt_y()
# process_mumax_single_cobalt_x()
# process_mumax_double_cobalt_x()
# process_mumax_double_cobalt_y()
test()