commit 9afb7d73f77fdb5cd146af2e318322cd43333f00 Author: xans Date: Sun May 5 10:32:09 2024 +0200 Upload files to "/" diff --git a/2823A14043.csv b/2823A14043.csv new file mode 100644 index 0000000..1ef8bed --- /dev/null +++ b/2823A14043.csv @@ -0,0 +1,34 @@ +DateTime,TEMP,CAL RREF,CAL VREF,G10K,G100K,G1V0,G0V1,OCOMP1K,OCOMP10K,ACALTEMP,CALTEMP,G1mA,G10V +02-05-24 10:14:42,40.1,40.0, 39.9962225E+03, 7.08619112E+00, 1.00330364E+00, 1.00305375E+00, 987.036522E-03, 987.491018E-03, 1.00270185E+00, 1.00330355E+00, 39.9812629E+00, 34.5509247E+00, 987.149290E-03 +02-05-24 11:14:43,39.5,39.4, 39.9962225E+03, 7.08619112E+00, 1.00330259E+00, 1.00305304E+00, 987.036309E-03, 987.490990E-03, 1.00270083E+00, 1.00330251E+00, 39.3900940E+00, 34.5509247E+00, 987.148432E-03 +02-05-24 12:14:43,38.7,38.6, 39.9962225E+03, 7.08619112E+00, 1.00330211E+00, 1.00305207E+00, 987.036651E-03, 987.491398E-03, 1.00270073E+00, 1.00330203E+00, 38.6494401E+00, 34.5509247E+00, 987.146593E-03 +02-05-24 13:14:43,38.2,38.3, 39.9962225E+03, 7.08619112E+00, 1.00330160E+00, 1.00305174E+00, 987.036164E-03, 987.490751E-03, 1.00269941E+00, 1.00330152E+00, 38.2977734E+00, 34.5509247E+00, 987.146757E-03 +02-05-24 14:14:42,38.3,38.4, 39.9962225E+03, 7.08619112E+00, 1.00330222E+00, 1.00305227E+00, 987.036620E-03, 987.491295E-03, 1.00270040E+00, 1.00330213E+00, 38.3767076E+00, 34.5509247E+00, 987.146609E-03 +02-05-24 15:14:42,38.2,38.2, 39.9962225E+03, 7.08619112E+00, 1.00330201E+00, 1.00305187E+00, 987.036496E-03, 987.490952E-03, 1.00269991E+00, 1.00330193E+00, 38.2353289E+00, 34.5509247E+00, 987.145982E-03 +02-05-24 16:14:42,38.0,37.9, 39.9962225E+03, 7.08619112E+00, 1.00330165E+00, 1.00305171E+00, 987.036507E-03, 987.491180E-03, 1.00269966E+00, 1.00330156E+00, 37.9523180E+00, 34.5509247E+00, 987.146220E-03 +02-05-24 17:14:42,37.6,37.9, 39.9962225E+03, 7.08619112E+00, 1.00330159E+00, 1.00305166E+00, 987.036531E-03, 987.491009E-03, 1.00269980E+00, 1.00330151E+00, 37.8606010E+00, 34.5509247E+00, 987.145243E-03 +02-05-24 18:14:43,38.2,38.3, 39.9962225E+03, 7.08619112E+00, 1.00330251E+00, 1.00305268E+00, 987.036589E-03, 987.491168E-03, 1.00270013E+00, 1.00330243E+00, 38.3307608E+00, 34.5509247E+00, 987.146800E-03 +02-05-24 19:14:43,38.3,38.3, 39.9962225E+03, 7.08619112E+00, 1.00330185E+00, 1.00305254E+00, 987.036246E-03, 987.490934E-03, 1.00269925E+00, 1.00330176E+00, 38.3405796E+00, 34.5509247E+00, 987.147040E-03 +02-05-24 20:14:43,38.5,38.7, 39.9962225E+03, 7.08619112E+00, 1.00330286E+00, 1.00305329E+00, 987.036562E-03, 987.491091E-03, 1.00270047E+00, 1.00330277E+00, 38.6429724E+00, 34.5509247E+00, 987.147465E-03 +02-05-24 21:14:42,39.3,39.5, 39.9962225E+03, 7.08619112E+00, 1.00330394E+00, 1.00305477E+00, 987.036380E-03, 987.491344E-03, 1.00270122E+00, 1.00330386E+00, 39.4945407E+00, 34.5509247E+00, 987.149156E-03 +02-05-24 22:14:42,39.6,39.6, 39.9962225E+03, 7.08619112E+00, 1.00330390E+00, 1.00305463E+00, 987.036358E-03, 987.491654E-03, 1.00270136E+00, 1.00330382E+00, 39.5797788E+00, 34.5509247E+00, 987.149722E-03 +02-05-24 23:14:42,38.9,38.7, 39.9962225E+03, 7.08619112E+00, 1.00330264E+00, 1.00305328E+00, 987.036208E-03, 987.490875E-03, 1.00270026E+00, 1.00330255E+00, 38.7627188E+00, 34.5509247E+00, 987.147960E-03 +03-05-24 00:14:42,38.3,38.2, 39.9962225E+03, 7.08619112E+00, 1.00330181E+00, 1.00305274E+00, 987.035997E-03, 987.491087E-03, 1.00269886E+00, 1.00330173E+00, 38.2317397E+00, 34.5509247E+00, 987.147524E-03 +03-05-24 01:14:43,37.3,37.1, 39.9962225E+03, 7.08619112E+00, 1.00330088E+00, 1.00305113E+00, 987.036291E-03, 987.491235E-03, 1.00269816E+00, 1.00330080E+00, 37.1754520E+00, 34.5509247E+00, 987.145626E-03 +03-05-24 02:14:42,36.5,36.4, 39.9962225E+03, 7.08619112E+00, 1.00329992E+00, 1.00305051E+00, 987.036113E-03, 987.490139E-03, 1.00269672E+00, 1.00329984E+00, 36.4033637E+00, 34.5509247E+00, 987.143797E-03 +03-05-24 03:14:42,36.0,35.9, 39.9962225E+03, 7.08619112E+00, 1.00329976E+00, 1.00305009E+00, 987.036279E-03, 987.490257E-03, 1.00269639E+00, 1.00329968E+00, 35.9549189E+00, 34.5509247E+00, 987.142727E-03 +03-05-24 04:14:42,35.6,35.6, 39.9962225E+03, 7.08619112E+00, 1.00329937E+00, 1.00304991E+00, 987.036218E-03, 987.490170E-03, 1.00269567E+00, 1.00329929E+00, 35.5763076E+00, 34.5509247E+00, 987.142347E-03 +03-05-24 05:14:43,35.2,35.2, 39.9962225E+03, 7.08619112E+00, 1.00329915E+00, 1.00304940E+00, 987.036332E-03, 987.489556E-03, 1.00269555E+00, 1.00329907E+00, 35.2263438E+00, 34.5509247E+00, 987.141203E-03 +03-05-24 22:14:43,33.3,34.4, 39.9962225E+03, 7.08619112E+00, 1.00330175E+00, 1.00305188E+00, 987.037421E-03, 987.491420E-03, 1.00269546E+00, 1.00330168E+00, 34.2636294E+00, 34.5509247E+00, 987.131240E-03 +03-05-24 23:14:42,36.0,36.3, 39.9962225E+03, 7.08619112E+00, 1.00330269E+00, 1.00305326E+00, 987.036669E-03, 987.491160E-03, 1.00269710E+00, 1.00330261E+00, 36.2820208E+00, 34.5509247E+00, 987.137671E-03 +04-05-24 00:14:42,36.8,36.9, 39.9962225E+03, 7.08619112E+00, 1.00330286E+00, 1.00305378E+00, 987.036560E-03, 987.491139E-03, 1.00269768E+00, 1.00330278E+00, 36.8925574E+00, 34.5509247E+00, 987.140285E-03 +04-05-24 01:14:42,37.0,37.1, 39.9962225E+03, 7.08619112E+00, 1.00330283E+00, 1.00305369E+00, 987.036106E-03, 987.490616E-03, 1.00269710E+00, 1.00330275E+00, 37.0948326E+00, 34.5509247E+00, 987.141442E-03 +04-05-24 02:14:43,37.2,37.3, 39.9962225E+03, 7.08619112E+00, 1.00330284E+00, 1.00305400E+00, 987.036019E-03, 987.490833E-03, 1.00269714E+00, 1.00330276E+00, 37.2822479E+00, 34.5509247E+00, 987.142633E-03 +04-05-24 03:14:43,37.2,37.2, 39.9962225E+03, 7.08619112E+00, 1.00330278E+00, 1.00305361E+00, 987.036020E-03, 987.490804E-03, 1.00269689E+00, 1.00330270E+00, 37.2320546E+00, 34.5509247E+00, 987.143001E-03 +04-05-24 04:14:42,37.1,37.2, 39.9962225E+03, 7.08619112E+00, 1.00330276E+00, 1.00305350E+00, 987.036080E-03, 987.490868E-03, 1.00269733E+00, 1.00330268E+00, 37.1612287E+00, 34.5509247E+00, 987.142162E-03 +04-05-24 05:14:42,37.1,37.1, 39.9962225E+03, 7.08619112E+00, 1.00330279E+00, 1.00305354E+00, 987.036153E-03, 987.490692E-03, 1.00269713E+00, 1.00330271E+00, 37.1496964E+00, 34.5509247E+00, 987.142532E-03 +04-05-24 06:14:42,37.0,37.0, 39.9962225E+03, 7.08619112E+00, 1.00330237E+00, 1.00305328E+00, 987.035880E-03, 987.490318E-03, 1.00269665E+00, 1.00330229E+00, 36.9973296E+00, 34.5509247E+00, 987.142581E-03 +04-05-24 07:14:42,36.9,37.0, 39.9962225E+03, 7.08619112E+00, 1.00330285E+00, 1.00305330E+00, 987.036303E-03, 987.490729E-03, 1.00269743E+00, 1.00330277E+00, 36.9673264E+00, 34.5509247E+00, 987.142328E-03 +04-05-24 08:14:43,36.8,36.9, 39.9962225E+03, 7.08619112E+00, 1.00330236E+00, 1.00305297E+00, 987.035942E-03, 987.490305E-03, 1.00269648E+00, 1.00330229E+00, 36.8701920E+00, 34.5509247E+00, 987.142082E-03 +04-05-24 09:14:43,36.9,37.0, 39.9962225E+03, 7.08619112E+00, 1.00330232E+00, 1.00305332E+00, 987.035913E-03, 987.490304E-03, 1.00269648E+00, 1.00330224E+00, 36.9957024E+00, 34.5509247E+00, 987.142752E-03 +04-05-24 10:14:43,36.6,36.6, 39.9962225E+03, 7.08619112E+00, 1.00330173E+00, 1.00305238E+00, 987.035794E-03, 987.489917E-03, 1.00269595E+00, 1.00330165E+00, 36.5649214E+00, 34.5509247E+00, 987.141864E-03 diff --git a/2823A14043.html b/2823A14043.html new file mode 100644 index 0000000..165558c --- /dev/null +++ b/2823A14043.html @@ -0,0 +1,14 @@ + + + +
+
+ + \ No newline at end of file diff --git a/AnalyzeU180Data.py b/AnalyzeU180Data.py new file mode 100644 index 0000000..f8a33a4 --- /dev/null +++ b/AnalyzeU180Data.py @@ -0,0 +1,32 @@ +import os +import json +import time +import csv +import GPIBPrologix +import pandas as pd +from plotly.subplots import make_subplots +import plotly.graph_objects as go +from datetime import datetime +import numpy + +def readRunningConfigs(): + searchPath = os.path.realpath(os.path.dirname(__file__))+'/RunningConfigs/' + filenames = next(os.walk(searchPath), (None, None, []))[2] + filenames = [item for item in filenames if str.endswith(item,'.json')] + return filenames + +for file in readRunningConfigs(): + dataPath = os.path.realpath(os.path.dirname(__file__))+'/RunningConfigs/'+file + with open(dataPath, "r") as read_file: + configData = json.load(read_file) + serialPath = os.path.realpath(os.path.dirname(__file__))+'/data/'+configData['serial']+'/' + df = pd.read_csv(serialPath+configData['serial']+'.csv') + + time_x = pd.to_datetime(df['DateTime'],format='%d-%m-%y %H:%M:%S') + coefficients = numpy.polyfit(df['TEMP'], df['G10V'], 1, rcond=None, full=False, w=None, cov=False) + polynomial = numpy.poly1d(coefficients) + + fig = make_subplots(rows=1, cols=2) + fig.add_trace(go.Scatter(x=time_x, y=df['G10V']-polynomial(df['TEMP']),mode='lines+markers',name='time vs cal72 w tempcomp'),row=1, col=1) + fig.add_trace(go.Scatter(x=df['TEMP'], y=df['G10V'],mode='lines+markers',name='temp vs cal72'),row=1, col=2) + fig.write_html(serialPath+configData['serial']+'.html') \ No newline at end of file diff --git a/U180-ToolKit.py b/U180-ToolKit.py new file mode 100644 index 0000000..3d6cdda --- /dev/null +++ b/U180-ToolKit.py @@ -0,0 +1,83 @@ +#import gpibprologix +import os +import json +import time +import csv +import GPIBPrologix +import datetime + +GPIB = GPIBPrologix.ResourceManager("/dev/ttyACM0") +instObj = GPIB.open_resource(22) +instObj.write("BEEP") +instObj.write("CAL? 72") +print(instObj.read()) +print(instObj.query("CAL? 72")) +time.sleep(60) +## user customisable functions +def readFunc(instObj): + return instObj.read() + +def writeFunc(instObj, input): + instObj.write(input) + +def queryFunc(instObj, input): + time.sleep(0.1) + return instObj.query(input) + +## the main program functionalities, should not be adjusted +def readRunningConfigs(): + searchPath = os.path.realpath(os.path.dirname(__file__))+'/RunningConfigs/' + filenames = next(os.walk(searchPath), (None, None, []))[2] + filenames = [item for item in filenames if str.endswith(item,'.json')] + return filenames + +def doACAL(dcACAL, ohmACAL, acACAL): + output = queryFunc(instObj, "TEMP?") + if dcACAL == "yes": + writeFunc(instObj, "ACAL DCV") + time.sleep(140+20) + if acACAL == "yes": + writeFunc(instObj, "ACAL ACV") + time.sleep(140+20) + if ohmACAL == "yes": + writeFunc(instObj, "ACAL OHMS") + time.sleep(600+60) + return output + +def interrogate3458A(instObj): + output = [] + d = datetime.datetime.now() + dx = d - datetime.timedelta(microseconds=d.microsecond) + output.append(dx.strftime("%d-%m-%y %H:%M:%S")) + output.append(queryFunc(instObj,"TEMP?")) # get temperature in device + output.append(queryFunc(instObj,"CAL? 1,1")) # get RREF cal value + output.append(queryFunc(instObj,"CAL? 2,1")) # get VREF cal value + output.append(queryFunc(instObj,"CAL? 78")) # get 10kohm ACAL gain constrant + output.append(queryFunc(instObj,"CAL? 79")) # get 100kohm ACAL gain constrant + output.append(queryFunc(instObj,"CAL? 71")) # get 1v0 ACAL gain constrant + output.append(queryFunc(instObj,"CAL? 70")) # get 0v1 ACAL gain constrant + output.append(queryFunc(instObj,"CAL? 86")) # get 1kohm ACAL ocomp constrant + output.append(queryFunc(instObj,"CAL? 87")) # get 10kohm ACAL ocomp constrant + output.append(queryFunc(instObj,"CAL? 176")) # get acal temperature for ohms + output.append(queryFunc(instObj,"CAL? 59")) # get temperature from during calibration + output.append(queryFunc(instObj,"CAL? 97")) # get 1mamp ACAL gain constrant + output.append(queryFunc(instObj,"CAL? 72")) # get 10v ACAL gain constrant + return output + +## main program +# read the config file and do the folder setup +for file in readRunningConfigs(): + dataPath = os.path.realpath(os.path.dirname(__file__))+'/RunningConfigs/'+file + with open(dataPath, "r") as read_file: + configData = json.load(read_file) + serialPath = os.path.realpath(os.path.dirname(__file__))+'/data/'+configData['serial']+'/' + if not os.path.exists(serialPath): + os.makedirs(serialPath) + with open(serialPath+configData['serial']+'.csv', 'a') as g: + writer = csv.writer(g) + writer.writerow(["DateTime","TEMP","CAL RREF","CAL VREF","G10K","G100K", "G1V0","G0V1","OCOMP1K","OCOMP10K", "ACALTEMP", "CALTEMP", "G1mA", "G10V"]) + doACAL(configData['ACAL-DCV'],configData['ACAL-OHMS'],configData['ACAL-ACV']) + with open(serialPath+configData['serial']+'.csv', 'a') as f: + writer = csv.writer(f) + writer.writerow((interrogate3458A(instObj))) + writeFunc(instObj,"DISP OFF,''") diff --git a/test.json b/test.json new file mode 100644 index 0000000..784b87f --- /dev/null +++ b/test.json @@ -0,0 +1,10 @@ +{ + "device": "3458A", + "manufacturer": "HP", + "serial": "2823A14043", + "options": "1", + "modifications": "describe, for logging purposes", + "ACAL-DCV": "yes", + "ACAL-OHMS": "yes", + "ACAL-ACV": "no" +}