-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrabipart2.py
69 lines (48 loc) · 1.59 KB
/
rabipart2.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
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 19 23:40:14 2014
@author: Haina
"""
import matplotlib as plt
import numpy as np
import os
import scipy
#start of main
path_to_file = os.path.abspath('C:\Users\Haina\Desktop\chem 3821\Nutration datadetuningindices.txt') #this sets the path to the file that you want to open
indices = np.loadtxt(path_to_file)
start = indices[:,0]
end = indices[:,1]
endcutamount = 500
startcutamount = 200 #delay number of points
datasize = len(data)
interval = 2.5e-10
pulsenum = 25
timevalues = np.zeros((datasize, 1))
for i in range(datasize):
if (i == 0):
timevalues[i] = 0
else:
timevalues[i] = timevalues[i-1] + interval
for i in range(pulsenum):
if (i == 24):
time = timevalues[end[i]+startcutamount:datasize-1:1]
signal = data[end[i]+startcutamount:datasize-1:1]
else:
time = timevalues[end[i]+startcutamount:start[i+1]-endcutamount:1]
signal = data[end[i]+startcutamount:start[i+1]-endcutamount:1]
f = 'C:\Users\Haina\Desktop\chem 3821\decaydata\decay' + str(i) + '.txt'
path_to_outfile=os.path.abspath(f)
f=open(path_to_outfile, 'a')
for i in range(len(signal)):
f.write(str(signal[i]) + '\n')
f.close()
#matplotlib.pyplot.plot(time,signal)
#matplotlib.pyplot.xlabel('Time (seconds)')
#matplotlib.pyplot.ylabel('Intensity')
#matplotlib.pylab.show();
#f = 'decay.txt'
#path_to_outfile=os.path.abspath("C:\\Users\\Haina\\Desktop\\chem 3821\\" + f)
#f=open(path_to_outfile, 'a')
#for i in range(len(signal)):
# f.write(str(signal[i]) + '\n')
#f.close()