Compare commits

..

No commits in common. "fc6979ecb2dd67115f120b879c91f517603d694e" and "19fd4635ce29b1764906476c01aa2a34de2f61ce" have entirely different histories.

2 changed files with 7 additions and 7 deletions

View file

@ -81,7 +81,7 @@ def main():
nameadd = nameadd + '_mV' nameadd = nameadd + '_mV'
u = [1.0]*18 u = [1.0]*18
if args.nameadd: if len(args.nameadd)>0:
nameadd = args.nameadd[0] nameadd = args.nameadd[0]
global trigchan global trigchan
@ -97,7 +97,7 @@ def main():
hist[i][0]=minV + resV*i hist[i][0]=minV + resV*i
with fileinput.input(files=(file), encoding="utf-8") as f: with fileinput.input(files=(file), encoding="utf-8") as f:
T = None T='unknown'
B1 = [] B1 = []
B2 = [] B2 = []
for line in f: for line in f:
@ -105,7 +105,7 @@ def main():
if not 'EOF' in l: if not 'EOF' in l:
if l[0] == 'H': if l[0] == 'H':
T = adc_to_T(int(l[8])) T = adc_to_T(int(l[8]))
elif l[0] == 'EI' and T is not None: elif l[0] == 'EI' and not T=='unknown':
if conditions(l,args): if conditions(l,args):
if args.tdhist: if args.tdhist:
B1.append(CmV(l,ch[0])*u[0]) B1.append(CmV(l,ch[0])*u[0])
@ -187,10 +187,10 @@ def adc_to_T(adc):
R1 = 10000 R1 = 10000
b = 3940 b = 3940
dac = 62690 dac = 62690
if adc/(dac-adc)-1 <= 0: T = 0
return
alpha = np.log(R1/R25 *(dac/(dac-adc)-1)) alpha = np.log(R1/R25 *(dac/(dac-adc)-1))
return 1/(alpha/b+1/298.15) -273.15 T = 1/(alpha/b+1/298.15) -273.15
return T
def conditions(l,args): def conditions(l,args):

View file

@ -7,7 +7,7 @@ import argparse
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import numpy as np import numpy as np
###the commandline interface ###the comandline interface
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
prog='plot_hist.py', prog='plot_hist.py',
description='takes a .hist file as input and creates a plot') description='takes a .hist file as input and creates a plot')