diff --git a/Scan.pdf b/Scan.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3a15f1d300161475ac3717f29754c541c43fc6ff Binary files /dev/null and b/Scan.pdf differ diff --git a/attachment_cer.py b/attachment_cer.py index 89e4abb40ad6665cb2d6b4d49b857a0c1cd95add..ef8907d9e082b9f17e6dada45feca8d37c2bd21f 100644 --- a/attachment_cer.py +++ b/attachment_cer.py @@ -19,7 +19,9 @@ except ImportError: configtl1 = ConfigParser() ini_values = ConfigParser() # parse existing file -configtl1.read('tl1.ini') +configtl1.read('tl.ini') +#print(configtl1.sections()) +#print(configtl1) ini_values.read('inputs.ini') # read values from a section @@ -27,7 +29,7 @@ cal_cert = ini_values.get('input_cer', 'cal_cert') year = ini_values.get('input_gen', 'year') year_str2=year[2:] no = ini_values.get('input_gen', 'no') -path=configtl1.get('path', 'path') +path=Path(configtl1.get('path', 'path')) server=configtl1.get('couch', 'couch') db_vl=configtl1.get('couch', 'db') @@ -45,6 +47,7 @@ print(RefNo) doc_RefNo = db.get(RefNo) cers =doc_RefNo["Bureaucracy"]["Certificate"] +print(cers) @@ -124,9 +127,4 @@ for cers_i in cers: ks_aux.unlink(missing_ok= True) ks_log.unlink(missing_ok= True) ks_gz.unlink(missing_ok= True) - -<<<<<<< HEAD -======= - i += 1 ->>>>>>> ebf93a9ace9e40821f2458dbdfad5bd91f7059e8 diff --git a/file-to-couchdb_TLA.py b/file-to-couchdb_TLA.py index a2c7f2a63598d588e43ed04bb7f50e9b41d0ff3a..27432cfbf0287efd3ee3b3c501112463d61ca756 100644 --- a/file-to-couchdb_TLA.py +++ b/file-to-couchdb_TLA.py @@ -64,10 +64,10 @@ path=Path(config["Pfad"]["Messwerte"]) #print(path.exists()) #datei = path.joinpath(year + ".json") -datei = path.joinpath(cal_cert + "PTB" + year) +datei = path.joinpath(cal_cert + "_" + no + "PTB" + year) #datei = "file://fs.isc.pad.ptb.de/fs/Abt7/Fb75/Vakuum/Messplaetze/TL2/Messwerte/75556PTB2024" #print(datei, datei.exists(), datei.stat()) -datei_S = path.joinpath(cal_cert + "PTB" + year + "_S") +datei_S = path.joinpath(cal_cert + "_" + no + "PTB" + year + "_S") print(json_file) #exit() @@ -93,7 +93,8 @@ T_wv=datei_pkt["T-WV"] T_tl=datei_pkt["T-TL"] T_rv=datei_pkt["T-RV"] p_atm=datei_pkt["Umgebungsdruck p_0"]*100 # Umrechnung in Pa - +d= datei_pkt["d"] +#print(d) m1_drift = datei_pkt["m1_D"] m2_drift = datei_pkt["m2_D"] @@ -152,8 +153,9 @@ lis_l1 = l_1.tolist() lis_l2 = l_2.tolist() lis_t1 = t_1.tolist() lis_t2 = t_2.tolist() +lis_d = d.tolist() -print(lis_l1 ,lis_l2 ,lis_t1 ,lis_t2 ) +print(lis_l1 ,lis_l2 ,lis_t1 ,lis_t2) datum_meas = lis_date[0:1] @@ -174,6 +176,7 @@ doc["Calibration"]["Measurement"]["Values"]={"Temperature": [{"Unit": "C","Type" {"Unit": "s","Type": "Zeit des zweiten Saegezahns","Value": lis_t2}], "L": [{"Unit": "mm","Type": "Hub des ersten Saegezahns","Value": lis_l1}, {"Unit": "mm","Type": "Hub des zweiten Saegezahns","Value": lis_l2}], + "D": [{"Unit": "mm","Type": "nomineller Nadeldurchmesser","Value": lis_d}], "Drift": [{"Unit": "Pa/s","Type": "Steigung des ersten Saegezahns","Value": lis_m1_sz}, {"Unit": "Pa/s","Type": "Steigung des zweiten Saegezahns","Value": lis_m2_sz}, {"Unit": "Pa/s","Type": "Drift des ersten Saegezahns","Value": lis_m1_drift}, diff --git a/file-to-couchdb_tl1.py b/file-to-couchdb_tl1.py index 3b032c53cea8b8fd38b4194ac9da4869a8fcfa84..4776e5cd1f1a94753587a7a0d1d6bdcade76a271 100644 --- a/file-to-couchdb_tl1.py +++ b/file-to-couchdb_tl1.py @@ -537,15 +537,15 @@ if L == 1 : lis_h = h.tolist() - doc["Calibration"]["Measurement"]["Values"]={"Temperature": [{"Unit": "C","Type": "T-FM","Comment":"Temperatur T ","Value": lis_T_fm}, + doc["Calibration"]["Measurement"]["Values"]={"Temperature": [{"Unit": "C","Type": "T-FM","Comment":"Temperatur T","Value": lis_T_fm}, {"Unit": "C","Type": "T-Room","Comment":"Temperatur T","Value": lis_T_room}, {"Unit": "C","Type": "T-TL1","Comment":"Temperatur T","Value": lis_T_tl1}, {"Unit": "C","Type": "T-TL2","Comment":"Temperatur T","Value":lis_T_tl2}, - {"Unit": "C","Type": "T-TL2","Comment":"Temperatur T","Value":lis_T_tl3}, - {"Unit": "C","Type": "T-TL3","Comment":"Temperatur T","Value": lis_T_tl4}], + {"Unit": "C","Type": "T-TL3","Comment":"Temperatur T","Value":lis_T_tl3}, + {"Unit": "C","Type": "T-TL4","Comment":"Temperatur T","Value": lis_T_tl4}], "Pressure": [{"Unit": "Pa","Type": "Offset pressure","Value":lis_p_offs}, - {"Unit": "Pa","Type": "pressure mean","Value":lis_p_fill}, - {"Unit": "bar","Type": "TL1 pressure ","Value":lis_p_ig}], + {"Unit": "Pa","Type": "Fill pressure","Value":lis_p_fill}, + {"Unit": "bar","Type": "TL1 pressure","Value":lis_p_ig}], "Date": [{"Unit": "year-month-day","Type": "Datum","Value":lis_datum}, {"Unit": "hh:mm:ss","Type": "Messzeit","Value":lis_time}], "Valve": [{"Unit": "1","Type": "Connection", "Comment":"Connection of the leak" ,"Value":lis_valve}], @@ -570,7 +570,7 @@ if L == 1 : "m": [{"Unit": "Pa/s","Type": "m1","Comment":"Steigung m1 des 1.SZ","Value": lis_m1}, {"Unit": "Pa/s","Type": "m2","Comment":"Steigung m1 des 2.SZ","Value": lis_m2}, {"Unit": "Pa/s","Type": "m3","Comment":"Steigung m1 des 3.SZ","Value": lis_m3}, - {"Unit": "Pa/s","Type": "m3","Comment":"Steigung m1 des 4.SZ","Value": lis_m3}], + {"Unit": "Pa/s","Type": "m4","Comment":"Steigung m1 des 4.SZ","Value": lis_m4}], "pressure": [{"Unit": "Pa","Type": "pmean","Comment":"Mittelwert von p","Value": lis_pmean}, {"Unit": "Pa","Type": "pmin","Comment":"p_min des SZ","Value": lis_pmin}, {"Unit": "Pa","Type": "pmax","Comment":"p_max des SZ","Value": lis_pmax}], @@ -591,17 +591,17 @@ else: lis_c = L_ar.tolist() if gauge == 0.01 : - doc["Calibration"]["Measurement"]["Values"]={"Temperature": [{"Unit": "C","Type": "T-FM ","Comment":"Temperatur T ","Value": lis_T_fm}, + doc["Calibration"]["Measurement"]["Values"]={"Temperature": [{"Unit": "C","Type": "T-FM","Comment":"Temperatur T","Value": lis_T_fm}, {"Unit": "C","Type": "T-Room","Comment":"Temperatur T","Value": lis_T_room}, {"Unit": "C","Type": "T-TL1","Comment":"Temperatur T","Value": lis_T_tl1}, {"Unit": "C","Type": "T-TL2","Comment":"Temperatur T","Value":lis_T_tl2}, - {"Unit": "C","Type": "T-TL2","Comment":"Temperatur T","Value":lis_T_tl3}, - {"Unit": "C","Type": "T-TL3","Comment":"Temperatur T","Value": lis_T_tl4}], + {"Unit": "C","Type": "T-TL3","Comment":"Temperatur T","Value":lis_T_tl3}, + {"Unit": "C","Type": "T-TL4","Comment":"Temperatur T","Value": lis_T_tl4}], "Pressure": [{"Unit": "DCR","Type": "Offset pressure SRG","Value":lis_p_offs_srg}, - {"Unit": "DCR","Type": "Fill pressure SRG ","Value":lis_p_fill_srg}, + {"Unit": "DCR","Type": "Fill pressure SRG","Value":lis_p_fill_srg}, {"Unit": "Pa","Type": "Offset pressure 01Torr","Value":lis_p_offs_01}, {"Unit": "Pa","Type": "Fill pressure 01Torr","Value":lis_p_fill_01}, - {"Unit": "mbar","Type": "TL1 pressure ","Value":lis_p_ig}], + {"Unit": "mbar","Type": "TL1 pressure","Value":lis_p_ig}], "Date": [{"Unit": "year-month-day","Type": "Datum","Value":lis_datum}, {"Unit": "hh:mm:ss","Type": "Messzeit","Value":lis_time}], "Valve": [{"Unit": "1","Type": "Connection", "Comment":"Connection of the leak" ,"Value":lis_valve}], @@ -616,15 +616,14 @@ else: print("SRG") else: - doc["Calibration"]["Measurement"]["Values"]={"Temperature": [{"Unit": "C","Type": "T-FM","Comment":"Temperatur T ","Value": lis_T_fm}, + doc["Calibration"]["Measurement"]["Values"]={"Temperature": [{"Unit": "C","Type": "T-FM","Comment":"Temperatur T","Value": lis_T_fm}, {"Unit": "C","Type": "T-Room","Comment":"Temperatur T","Value": lis_T_room}, {"Unit": "C","Type": "T-TL1","Comment":"Temperatur T","Value": lis_T_tl1}, {"Unit": "C","Type": "T-TL2","Comment":"Temperatur T","Value":lis_T_tl2}, - {"Unit": "C","Type": "T-TL2","Comment":"Temperatur T","Value":lis_T_tl3}, - {"Unit": "C","Type": "T-TL3","Comment":"Temperatur T","Value": lis_T_tl4}], + {"Unit": "C","Type": "T-TL3","Comment":"Temperatur T","Value":lis_T_tl3}, + {"Unit": "C","Type": "T-TL4","Comment":"Temperatur T","Value": lis_T_tl4}], "Pressure": [{"Unit": "Pa","Type": "Offset pressure","Value":lis_p_offs}, - {"Unit": "Pa","Type": " pressure fill","Value":lis_p_fill}, - + {"Unit": "Pa","Type": "Fill pressure","Value":lis_p_fill}, {"Unit": "mbar","Type": "TL1 pressure","Value":lis_p_ig}], "Date": [{"Unit": "year-month-day","Type": "Datum","Value":lis_datum}, {"Unit": "hh:mm:ss","Type": "Messzeit","Value":lis_time}], @@ -678,7 +677,7 @@ doc["Calibration"]["Measurement"]["AuxValues"]={"ScanQMS": [{"Unit": "Mass","Typ # "DefQMS": [{"Type": "Scan QMS ","Value":key_value}, # {"Type": "Scan Offset QMS","Value": key_value_offs}]} -#db.save(doc) +db.save(doc) content=pathlib.Path('Scan.pdf').read_bytes() diff --git a/file-to-couchdb_tl2_bosch.py b/file-to-couchdb_tl2_bosch.py new file mode 100644 index 0000000000000000000000000000000000000000..1335219f7d2bd316569d017810988b590e929f5f --- /dev/null +++ b/file-to-couchdb_tl2_bosch.py @@ -0,0 +1,215 @@ +# -*- coding: utf-8 -*- +""" +Created on Fri Jul 1 12:12:37 2022 + +@author: becker07 +""" + +from matplotlib import pyplot as plt +from statistics import mean +from datetime import datetime +from IPython.display import Markdown as md +import numpy as np +import math +import statistics +import pandas as pd +import json +import couchdb +couch = couchdb.Server('http://a73434.berlin.ptb.de:5984') +db = couch['vl_db'] # existing + + +## Eingabe von: +# - Kalibrierscheinnummer +# - Jahr der Kalibrierung +# - laufende Nummer der Kalibrierung + + + +cal_cert = "75582" +year = "2024" +no = "0001" + + +json_file = "cal-" + year + "-tl2-kk-" + cal_cert + "_" + no +doc = db.get(json_file) + +# Die Daten aus dem File mit der entsprechenden Kalibrierscheinnummer werden eingelesen: +# datum, time, p_up und alle Temperaturen, +path='N:\\Abt_7\\Fb75\\Vakuum\\Messplaetze\\TL2\\Messwerte\\' +path='/home/friske01/N/Abt_7/Fb75/Vakuum/Messplaetze/TL2/Messwerte/' +datei = path + cal_cert + '_'+ no + "PTB" + year +datei_S = path + cal_cert + '_'+ no +"PTB" + year + "_S" +print(json_file) + +datei_pkt = pd.read_csv(datei, sep="\t", decimal = ',' ) +datei_S_pkt = pd.read_csv(datei_S, sep="\t", decimal = ',' ) + + +df = pd.read_csv(datei_S, sep="\t", decimal = ',' ) +df.to_csv('out.csv', index=False) + +df = pd.read_csv('out.csv') +time_sz=df["Zeit"] + + +l = len(df) +time_n = time_sz[l-2] +print(time_n) + +i=0 + +while i < l-1 : + + print(time_sz[i]) + time=[time_sz[i]] + + if time_sz[i] == time_sz[i+1]: + i=i+2 + else: + print('nur eine zeile', i) + zeile = df.loc[[i]] + df1 = df.loc [0:i, ] + df3 = df.loc [i+1:, ] + dfx= pd.concat([df1,zeile], axis=0) + df= pd.concat([dfx,df3], axis=0) + df.to_csv('out.csv', index=False) + print(i) + if time_sz[i] == time_n: + i=l + else: + l=l+2 + i=i+1 + print(i,l) + +df = pd.read_csv('out.csv') +time_sz=df["Zeit"] +l = len(df) +time1 = time_sz[l-1] + +time2 = time_sz[l-2] +print(time2) + +print(time1,time2) + +if time1 == time2: + print('ende') +else: + zeile = df.loc[[l-1]] + print(zeile) + df= pd.concat([df,zeile], axis=0) + df.to_csv('out.csv', index=False) + + +l = df['h_i'] +t = df['t_i'] +m_sz_i = df['m_i'] + + + + +l_1 = l[0:len(l):2] # Jede zweite Zeile im Bereich 0 bis n wählen. +l_2 = l[1:len(l):2] # Jede zweite Zeile im Bereich 1 bis n wählen. + +t_1 = t[0:len(t):2] # Jede zweite Zeile im Bereich 0 bis n wählen. +t_2 = t[1:len(t):2] # Jede zweite Zeile im Bereich 1 bis n wählen. + +m_sz_1 = m_sz_i[0:len(m_sz_i):2] # Jede zweite Zeile im Bereich 0 bis n wählen. +m_sz_2 = m_sz_i[1:len(m_sz_i):2] # Jede zweite Zeile im Bereich 1 bis n wählen. + +datum=datei_pkt["Datum"] +time=datei_pkt["Zeit"] +time_sz=datei_pkt["Zeit"] + + + + +p_up=datei_pkt["Druck"] +D=datei_pkt["d"] +#sh=datei_pkt["sh "] + +p_up=np.array(p_up) +p_up = np.asarray(p_up, dtype=float) + +q_tab=datei_pkt["q_mol"] +T_room=datei_pkt["Raumtemperatur"] +T_h2o=datei_pkt["T-H2O"] +T_wv=datei_pkt["T-WV"] +T_tl=datei_pkt["T-TL"] +T_rv=datei_pkt["T-RV"] +p_atm=datei_pkt["Umgebungsdruck p_0"]*100 # Umrechnung in Pa + +# Die Werte der Sägezähne befinden sich im File "Kalibrierscheinnummer_S". +# Da pro Messpunkt 2 Sägezähne gefahren werden, existieren auch für jeden Messpunkt +# jeweils zwei Zeiten t_i und zwei Hübe l_1 + + +m1_drift = datei_pkt["m1_D"] +m2_drift = datei_pkt["m2_D"] +# Im File Datei_S sind die einzelnen Hübe l_i der Nadel in einer Spalte gespeichert, der Hub l +# muss daher in Hub l_1 und l_2 aufgegliedert werden, da in der Regel 2 Sägezähne gefahren werden. + + +# Temperatur +lis_T_h2o = T_h2o.tolist() +lis_T_room = T_room.tolist() +lis_T_tl = T_tl.tolist() +lis_T_wv = T_wv.tolist() +lis_T_rv = T_rv.tolist() +# Druck +lis_p_atm = p_atm.tolist() +lis_p_up = p_up.tolist() +# Drift +lis_m1_drift = m1_drift.tolist() +lis_m2_drift = m2_drift.tolist() +lis_m1_sz = m_sz_1.tolist() +lis_m2_sz = m_sz_2.tolist() +# Datum +lis_date = datum.tolist() +lis_dtime = time.tolist() + +lis_l1 = l_1.tolist() +lis_l2 = l_2.tolist() +lis_t1 = t_1.tolist() +lis_t2 = t_2.tolist() + +lis_d = D.tolist() +#lis_sh = sh.tolist() + +print(lis_l1 ,lis_l2 ,lis_t1 ,lis_t2 ) + +datum_meas = lis_date[0:1] + + +print(lis_T_room) + + + +doc["Calibration"]["Measurement"]["Values"]={"Temperature": [{"Unit": "C","Type": "T-H2O","Comment":"Temperatur T ","Value": lis_T_h2o}, + {"Unit": "C","Type": "T-Room","Comment":"Temperatur T","Value": lis_T_room}, + {"Unit": "C","Type": "T-TL","Comment":"Temperatur T","Value": lis_T_tl}, + {"Unit": "C","Type": "T-WV","Comment":"Temperatur T","Value": lis_T_wv}, + {"Unit": "C","Type": "T-RV","Comment":"Temperatur T","Value": lis_T_rv}], + "Pressure": [{"Unit": "Pa","Type": "Atmosparic pressure","Value": lis_p_atm}, + {"Unit": "bar","Type": "Upstream pressure","Value": lis_p_up}], + "Time": [{"Unit": "s","Type": "Zeit des ersten Saegezahns","Value": lis_t1}, + {"Unit": "s","Type": "Zeit des zweiten Saegezahns","Value": lis_t2}], + "L": [{"Unit": "mm","Type": "Hub des ersten Saegezahns","Value": lis_l1}, + {"Unit": "mm","Type": "Hub des zweiten Saegezahns","Value": lis_l2}], + "D": [{"Unit": "mm","Type": "nomineller Nadeldurchmesser","Value": lis_d}], + #"SH": [{"Unit": "1","Type": "Anzahl SZ","Value": lis_sh}], + "Drift": [{"Unit": "Pa/s","Type": "Steigung des ersten Saegezahns","Value": lis_m1_sz}, + {"Unit": "Pa/s","Type": "Steigung des zweiten Saegezahns","Value": lis_m2_sz}, + {"Unit": "Pa/s","Type": "Drift des ersten Saegezahns","Value": lis_m1_drift}, + {"Unit": "Pa/s","Type": "Drift des zweiten Saegezahns","Value": lis_m2_drift}], + "DateTime": [{"Unit": "yyyy-mm-dd","Type": "Date","Value": lis_date}, + {"Unit": "hh:mm","Type": "Time ","Value": lis_dtime}]} + + + +doc["Calibration"]["Measurement"]["Date"]=[{"Type": "measurement","Value":datum_meas}] + + +db.save(doc) + + diff --git a/inputs.ini b/inputs.ini index 07bcf55512b7b87505df881ab23b312b7a2474a0..66d102926fea2e6e7879a088d1ab28bd47e4576b 100644 --- a/inputs.ini +++ b/inputs.ini @@ -1,16 +1,16 @@ [input_cer] -#Beispiel für cal_cert : cal_cert = 75560 -cal_cert = 75601 +#Beispiel für cal_cert : cal_cert = 75562 +cal_cert = 75627 #Beispiel für api_cert : api_cert = 75560_0001,75561_0001 -api_cert = 75601_0002 +api_cert = 75627 [input_gen] year = 2024 -no = 0002 +no = 0001 [bur] -RefNo = 9 +RefNo = 23 # Verwendung für die python-scripte: API und attachment [labbook] diff --git a/lw-to-couchdb_tlv.py b/lw-to-couchdb_tlv.py new file mode 100644 index 0000000000000000000000000000000000000000..d3e889c10e747155d90ec323a88fd3f390d3ea0f --- /dev/null +++ b/lw-to-couchdb_tlv.py @@ -0,0 +1,261 @@ +# -*- coding: utf-8 -*- +""" +Created on Fri Jul 1 12:12:37 2022 + +@author: becker07 +""" +import sys +import numpy as np +import couchdb +import pandas as pd +import json +import csv +import re +from matplotlib import pyplot as plt +import pathlib + +try: + from configparser import ConfigParser +except ImportError: + from ConfigParser import ConfigParser # ver. < 3.0 + + +configtl = ConfigParser() +ini_values = ConfigParser() +# parse existing file +configtl.read('tl.ini') +ini_values.read('inputs.ini') + +server=configtl.get('couch', 'couch') +db_vl=configtl.get('couch', 'db') + +couch = couchdb.Server(server) +db = couch[db_vl] # existing + + +## Eingabe von: +# - Kalibrierscheinnummer +# - Jahr der Kalibrierung +# - laufende Nummer der Kalibrierung + +path=configtl.get('path', 'path_files') + + + +cal_cert = ini_values.get('input_cer', 'cal_cert') +year = ini_values.get('input_gen', 'year') +no = ini_values.get('input_gen', 'no') +QMS="ja" ######### ja beim Scan +kk_ik_pn= "kk" ######## kk,ik oder pn + + + +json_file = "cal-" + year + "-fm1-ik-" + cal_cert + "_" + no +doc = db.get(json_file) +print(json_file) + +#path='C:\\Users\\becker07\\python\\TL1\\' + +dateiTab = path + cal_cert + "_" + no +#dateiTab='C:\\Users\\becker07\\python\\TL1\\75561' +print(dateiTab) + + +dateiTab=pd.read_csv(dateiTab, sep="\t", decimal = ',' ) + +L_ar=dateiTab["C "] +print('Leitwert j= 1, nein = 0 :: ', L_ar) + +L=L_ar[0] +print('Leitwert : ',L) + + +#gauge = float(doc["Calibration"]["CustomerObject"]["Setup"]["CDG"]) +gauge = 10 +print(gauge) + +# Die Daten aus dem File mit der entsprechenden Kalibrierscheinnummer werden eingelesen: +# datum, time, p_up und alle Temperaturen, + + +#datei = "N:\Abt_7\Fb75\Vakuum\Messplaetze\TL1\Kalibrierungen\\22\\TP7464.txt" + +if True: + + + m1=dateiTab["m1"] + m2=dateiTab["m2"] + m3=dateiTab["m3"] + m4=dateiTab["m4"] + + t1=dateiTab["t1"] + t2=dateiTab["t2"] + t3=dateiTab["t3"] + t4=dateiTab["t4"] + time1=dateiTab["time1"] + time2=dateiTab["time2"] + time3=dateiTab["time3"] + + pmean=dateiTab["p-mean"]*100 + pmin=dateiTab["p-min"]*100 + pmax=dateiTab["p-max"]*100 + + + h=dateiTab["distance"] + + + print("Constantes Volumen",h) + + + +else: + print("Constanter Leitwert") + + +datum=dateiTab["Datum"] +time=dateiTab["Zeit"] +gas=dateiTab["Gasart"] + +if gauge== 0.01 : + p_offs_01=dateiTab["p-offset"]*100 + p_fill_01=dateiTab["p-fill "]*100 + p_fill_srg=dateiTab["p-max"] + p_offs_srg=dateiTab["p-min"] + +else : + p_offs=dateiTab["p-offset"]*100 + p_fill=dateiTab["p-fill "]*100 +#p_fill=np.genfromtxt(dateiTab,skip_header=1,delimiter='\t',usecols=(5)) + +p_ig=dateiTab["Kommentar"] +T_room=dateiTab["T-Raum"] +T_fm=dateiTab["T-FM"] +T_tl1=dateiTab["T-TL1"] +T_tl2=dateiTab["T-TL2"] +T_tl3=dateiTab["T-TL3"] +T_tl4=dateiTab["T-TL4"] + +#print(T_fm,T_room,T_tl1, T_tl2,T_tl3,T_tl4) + + +# Temperatur +lis_T_fm = T_fm.tolist() +lis_T_room = T_room.tolist() +lis_T_tl1 = T_tl1.tolist() +lis_T_tl2 = T_tl2.tolist() +lis_T_tl3 = T_tl3.tolist() +lis_T_tl4 = T_tl4.tolist() + + +# Druck + +if gauge == 0.01 : + lis_p_offs_01 = p_offs_01.tolist() + lis_p_fill_01 = p_fill_01.tolist() + lis_p_offs_srg = p_offs_srg.tolist() + lis_p_fill_srg = p_fill_srg.tolist() + + + +else: + lis_p_offs = p_offs.tolist() + lis_p_fill = p_fill.tolist() + + + +lis_p_ig = p_ig.tolist() +# Datum +# Datum +lis_datum = datum.tolist() +lis_time = time.tolist() + + +datum_meas = lis_datum[0:1] + + + + +if True: + #Leitwert + lis_c = L_ar.tolist() + + # Steigung SZ + lis_m1 = m1.tolist() + lis_m2 = m2.tolist() + lis_m3 = m3.tolist() + lis_m4 = m4.tolist() + + # Zeitpunkte + lis_t1 = t1.tolist() + lis_t2 = t2.tolist() + lis_t3 = t3.tolist() + lis_t4 = t4.tolist() + + # Zeit pro SZ + lis_time1 = time1.tolist() + lis_time2 = time2.tolist() + lis_time3 = time3.tolist() + + # Druck der SZ + lis_pmean = pmean.tolist() + lis_pmin = pmin.tolist() + lis_pmax= pmax.tolist() + + # Druck der SZ + lis_h = h.tolist() + + + doc["Calibration"]["Measurement"]["Values"]={"Temperature": [{"Unit": "C","Type": "T-FM","Comment":"Temperatur T ","Value": lis_T_fm}, + {"Unit": "C","Type": "T-Room","Comment":"Temperatur T","Value": lis_T_room}, + {"Unit": "C","Type": "T-TL1","Comment":"Temperatur T","Value": lis_T_tl1}, + {"Unit": "C","Type": "T-TL2","Comment":"Temperatur T","Value":lis_T_tl2}, + {"Unit": "C","Type": "T-TL2","Comment":"Temperatur T","Value":lis_T_tl3}, + {"Unit": "C","Type": "T-TL3","Comment":"Temperatur T","Value": lis_T_tl4}], + "Pressure": [{"Unit": "Pa","Type": "Offset pressure","Value":lis_p_offs}, + {"Unit": "Pa","Type": "pressure mean","Value":lis_p_fill}], + "Date": [{"Unit": "year-month-day","Type": "Datum","Value":lis_datum}, + {"Unit": "hh:mm:ss","Type": "Messzeit","Value":lis_time}] + } +# print(doc["Calibration"]["Measurement"]["Values"]) + + + + doc["Calibration"]["Measurement"]["Date"]=[{"Type": "measurement","Value": datum_meas}] + + doc["Calibration"]["Measurement"]["Values"]["Conductance"]={"t": [{"Unit": "s","Type": "t1","Comment":"Zeitpunkt t1 des 1.SZ","Value": lis_t1}, + {"Unit": "s","Type": "t2","Comment":"Zeitpunkt t2 des 2.SZ","Value": lis_t2}, + {"Unit": "s","Type": "t3","Comment":"Zeitpunkt t3 des 3.SZ","Value": lis_t3}, + {"Unit": "s","Type": "t4","Comment":"Zeitpunkt t4 des 4.SZ","Value": lis_t4}], + "time": [{"Unit": "s","Type": "time1","Comment":"Zeit t2-t1 von SZ","Value": lis_time1}, + {"Unit": "s","Type": "time2","Comment":"Zeit t3-t2 von SZ","Value": lis_time2}, + {"Unit": "s","Type": "time3","Comment":"Zeit t4-t3 von SZ","Value": lis_time3}], + "m": [{"Unit": "Pa/s","Type": "m1","Comment":"Steigung m1 des 1.SZ","Value": lis_m1}, + {"Unit": "Pa/s","Type": "m2","Comment":"Steigung m1 des 2.SZ","Value": lis_m2}, + {"Unit": "Pa/s","Type": "m3","Comment":"Steigung m1 des 3.SZ","Value": lis_m3}, + {"Unit": "Pa/s","Type": "m3","Comment":"Steigung m1 des 4.SZ","Value": lis_m3}], + "pressure": [{"Unit": "Pa","Type": "pmean","Comment":"Mittelwert von p","Value": lis_pmean}, + {"Unit": "Pa","Type": "pmin","Comment":"p_min des SZ","Value": lis_pmin}, + {"Unit": "Pa","Type": "pmax","Comment":"p_max des SZ","Value": lis_pmax}], + "l": [{"Unit": "mm","Type": "l","Comment":"Hub des Verdrängers","Value": lis_h}], + "C": [{"Unit": "m^3/s","Type": "Constanter Leitwert ","Value": lis_c}] + + } + + + + + + print("Constantes Volumen") + + + + + + +doc["Calibration"]["Measurement"]["Date"]=[{"Type": "measurement","Value": datum_meas}] + + +db.save(doc) + + + diff --git a/out.csv b/out.csv new file mode 100644 index 0000000000000000000000000000000000000000..dfee2db99d473c3080a75ea55b369199314eaae9 --- /dev/null +++ b/out.csv @@ -0,0 +1,117 @@ +Datum,Zeit,h_i,t_i,b_i,pos1_i,m_i,pos2_i +2024-06-07,10:56 ,3.000005,29.8418211,-149.74933,48.0,3.64013766,44.999995 +2024-06-07,10:56 ,3.000009,29.8543906,-149.82995,44.999999,3.64130542,41.99999 +2024-06-07,11:04 ,3.000008,29.9963951,-148.91506,48.0,3.62223738,44.999992 +2024-06-07,11:04 ,3.000009,29.8804367,-148.50456,44.999999,3.6225564,41.99999 +2024-06-07,11:13 ,3.000005,30.1808797,-149.53121,48.0,3.58224188,44.999995 +2024-06-07,11:13 ,3.000009,30.4745003,-150.3599,44.999999,3.57491999,41.99999 +2024-06-07,11:23 ,3.000008,30.7240212,-153.02236,48.0,3.54394899,44.999992 +2024-06-07,11:23 ,3.000009,30.8445062,-152.79717,44.999999,3.52280466,41.99999 +2024-06-07,11:33 ,3.000005,31.1874242,-151.05361,48.0,3.48302604,44.999995 +2024-06-07,11:33 ,3.000002,31.3229508,-151.29232,44.999999,3.47557682,41.999997 +2024-06-07,11:42 ,3.000008,31.560344,-150.95359,48.0,3.44047555,44.999992 +2024-06-07,11:42 ,3.000009,31.7825578,-151.40787,44.999999,3.4307144,41.99999 +2024-06-07,11:52 ,3.000008,32.1141862,-152.85104,48.0,3.38317918,44.999992 +2024-06-07,11:52 ,3.000009,32.2056306,-152.79312,44.999999,3.37177464,41.99999 +2024-06-07,12:02 ,3.000005,32.5242424,-152.19191,48.0,3.33950642,44.999995 +2024-06-07,12:02 ,3.000002,32.543621,-151.99215,44.999999,3.33137952,41.999997 +2024-06-07,12:12 ,3.000008,33.0109309,-152.62936,48.0,3.29128437,44.999992 +2024-06-07,12:12 ,3.000005,33.0865171,-152.39961,44.999999,3.27682176,41.999994 +2024-06-07,12:21 ,3.000008,33.6149704,-153.42164,48.0,3.24363346,44.999992 +2024-06-07,12:21 ,3.000002,33.7722813,-153.46169,44.999999,3.22971049,41.999997 +2024-06-07,02:33 ,5.000005,27.3818092,-198.72597,48.0,6.57173424,42.999995 +2024-06-07,02:33 ,5.000005,27.4215444,-198.52599,42.999999,6.55491867,37.999994 +2024-06-07,02:42 ,5.000005,28.0919744,-202.22123,48.0,6.4414566,42.999995 +2024-06-07,02:42 ,5.000005,28.0146076,-201.40891,42.999999,6.43024926,37.999994 +2024-06-07,02:52 ,5.000008,28.7980029,-200.24505,48.0,6.32491963,42.999992 +2024-06-07,02:52 ,5.000005,28.6643156,-199.49139,42.999999,6.32812583,37.999994 +2024-06-07,03:01 ,5.000005,29.1365048,-202.8938,48.0,6.22956702,42.999995 +2024-06-07,03:01 ,5.000009,29.1698382,-201.76309,42.999999,6.18368527,37.99999 +2024-06-07,03:11 ,5.000008,29.6993201,-201.15099,48.0,6.12125118,42.999992 +2024-06-07,03:11 ,5.000005,29.7407254,-200.04998,42.999999,6.07570861,37.999994 +2024-06-07,03:21 ,5.000001,30.2977441,-206.1357,48.0,5.99264774,42.999999 +2024-06-07,03:21 ,5.000009,30.0955158,-204.29856,42.999999,5.97187177,37.99999 +2024-06-07,03:31 ,5.000005,30.8453427,-201.82768,48.0,5.87562556,42.999995 +2024-06-07,03:31 ,5.000009,30.8981522,-202.09143,42.999999,5.87411927,37.99999 +2024-06-07,03:47 ,7.000008,25.5636285,-267.71595,48.0,9.98746942,40.999992 +2024-06-07,03:47 ,7.000005,25.1494489,-262.36184,40.999999,9.93905864,33.999994 +2024-06-07,03:56 ,7.000008,25.6073633,-263.11251,48.0,9.87729632,40.999992 +2024-06-07,03:56 ,7.000005,25.7095739,-263.09799,40.999999,9.83746364,33.999994 +2024-06-07,04:06 ,7.000008,26.0145631,-268.02958,48.0,9.8063761,40.999992 +2024-06-07,04:06 ,7.000005,25.6296707,-264.32952,40.999999,9.80927661,33.999994 +2024-06-07,04:15 ,7.000005,25.9228132,-265.36161,48.0,9.7704912,40.999995 +2024-06-07,04:15 ,7.000001,25.8186338,-263.542,40.999999,9.73943896,33.999998 +2024-06-07,04:25 ,7.000008,26.1091432,-265.17538,48.0,9.70653791,40.999992 +2024-06-07,04:25 ,7.000005,26.0494753,-265.51919,40.999999,9.74196963,33.999994 +2024-06-07,04:34 ,7.000008,26.1629062,-266.02522,48.0,9.74999568,40.999992 +2024-06-07,04:34 ,7.000005,25.8150491,-261.35683,40.999999,9.70053665,33.999994 +2024-06-07,04:44 ,7.000008,26.2547451,-268.74098,48.0,9.70338839,40.999992 +2024-06-07,04:44 ,7.000005,26.1760111,-267.18944,40.999999,9.67330121,33.999994 +2024-06-10,09:49 ,11.000004,28.3909416,-409.32224,48.0,13.9129322,36.999996 +2024-06-10,09:49 ,11.000004,28.3909416,-409.32224,48.0,13.9129322,36.999996 +2024-06-10,10:03 ,10.000006,26.098329,-377.97784,48.0,13.9217281,37.999994 +2024-06-10,10:03 ,10.000006,26.0025944,-371.28724,38.000001,13.7156794,27.999995 +2024-06-10,10:12 ,10.000006,26.1149797,-379.45957,48.0,13.8789913,37.999994 +2024-06-10,10:12 ,10.000006,26.003001,-376.00002,38.000001,13.8057152,27.999995 +2024-06-10,10:22 ,10.00001,26.2187312,-377.19986,48.0,13.8831609,37.99999 +2024-06-10,10:22 ,10.000003,26.0808411,-373.87039,38.000001,13.8289017,27.999998 +2024-06-10,10:31 ,10.000006,26.1548925,-377.31186,48.0,13.9202968,37.999994 +2024-06-10,10:31 ,10.00001,25.7029933,-372.19965,38.000001,13.9661419,27.999991 +2024-06-10,10:40 ,10.000006,26.0409257,-376.29786,48.0,13.8924731,37.999994 +2024-06-10,10:40 ,10.000006,25.9870763,-373.77285,38.000001,13.8240964,27.999995 +2024-06-10,10:50 ,10.000006,26.0962861,-381.02027,48.0,14.0181737,37.999994 +2024-06-10,10:50 ,10.000006,26.0078428,-375.44211,38.000001,13.8513647,27.999995 +2024-06-10,10:59 ,10.000006,25.9050031,-380.9845,48.0,14.098956,37.999994 +2024-06-10,10:59 ,10.000006,25.9602504,-374.01521,38.000001,13.8004912,27.999995 +2024-06-10,11:09 ,10.000006,25.8607768,-380.0491,48.0,14.0559621,37.999994 +2024-06-10,11:09 ,10.000006,25.7020852,-372.21112,38.000001,13.8377927,27.999995 +2024-06-10,11:18 ,10.000006,25.9649933,-376.51122,48.0,13.9257584,37.999994 +2024-06-10,11:18 ,10.000006,25.5644139,-372.15657,38.000001,13.9736264,27.999995 +2024-06-10,11:28 ,10.000006,25.9392357,-381.53028,48.0,14.160297,37.999994 +2024-06-10,11:28 ,10.000006,25.7686629,-371.61666,38.000001,13.8693133,27.999995 +2024-06-10,11:37 ,10.000006,25.9203043,-384.06857,48.0,14.2023246,37.999994 +2024-06-10,11:37 ,10.000006,25.7242647,-375.66172,38.000001,13.9837513,27.999995 +2024-06-10,11:47 ,10.000006,25.7779924,-382.91781,48.0,14.1640902,37.999994 +2024-06-10,11:47 ,10.000006,25.5447809,-372.49594,38.000001,13.8854172,27.999995 +2024-06-10,11:56 ,10.000006,25.8228311,-385.51928,48.0,14.3976579,37.999994 +2024-06-10,11:56 ,10.000006,25.9397932,-371.76567,38.000001,13.8025263,27.999995 +2024-06-10,12:06 ,10.000006,25.9073711,-380.31857,48.0,14.0569868,37.999994 +2024-06-10,12:06 ,10.000006,25.720718,-377.96644,38.000001,14.0675482,27.999995 +2024-06-10,12:15 ,10.000006,25.9599848,-380.4137,48.0,14.0466068,37.999994 +2024-06-10,12:15 ,10.000006,25.836866,-374.99699,38.000001,13.9038918,27.999995 +2024-06-10,12:24 ,10.000006,26.0545574,-382.51607,48.0,14.1167652,37.999994 +2024-06-10,12:24 ,10.000006,25.9666584,-373.12609,38.000001,13.8029348,27.999995 +2024-06-10,12:34 ,10.000006,26.1452238,-375.72904,48.0,13.8694946,37.999994 +2024-06-10,12:34 ,10.000006,26.0897271,-370.37495,38.000001,13.693779,27.999995 +2024-06-10,12:43 ,10.000006,26.0279793,-376.51283,48.0,13.9259306,37.999994 +2024-06-10,12:43 ,10.000006,25.9367021,-372.78163,38.000001,13.8310811,27.999995 +2024-06-10,12:53 ,10.000006,26.0146295,-377.23027,48.0,13.9538128,37.999994 +2024-06-10,12:53 ,10.000006,25.9178719,-369.95989,38.000001,13.7253896,27.999995 +2024-06-10,01:02 ,10.000006,25.9771016,-379.47225,48.0,13.929085,37.999994 +2024-06-10,01:02 ,10.000006,25.9433212,-376.63783,38.000001,13.8379674,27.999995 +2024-06-10,01:12 ,10.000006,26.1113046,-373.93246,48.0,13.7494265,37.999994 +2024-06-10,01:12 ,10.000006,25.7521679,-374.98321,38.000001,13.9819767,27.999995 +2024-06-10,01:21 ,10.000006,26.0678185,-375.86739,48.0,13.8735966,37.999994 +2024-06-10,01:21 ,10.000006,25.7550657,-369.39113,38.000001,13.7906124,27.999995 +2024-06-10,01:31 ,10.000006,26.0486312,-376.01962,48.0,13.8485059,37.999994 +2024-06-10,01:31 ,10.000006,25.7197291,-368.31384,38.000001,13.7259937,27.999995 +2024-06-10,01:40 ,10.000006,26.0325697,-372.95962,48.0,13.7206058,37.999994 +2024-06-10,01:40 ,10.00001,25.9102391,-374.10943,38.000001,13.8297617,27.999991 +2024-06-10,01:50 ,10.000006,26.0842395,-377.14347,48.0,13.9413484,37.999994 +2024-06-10,01:50 ,10.000006,25.6094704,-366.3876,38.000001,13.7798086,27.999995 +2024-06-10,01:59 ,10.000006,26.0845551,-370.38434,48.0,13.6677565,37.999994 +2024-06-10,01:59 ,10.000006,25.5816786,-369.15494,38.000001,13.8883747,27.999995 +2024-06-10,02:08 ,10.000003,26.0372718,-378.07093,48.0,13.9094809,37.999997 +2024-06-10,02:08 ,10.000006,25.6536076,-373.02652,38.000001,13.9208695,27.999995 +2024-06-10,02:17 ,14.000006,26.1847385,-491.97381,48.0,19.0508609,33.999994 +2024-06-10,02:17 ,14.000006,26.1847385,-491.97381,48.0,19.0508609,33.999994 +2024-06-10,02:26 ,14.000006,26.4365576,-507.4393,48.0,19.5117047,33.999994 +2024-06-10,02:26 ,14.000006,26.4365576,-507.4393,48.0,19.5117047,33.999994 +2024-06-10,02:35 ,14.000006,26.4297141,-497.31188,48.0,19.1062182,33.999994 +2024-06-10,02:35 ,14.000006,26.4297141,-497.31188,48.0,19.1062182,33.999994 +2024-06-10,02:44 ,14.000006,26.508811,-499.41218,48.0,19.1678224,33.999994 +2024-06-10,02:44 ,14.000006,26.508811,-499.41218,48.0,19.1678224,33.999994 +2024-06-10,02:53 ,14.000006,26.4483797,-491.58295,48.0,18.8485254,33.999994 +2024-06-10,02:53 ,14.000006,26.4483797,-491.58295,48.0,18.8485254,33.999994 +2024-06-10,03:02 ,14.000009,26.4073299,-488.76229,48.0,18.7432539,33.999991 +2024-06-10,03:02 ,14.000009,26.4073299,-488.76229,48.0,18.7432539,33.999991 diff --git a/tl.ini b/tl.ini index ad0a56f09b08bc3541b5f54615102c7cbe5186bd..21c269e9773d3c73a3f2726815f77b953b7710f2 100644 --- a/tl.ini +++ b/tl.ini @@ -1,5 +1,5 @@ [path] -path=/home/friske01/P/TLV/KS/ks- +path=/home/friske01/P/TLV/KS/ path_files=/home/friske01/N/Abt_7/Fb75/Vakuum/Messplaetze/TL1/Messwerte/ diff --git a/writeLaTeX-ks-TLA.py b/writeLaTeX-ks-TLA.py index 927ee0c4633ffc351392b573530486746b7a2777..9819b032659e9050722727d96f42b718943a2b43 100644 --- a/writeLaTeX-ks-TLA.py +++ b/writeLaTeX-ks-TLA.py @@ -306,15 +306,17 @@ sectionResult_pup_mean_en = 'The mean leak rate (molar flow) for relativ pressur sectionResult_pup_int1 = 'Die molare Leckrate, bei einem relativ zur Atmosphäre eingestellten Druck von \\( p_\\text{up}= \\SI{ ' + PressureUpstream + '}{\\kPa} \\) ergab einen Wert von:' sectionResult_pup_int2 = 'Der Wert ergab sich aus der Interpolation der gemessenen Werte in einem Bereich von \\(p_{\\text{up}_1}=(\\num{ ' + PressureUpstreamMin + '}\\pm \\SI{0.1})~ \\si{kPa} \\) and \\(p_{\\text{up}_2}=(\\num{ ' + PressureUpstreamMax + '}\\pm \\SI{0.1})~ \\si{kPa} \\). Die Unsicherheit des relativ eingestellten Drucks ist \\( \\SI{0.5}{\\percent} \\).' - +#print("sectionResult1:", sectionResult1) +#print("sectionResult_pup_mean:", sectionResult_pup_mean) +#print("q_mol_Val:", q_mol_Val) sectionResult1_en = NoOfMeasurements + ' measurements were carried out on several days at a leak temperature \\( \\vartheta_\\text{TL}= \\num{ ' + TemperatureTL + '}\\pm \\SI{0.1}{\\degreeCelsius} \\) (thermostated) and an atmospheric pressure between \\(p_{\\text{atm}_1}=(\\num{ ' + PressureAtmosmin + ' }\\pm \\SI{0.1})~ \\si{ Pa} \\) and \\(p_{\\text{atm}_2}=(\\num{ ' + PressureAtmosmax + ' } \\pm \\num{0.1})~ \\si{ Pa} \\).' sectionResult2_en = ' From this the \\(pV\\)-flow can be calculated for a place at a temperature \\(\\vartheta_\\text{Ch}\\) (in \\si{\\degreeCelsius}), where a device under test is mounted and \\(T_0 = \\SI{273.15}{\\kelvin}\\), by the equation ' sectionResult3_en = 'At the temperature \\( \\vartheta_\\text{Ch}= \\SI{ 23 }{\\degreeCelsius} \\) the flow rate is' sectionResult4_en = 'The relative uncertainty \\(U\\) of the stated leak rate are \\( \\SI{'+ LeakUncertainty +'}{\\percent} \\).' if res == 1: - print ( "Standartmessung - mit Reservoir" ) - sectionResult = '\\section{' + sectionTitelResult + '\\linebreak {\\small \\emph{' + sectionTitelResult_en + '}}}\n' + sectionResult1 + sectionResult_std + '\\begin{english}' + sectionResult1_en + sectionResult_std_en + '\\end{english} ' + tab_q_mol_Val + print ( "Standardmessung - mit Reservoir" ) + sectionResult = '\\section{' + sectionTitelResult + '\\linebreak {\\small \\emph{' + sectionTitelResult_en + '}}}\n' + sectionResult1 + sectionResult_std + '\n\\begin{english}' + sectionResult1_en + sectionResult_std_en + '\\end{english} ' + tab_q_mol_Val sectionResult_en = '\\section{' + sectionTitelResult_en + '}\n' + sectionResult1_en + sectionResult_std_en + tab_q_mol_Val_en @@ -322,15 +324,15 @@ if res == 1: else: if(analy!='mean'): - print ( "Standartmessung - ohne Reservoir" ) + print ( "Standardmessung - ohne Reservoir" ) - sectionResult = '\\section{' + sectionTitelResult + '\\linebreak {\\small \\emph{' + sectionTitelResult_en + '}}}\n' - + sectionResult1 + sectionResult_pup_mean + q_mol_Val - + '\\begin{english}' + sectionResult1_en + ' The mean leak rate (molar flow) was determined to:' + q_mol_Val + '\\end{english} \n' + sectionResult = '\\section{' + sectionTitelResult + '\\linebreak {\\small \\emph{' + sectionTitelResult_en + '}}}\n' \ + + sectionResult1 + sectionResult_pup_mean + q_mol_Val \ + + '\n\\begin{english}' + sectionResult1_en + sectionResult_std_en + q_mol_Val + '\\end{english} \n' sectionResult = sectionResult + sectionResult2 + '\\begin{english}' + sectionResult2_en + '\\end{english} \n' + q_pV_Val_all + sectionResult3 + '\\begin{english}' + sectionResult3_en + '\\end{english} \n' + tab_q_pV_Val + sectionResult4 + '\\begin{english}' + sectionResult4_en + '\\end{english} \n' -sectionResult_en = sectionResult_en + sectionResult2_en + q_pV_Val_all + sectionResult3_en + tab_q_pV_Val_en + sectionResult4_en +#sectionResult_en = sectionResult_en + sectionResult2_en + q_pV_Val_all + sectionResult3_en + tab_q_pV_Val_en + sectionResult4_en