-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLabTutorial.py
More file actions
39 lines (22 loc) · 792 Bytes
/
LabTutorial.py
File metadata and controls
39 lines (22 loc) · 792 Bytes
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
import numpy as np
import matplotlib.pyplot as plt
import SpectraClasses as SpectraCls
LoadData = SpectraCls.LoadingData()
arrayOfData = LoadData.LoadTextFromDirectoryIntoArray(' light', 'lights/')
print(arrayOfData)
data = np.loadtxt('lights\light00000.txt', skiprows=17, comments = '>>', usecols=(0,1))
print (data)
plt.plot(data.T[0], data.T[1])
plt.show()
np.zeros((2048, 100))
#names = np.loadtxt('filenames.txt', dtype=str)
data_all = np.zeros((2048,100))
counter = 0
for line in data:
temp = np.loadtxt(line[0,14], skiprows=17, comments='>>', usecols=(0,1)).T[1]
data_all[:counter] = temp
counter+=1
spec_1d = np.mean(data_all, axis=1)
emission_line = spec_1d[150:180]
plt.imshow(data_all, origin='lower', interpolation ='nearest')
plt.show()