Update Code/Hosei.py

This commit is contained in:
xans 2024-09-28 00:51:18 +02:00
parent 951f8df5cf
commit f2d92bd6ae

View File

@ -109,7 +109,7 @@ d = datetime.datetime.now()
dlast = datetime.datetime.now()
## Collect data
time.sleep(3)
for n in range(1):
for n in range(5):
time.sleep(10)
for x in sweep:
cntr = cntr + 1
@ -185,9 +185,6 @@ if minMaxEqual:
# not implemented as of yet
print("not implemented")
else:
# compensate negative 1st order correction
correctionfactors[15] = 1 #df.loc[df['SetVolts'] == -10]["DutVolts"].iloc[0]/df.loc[df['SetVolts'] == 10]["DutVolts"].iloc[0]
#rslt_df = dataframe[dataframe['Percentage'] > 80]
# postive part of INL
correctionfactors[0] = (df.loc[df['SetVolts'] == 0]["DutToRefVolts"].iloc[0] - df.loc[df['SetVolts'] == 2]["DutToRefVolts"].iloc[0])/2
correctionfactors[1] = (df.loc[df['SetVolts'] == 2]["DutToRefVolts"].iloc[0] - df.loc[df['SetVolts'] == 4]["DutToRefVolts"].iloc[0])/2
@ -195,8 +192,9 @@ else:
correctionfactors[3] = (df.loc[df['SetVolts'] == 6]["DutToRefVolts"].iloc[0] - df.loc[df['SetVolts'] == 8]["DutToRefVolts"].iloc[0])/2
correctionfactors[4] = (df.loc[df['SetVolts'] == 8]["DutToRefVolts"].iloc[0] - df.loc[df['SetVolts'] == 10]["DutToRefVolts"].iloc[0])/2
# negative part of INL
correctionfactors[15] = 1 #df.loc[df['SetVolts'] == -10]["DutVolts"].iloc[0]/df.loc[df['SetVolts'] == 10]["DutVolts"].iloc[0]
correctionfactors[5] = (df.loc[df['SetVolts'] == -0.02]["DutToRefVolts"].iloc[0] - df.loc[df['SetVolts'] == -0.00]["DutToRefVolts"].iloc[0])/0.02
minusRangeScaling = df.loc[df['SetVolts'] == -10]["DutToRefVolts"].iloc[0]/10
df["DutToRefVolts"] = df["DutToRefVolts"]-minusRangeScaling*-df["SetVolts"]
correctionfactors[5] = (df.loc[df['SetVolts'] == -0.02]["DutToRefVolts"].iloc[0] - df.loc[df['SetVolts'] == 0]["DutToRefVolts"].iloc[0])/0.02
correctionfactors[6] = (df.loc[df['SetVolts'] == -0.04]["DutToRefVolts"].iloc[0] - df.loc[df['SetVolts'] == -0.02]["DutToRefVolts"].iloc[0])/0.02
correctionfactors[7] = (df.loc[df['SetVolts'] == -0.06]["DutToRefVolts"].iloc[0] - df.loc[df['SetVolts'] == -0.04]["DutToRefVolts"].iloc[0])/0.02
correctionfactors[8] = (df.loc[df['SetVolts'] == -0.08]["DutToRefVolts"].iloc[0] - df.loc[df['SetVolts'] == -0.06]["DutToRefVolts"].iloc[0])/0.02
@ -206,7 +204,8 @@ else:
correctionfactors[12] = (df.loc[df['SetVolts'] == -6]["DutToRefVolts"].iloc[0] - df.loc[df['SetVolts'] == -4]["DutToRefVolts"].iloc[0])/2
correctionfactors[13] = (df.loc[df['SetVolts'] == -8]["DutToRefVolts"].iloc[0] - df.loc[df['SetVolts'] == -6]["DutToRefVolts"].iloc[0])/2
correctionfactors[14] = (df.loc[df['SetVolts'] == -10]["DutToRefVolts"].iloc[0] - df.loc[df['SetVolts'] == -8]["DutToRefVolts"].iloc[0])/2
print(correctionfactors)
# negative 10v voltage reversal alpha error for faster measurements
correctionfactors[15] = 1+minusRangeScaling
## Read the HOSEI parameters and save the original constants
inst4.write("CAL:EXT:EEPROM:PROTECTION 1")
@ -240,7 +239,7 @@ d = datetime.datetime.now()
dlast = datetime.datetime.now()
## Collect data
time.sleep(3)
for n in range(1):
for n in range(5):
for x in sweep:
cntr = cntr + 1
try: