Compare commits
2 commits
c2fb9bd2d5
...
a4d8c0f391
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4d8c0f391 | ||
|
|
30315e49f9 |
2 changed files with 42 additions and 2 deletions
19
AHBGOx.py
19
AHBGOx.py
|
|
@ -12,6 +12,7 @@ parser.add_argument("file", type = str, help="path/file were data is stored in")
|
||||||
parser.add_argument('-hist', action='store_true', help = "makes histogramm of all channels") # on/off flag
|
parser.add_argument('-hist', action='store_true', help = "makes histogramm of all channels") # on/off flag
|
||||||
parser.add_argument("-sum", action='store_true', help = "makes histogramms of BGOdiodes and sum (same as 'AHBGOC_vertical.py')") # on/off flag
|
parser.add_argument("-sum", action='store_true', help = "makes histogramms of BGOdiodes and sum (same as 'AHBGOC_vertical.py')") # on/off flag
|
||||||
parser.add_argument('-Itime', action='store_true', help = "if chosen, Itime is calculatet and printet to filename.Itime") # on/off flag
|
parser.add_argument('-Itime', action='store_true', help = "if chosen, Itime is calculatet and printet to filename.Itime") # on/off flag
|
||||||
|
parser.add_argument('-dau', action='store_true', help = "if chosen, time and temperature of BGO are printet to filename.dau") # on/off flag
|
||||||
parser.add_argument("-mV", action='store_true', help = "if chosen, data will be kept in mV changed to keV otherwise") # on/off flag
|
parser.add_argument("-mV", action='store_true', help = "if chosen, data will be kept in mV changed to keV otherwise") # on/off flag
|
||||||
parser.add_argument('-muon', action='store_true', help = "only select muon data") # on/off flag
|
parser.add_argument('-muon', action='store_true', help = "only select muon data") # on/off flag
|
||||||
parser.add_argument("-xray", action='store_true', help = "only select xray data") # on/off flag
|
parser.add_argument("-xray", action='store_true', help = "only select xray data") # on/off flag
|
||||||
|
|
@ -61,6 +62,11 @@ def main(x):
|
||||||
outfile = open(fname, 'w')
|
outfile = open(fname, 'w')
|
||||||
outfile.write(str(Itime))
|
outfile.write(str(Itime))
|
||||||
outfile.close()
|
outfile.close()
|
||||||
|
|
||||||
|
elif args.dau:
|
||||||
|
time,temp = find_timetemp()
|
||||||
|
frame = pd.DataFrame({'time': time, 'T': temp})
|
||||||
|
frame.to_csv('histograms/'+filename+'.dau', sep = ' ', index = False)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
global thr
|
global thr
|
||||||
|
|
@ -251,6 +257,19 @@ def find_Itime():
|
||||||
lasttime=time
|
lasttime=time
|
||||||
return Itime
|
return Itime
|
||||||
|
|
||||||
|
def find_timetemp():
|
||||||
|
time=[]
|
||||||
|
temp=[]
|
||||||
|
with fileinput.input(files=(file), encoding="utf-8", errors = 'ignore') as f:
|
||||||
|
for line in f:
|
||||||
|
l = line.split()
|
||||||
|
if not 'EOF' in l and l[0] == 'H':
|
||||||
|
T = adc_to_T(int(l[8]))
|
||||||
|
time.append(l[1])
|
||||||
|
temp.append(T)
|
||||||
|
return time,temp
|
||||||
|
|
||||||
|
|
||||||
def CmV(line, i):
|
def CmV(line, i):
|
||||||
return int(line[3*i+5])/mV
|
return int(line[3*i+5])/mV
|
||||||
|
|
||||||
|
|
|
||||||
25
test.py
25
test.py
|
|
@ -5,7 +5,28 @@ Created on Wed Apr 10 13:16:52 2024
|
||||||
|
|
||||||
@author: ava
|
@author: ava
|
||||||
"""
|
"""
|
||||||
|
import pandas as pd
|
||||||
a = [0,1,2]
|
a = [0,1,2]
|
||||||
a = a + [3,4]
|
a = a + [3,4]
|
||||||
print(a)
|
print(a)
|
||||||
|
|
||||||
|
b = 6*[[30,40]]+[[50,90]]
|
||||||
|
print(b)
|
||||||
|
|
||||||
|
leer = [[],[],[]]
|
||||||
|
|
||||||
|
leer[0].append("P1")
|
||||||
|
leer[0].append("P2")
|
||||||
|
leer[1].append(3.5)
|
||||||
|
leer[1].append(1.0)
|
||||||
|
|
||||||
|
d = {'P': [], 'mpv': [], 'err_mpv':[]}
|
||||||
|
d['P'].append('P1')
|
||||||
|
d['mpv'].append(2.4)
|
||||||
|
d['err_mpv'].append(0.3)
|
||||||
|
|
||||||
|
|
||||||
|
print(d)
|
||||||
|
|
||||||
|
frame = pd.DataFrame(d)
|
||||||
|
frame.to_csv('fitparameters/'+'test'+'_mpv_sums.txt', sep = ' ', index = False)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue