From 1d8f9519dd8e570e3228fffc91b440e6e13fc38b Mon Sep 17 00:00:00 2001 From: Michael Pawelzik <michael.pawelzik@desy.de> Date: Sun, 30 Jul 2023 21:46:38 +0200 Subject: [PATCH] update of key names in teststand.json and correction in modules where keys are needed --- Python_script/MeasurementPlot.py | 19 +++--- Python_script/PostPlot.py | 14 ++++- ..._07_29-15_38_40_results_25.0deg_55.0rh.pdf | Bin 37312 -> 37312 bytes ..._07_29-15_38_40_results_30.0deg_55.0rh.pdf | Bin 39482 -> 39482 bytes .../PostPlots/Full_Transistion.pdf | Bin 42258 -> 42258 bytes Python_script/almemo710.py | 15 +++-- Python_script/curvefit_and_correlation.py | 14 ++++- Python_script/play_with_almemo710.py | 56 +++++++++--------- Python_script/prototype.py | 6 +- Python_script/test_stand_parameter.json | 2 +- Python_script/the.pdf | Bin 27095 -> 27095 bytes 11 files changed, 76 insertions(+), 50 deletions(-) diff --git a/Python_script/MeasurementPlot.py b/Python_script/MeasurementPlot.py index 3ee2597..d753b23 100644 --- a/Python_script/MeasurementPlot.py +++ b/Python_script/MeasurementPlot.py @@ -11,14 +11,14 @@ class PlottingError(Exception): pass class MeasurementPlot: - def __init__(self, title='', env_cond_sensors ='', legend_loc = 'upper left',\ + def __init__(self, title='', trace_subplot5 ='', legend_loc = 'upper left',\ legend_bbox_to_anchor = (1.09, 1)): # set python for opening an separate plot window when starting from anaconda, Michael if 'ipykernel' in sys.modules: from IPython import get_ipython get_ipython().run_line_magic('matplotlib', 'qt') - self.env_cond_sensors = env_cond_sensors + self.trace_subplot5 = trace_subplot5 # parameter for legend of subplots self.legend_loc = legend_loc @@ -266,13 +266,13 @@ class MeasurementPlot: # key names for config parameter fith subplot keys = ["label_trace_1", "label_trace_2", "y_axis", "sec_y_axis"] - if self.env_cond_sensors == 'ext': + if self.trace_subplot5 == 'logger_sens': # values for plotting evironmental conditions in measurement instrument chamber values = ["temp sensor\nmeas instruments", "hum sensor\nmeas instruments", \ "TEMPERATURE [°C]", "HUMIDITY [%RH]"] - elif self.env_cond_sensors == 'int': + elif self.trace_subplot5 == 'chamber_sens': # values for plotting evironmental conditions in measurement instrument chamber values = ["chamber temperature\nmeas instruments", "chamber humidity\nmeas instruments", \ "TEMPERATURE [°C]", "HUMIDITY [%RH]"] @@ -291,14 +291,14 @@ class MeasurementPlot: def refresh_param_fith_subplot(self, data_frame): - if self.env_cond_sensors == 'ext': + if self.trace_subplot5 == 'logger_sens': # chose sensor values for refreshing fith subplot val_trace_1 = data_frame.TEMP_MEAS_INSTR val_trace_2 = data_frame.HUM_MEAS_INSTR - elif self.env_cond_sensors == 'int': + elif self.trace_subplot5 == 'chamber_sens': val_trace_1 = data_frame.READBACK_TEMP_MEAS_INSTR val_trace_2 = data_frame.READBACK_HUM_MEAS_INSTR @@ -323,7 +323,12 @@ class MeasurementPlot: # test procedure for measurement plot procedure if __name__ == '__main__': - m = MeasurementPlot(env_cond_sensors = "int") + # possible selections trace subplot 5 + # chamber_sens + # logger_sens + # heater_dut_chamber + + m = MeasurementPlot(trace_subplot5 = "chamber_sens") plt.ion() measurements = [] diff --git a/Python_script/PostPlot.py b/Python_script/PostPlot.py index e52205a..99b3f2d 100644 --- a/Python_script/PostPlot.py +++ b/Python_script/PostPlot.py @@ -19,7 +19,7 @@ import numpy as np # oftional correclation and regression can be calculated and plotted in results, Michael # option is configureable via ext_sens_data.json, Michael class PostPlot: - def __init__(self, env_cond_sensors = '', legend_loc = 'upper left', \ + def __init__(self, trace_subplot5 = '', legend_loc = 'upper left', \ legend_bbox_to_anchor = (1.09, 1)): # set python for opening an separate plot window if 'ipykernel' in sys.modules: @@ -27,7 +27,7 @@ class PostPlot: get_ipython().run_line_magic('matplotlib', 'qt') - self.measplot = MeasurementPlot(env_cond_sensors = env_cond_sensors,\ + self.measplot = MeasurementPlot(trace_subplot5 = trace_subplot5,\ legend_loc = legend_loc, legend_bbox_to_anchor = legend_bbox_to_anchor) self.legend_loc = legend_loc @@ -180,12 +180,20 @@ if __name__ == '__main__': # search all csv files in results folder csv_file_list = list(Path(Results_Path).glob("**/*.csv")) + # selction measurment data should be plotted in subplot5 + # 'logger sens' : values for temperature and humidity of logger sensor in + # measurement instrument chmaber + # 'chamber_sens' : values for temepratere and humidity readback from chamber sensors + # of chamber for measurement instruments + # 'heater_dut_chamber': activity of temp heater and hum heater readback from DUT chamber + # This is also the default parameter + trace_selection = "" # create postplot object, Michael - plot_obj = PostPlot(env_cond_sensors= trace_selection) + plot_obj = PostPlot(trace_subplot5= trace_selection) # empty data frame for concat the data frames from csv import to plot full transistion concat_data_frame = pd.DataFrame() diff --git a/Python_script/TestData_JBY240/PostPlots/2023_07_29-15_38_40_results_25.0deg_55.0rh.pdf b/Python_script/TestData_JBY240/PostPlots/2023_07_29-15_38_40_results_25.0deg_55.0rh.pdf index e421d41f24670877fbb65c29c0ad25f92ddd64ab..eed4022ea7349e703406bcc3689527305e5d649f 100644 GIT binary patch delta 23 fcmX@GnCZY`rVal(IE)R942?`oEjP1u?&1Idba)7- delta 23 fcmX@GnCZY`rVal(IE*ZfjEzi<%{H@j?&1Idbkhi} diff --git a/Python_script/TestData_JBY240/PostPlots/2023_07_29-15_38_40_results_30.0deg_55.0rh.pdf b/Python_script/TestData_JBY240/PostPlots/2023_07_29-15_38_40_results_30.0deg_55.0rh.pdf index 10ceaecee41bea660d6866757f62ddc02e3a9e91..5bdd20b63655e72f945f99bcc39549c7e41364b8 100644 GIT binary patch delta 23 fcmdnBg=yCorVSMnIgAaA42?`oEjKqz+{FO^a8?My delta 23 fcmdnBg=yCorVSMnIgBigjEzi<%{Mnp+{FO^aJLA_ diff --git a/Python_script/TestData_JBY240/PostPlots/Full_Transistion.pdf b/Python_script/TestData_JBY240/PostPlots/Full_Transistion.pdf index 5b7d83c0bd11bedf0df1c900a49c82cb8a6add7a..b2b5a4ea9b853227e296a453871ca2a1e178e52d 100644 GIT binary patch delta 23 fcmbPqifPg*rVS}`IE)R942?_;3^wP?S;heXYvBlM delta 23 fcmbPqifPg*rVS}`IE*ZfjEzi<%{S-FS;heXY?BCo diff --git a/Python_script/almemo710.py b/Python_script/almemo710.py index 19850e9..a9e1917 100644 --- a/Python_script/almemo710.py +++ b/Python_script/almemo710.py @@ -54,17 +54,18 @@ class almemo710: - + """ + ##### commands are echoed. Will cause conflicts in communication and there it is obmitted #### # write function to send commands to ALMEMO 710 that do not send a # response def write(self, cmd_str, wait_time = 0.5): - # send command to ALMEMO 710 - self.tn.write(bytes(cmd_str, encoding = 'utf8') + b'\r') - - # wait - time.sleep(wait_time) + # send command to ALMEMO 710 + self.tn.write(bytes(cmd_str, encoding = 'utf8') + b'\r') + # wait + time.sleep(wait_time) + """ # query function to send a command to almemo 710 and # return the response to the command @@ -83,6 +84,7 @@ class almemo710: # decode receivved data with CP437 format decoded_read_buffer = read_buffer.decode('cp437') + # return received data return decoded_read_buffer @@ -291,6 +293,7 @@ class almemo710: # add a row in measurement buffer an fill colums in measurement buffer with # collected parameter self.meas_buffer = self.meas_buffer.append(channel_params, ignore_index= True) + # method to request all measument values for all measurement channels of all sensors diff --git a/Python_script/curvefit_and_correlation.py b/Python_script/curvefit_and_correlation.py index 7a4d3c7..0ff057c 100644 --- a/Python_script/curvefit_and_correlation.py +++ b/Python_script/curvefit_and_correlation.py @@ -12,10 +12,10 @@ from pathlib import Path class reg_and_corr: - def __init__(self, env_cond_sensors = '', legend_loc = 'upper left', \ + def __init__(self, trace_subplot5 = '', legend_loc = 'upper left', \ legend_bbox_to_anchor = (1.09, 1)): - self.postplot = PostPlot(env_cond_sensors = env_cond_sensors) + self.postplot = PostPlot(trace_subplot5 = trace_subplot5) self.K_phases = None self.phase_t0 = None self.legend_loc = legend_loc @@ -265,11 +265,19 @@ if __name__ == '__main__': plot_trace_curvefit = True + # selction measurment data should be plotted in subplot5 + # 'logger sens' : values for temperature and humidity of logger sensor in + # measurement instrument chmaber + # 'chamber_sens' : values for temepratere and humidity readback from chamber sensors + # of chamber for measurement instruments + # 'heater_dut_chamber': activity of temp heater and hum heater readback from DUT chamber + # This is also the default parameter + trace_selection = "" # create postplot object, Michael - analysisplot_obj = reg_and_corr(env_cond_sensors= trace_selection) + analysisplot_obj = reg_and_corr(trace_subplot5= trace_selection) # empty data frame for concat the data frames from csv import to plot full transistion diff --git a/Python_script/play_with_almemo710.py b/Python_script/play_with_almemo710.py index d938ab5..392a36f 100644 --- a/Python_script/play_with_almemo710.py +++ b/Python_script/play_with_almemo710.py @@ -6,7 +6,7 @@ Created on Mon Jan 2 16:55:57 2023 """ # import module with python class for ahlborn -import almemo710 +import almemo2490 # variables for selection in used methods sel_channel_no = '0.0' @@ -16,28 +16,30 @@ item = 0 try: # create object for python class of almemo710 - almemo710_obj = almemo710.almemo710(ip='192.168.115.94') + almemo710_obj = almemo2490.almemo710(ip='192.168.115.44') + almemo710_obj.set_date() + # request date from almemo 710 date = almemo710_obj.get_date() - # request time from almemo 710 - time = almemo710_obj.get_time() + # # request time from almemo 710 + # time = almemo710_obj.get_time() - # set name of measurment channel 0.1 from almemo 710 - almemo710_obj.set_channel_name(sel_channel_no,sel_channel_name) + # # set name of measurment channel 0.1 from almemo 710 + # almemo710_obj.set_channel_name(sel_channel_no,sel_channel_name) - # request name of measurement channel from almemo 710 - channel_name = almemo710_obj.get_channel_name(sel_channel_no) + # # request name of measurement channel from almemo 710 + # channel_name = almemo710_obj.get_channel_name(sel_channel_no) # set output format for measured data # parameter should be N2 or left empty # output format is ste to table - almemo710_obj. set_meas_output_format() + almemo710_obj.set_meas_output_format('N0') # request list of all sensors channels that are currently active # store this data in data frame of class_object - almemo710_obj.request_sens_channel_list() + read_buffer = almemo710_obj.request_sens_channel_list() # trigger single measurement an request the measured values for all measurment channels # of almemo 710 @@ -47,29 +49,29 @@ try: # get measuerement buffer of class object meas_buffer = almemo710_obj.meas_buffer - # fetch parameter of selected measurement channel from meas_buffer of class object - # input of channel name or channel number is possible - # numbmer format: 'x.x' or x.xx when number > 10 where is has to be [0-9] - meas_channel_data, num_matches = almemo710_obj. \ - fetch_channel_param_from_meas_buffer(pattern = sel_channel_name, index = item) + # # fetch parameter of selected measurement channel from meas_buffer of class object + # # input of channel name or channel number is possible + # # numbmer format: 'x.x' or x.xx when number > 10 where is has to be [0-9] + # meas_channel_data, num_matches = almemo710_obj. \ + # fetch_channel_param_from_meas_buffer(pattern = sel_channel_name, index = item) - # get measurement date from selected measurement channel - meas_date = meas_channel_data.meas_date + # # get measurement date from selected measurement channel + # meas_date = meas_channel_data.meas_date - # get measurement time from selected measurement channel - meas_time = meas_channel_data.meas_time + # # get measurement time from selected measurement channel + # meas_time = meas_channel_data.meas_time - # get measurement value from selected measurement channel - meas_value = meas_channel_data.meas_val + # # get measurement value from selected measurement channel + # meas_value = meas_channel_data.meas_val - # get sensor unit from selected measurement channel - channel_unit = meas_channel_data.channel_unit + # # get sensor unit from selected measurement channel + # channel_unit = meas_channel_data.channel_unit - # get channel name from selected measurement channel - channel_name = meas_channel_data.channel_name + # # get channel name from selected measurement channel + # channel_name = meas_channel_data.channel_name - # get channel number from selected measurement channel - sens_channel = meas_channel_data.sens_channel + # # get channel number from selected measurement channel + # sens_channel = meas_channel_data.sens_channel finally: diff --git a/Python_script/prototype.py b/Python_script/prototype.py index 731a53c..d941a52 100755 --- a/Python_script/prototype.py +++ b/Python_script/prototype.py @@ -99,8 +99,8 @@ class Measurements: # request all sensor channels from ALMEMO710 of all sensors that are connected to this device, Michael self.ext_sensors.request_sens_channel_list() - self.measurement_plot = MeasurementPlot.MeasurementPlot(env_cond_sensors = \ - config_data['env_cond_sensors']) + self.measurement_plot = MeasurementPlot.MeasurementPlot(trace_subplot5 = \ + config_data['trace_subplot5']) self.data_collection = [] def perform_measurements(self, sweep_file): @@ -499,7 +499,7 @@ def plot_output(output_basename, measurements_appendices, show_blocking_plot, co # storepath is set to working directory with subfolder Plots, Michael storepath = os.path.join(os.getcwd(),'PostPlots') # create objet for PostPlot class in PostPlot module, Michael - post_plot = PostPlot.PostPlot(env_cond_sensors = config_data['env_cond_sensors']) + post_plot = PostPlot.PostPlot(trace_subplot5 = config_data['trace_subplot5']) for index, m in enumerate(measurements_appendices): measurement_name = output_basename+'_'+str(m) list_of_frames.append(pd.read_csv(measurement_name+'.csv')) diff --git a/Python_script/test_stand_parameter.json b/Python_script/test_stand_parameter.json index bcc0017..b83ed28 100644 --- a/Python_script/test_stand_parameter.json +++ b/Python_script/test_stand_parameter.json @@ -1 +1 @@ -{"delta_temp": 0.1, "delta_hum": 1, "delta_mag": 0.01 , "delta_phase": 1.5, "sleep_time": 10.0, "frequency": 1300000000, "vna_config_file": "CalSetup2.znxml","chamber_ip":"192.168.115.186", "instr_chamber_ip": "192.168.115.187", "vna_ip":"192.168.115.39", "data_folder":"measurements", "logger_ip": "192.168.115.94", "time_unit": "min", "env_cond_sensors": "ext"} +{"delta_temp": 0.1, "delta_hum": 1, "delta_mag": 0.01 , "delta_phase": 1.5, "sleep_time": 10.0, "frequency": 1300000000, "vna_config_file": "CalSetup2.znxml","chamber_ip":"192.168.115.186", "instr_chamber_ip": "192.168.115.187", "vna_ip":"192.168.115.39", "data_folder":"measurements", "logger_ip": "192.168.115.94", "time_unit": "min", "trace_subplot5": "logger_sens"} diff --git a/Python_script/the.pdf b/Python_script/the.pdf index c18b780e37f189477bd2ee1d08699945553a8e2c..ef9b0ddcdd039c336d4da94b02b2b43ad0e0e92b 100644 GIT binary patch delta 23 ecmcb9neqB%#tjWg9L5Gl1||l^Mw>g5{Mi9^FbHx0 delta 23 ecmcb9neqB%#tjWg97dK#2F7Ma=9@c`{Mi9^%?N`4 -- GitLab