Skip to content
Snippets Groups Projects
Commit 4a036dae authored by Michael Pawelzik's avatar Michael Pawelzik
Browse files

- subplot 5 modified that heater activity, external sensors and sensors of...

- subplot 5 modified that heater activity, external sensors and sensors of climate - chamber from instrument chamber can be display
- request of instrument chambers added
- configurable option in json file for selecting parameter in subplot5

Debug Complete
parent b1f0c5cd
No related branches found
No related tags found
1 merge request!3feat: introduce external sensors
......@@ -11,12 +11,15 @@ class PlottingError(Exception):
pass
class MeasurementPlot:
def __init__(self, title='', legend_loc = 'upper left', legend_bbox_to_anchor = (1.09, 1)):
def __init__(self, title='', env_cond_sensors ='', 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
# parameter for legend of subplots
self.legend_loc = legend_loc
self.legend_bbox_to_anchor = legend_bbox_to_anchor
......@@ -88,10 +91,12 @@ class MeasurementPlot:
# DUT temperature, DUT humidity, Michael
# configuration of used sensor port in ext_sens_data.json, Michael
self.path_collection_temp_dut = self.ax1[2].scatter([],[], c='red', marker='p', label='DUT temperature')
self.path_collection_temp_dut = self.ax1[2].scatter([],[], c='red', marker='p', \
label='DUT temperature')
self.ext_sens_hum_axis = self.ax1[2].twinx()
self.path_collection_hum_dut = self.ext_sens_hum_axis.scatter([],[], c='purple', marker='*', label='DUT humidity')
self.path_collection_hum_dut = self.ext_sens_hum_axis.scatter([],[], c='purple', \
marker='*', label='DUT humidity')
self.ax1[2].set_xlabel("TIMESTAMP")
......@@ -133,43 +138,28 @@ class MeasurementPlot:
# meas instruments temperature, meas instruments humidity, Michael
# configuration of used sensor port in ext_sens_data.json, Michael
self.path_collection_temp_meas_instr = self.ax1[4].scatter([], [], c='black', marker='p', label="meas instr temperature")
self.third_ext_hum_sens_axis = self.ax1[4].twinx()
self.path_collection_hum_meas_instr = self.third_ext_hum_sens_axis.scatter([], [], c='brown', marker="*", label="meas instr humidity")
# units added to y-axes of subplot 5, Michael
self.ax1[4].set_xlabel("TIMESTAMP")
self.ax1[4].set_ylabel("TEMPERATURE [°C] ", color='black')
self.third_ext_hum_sens_axis.set_ylabel("HUMIDITY [%RH]", color='brown')
self.ax1[4].grid(True, linestyle=":")
all_path_collections = [self.path_collection_temp_meas_instr, \
self.path_collection_hum_meas_instr]
labels = [pc.get_label() for pc in all_path_collections]
self.ax1[4].legend(all_path_collections, labels, loc=self.legend_loc, bbox_to_anchor = \
self.legend_bbox_to_anchor)
subplot_dict = self.config_fith_subplot()
######################################################################################
self.path_collection_trace_1 = self.ax1[4].scatter([], [], c='black', \
marker='p', label = subplot_dict.get('label_trace_1'))
## Block for plot Heater percentage in fifth subplot
# heater activity of temperature heater and humidity heater
# values requested from environmental test chamber
self.sec_plot_param_axis = self.ax1[4].twinx()
self.path_collection_trace_2 = self.sec_plot_param_axis.scatter([], [], c='brown', \
marker="*",label = subplot_dict.get('label_trace_2'))
# self.path_collection_temp_heater = self.ax1[4].scatter([],[], c='black', marker='<', label='Temp Heater')
# self.path_collection_hum_heater = self.ax1[4].scatter([],[], c='brown', marker='o', label='Hum Heater')
# self.ax1[4].set_xlabel("TIMESTAMP")
# self.ax1[4].set_ylabel("HEATER PERCENTAGE [%]", color='black')
# # units added to y-axes of subplot 5, Michael
self.ax1[4].set_xlabel("TIMESTAMP")
self.ax1[4].set_ylabel(subplot_dict.get('y_axis'), color='black')
self.sec_plot_param_axis.set_ylabel(subplot_dict.get('sec_y_axis'), color='brown')
# self.ax1[4].grid(True, linestyle=":")
# all_path_collections = [self.path_collection_temp_heater, \
# self.path_collection_hum_heater]
# labels = [pc.get_label() for pc in all_path_collections]
# self.ax1[4].legend(all_path_collections, labels, loc=self.legend_loc, bbox_to_anchor = \ self.legend_bbox_to_anchor)
self.ax1[4].grid(True, linestyle=":")
all_path_collections = [self.path_collection_trace_1, \
self.path_collection_trace_2]
labels = [pc.get_label() for pc in all_path_collections]
self.ax1[4].legend(all_path_collections, labels, loc=self.legend_loc, bbox_to_anchor = \
self.legend_bbox_to_anchor)
#######################################################################################
# sclae fontsize of all plot window elements to size 16, Michael
plt.rcParams.update({'font.size':16})
......@@ -222,7 +212,7 @@ class MeasurementPlot:
self.ax1[3].set_ylim(minimum, maximum)
self.path_collection_temp_room.set_offsets(np.c_[timestamps, temp_room])
# refresh humidities external sensors in subplots for DUT humidity and room
# refresh humidities external sensors in subplots for DUT humidity and room humidity
# humidity, Michael
hum_dut = data_frame.HUM_DUT
hum_room = data_frame.HUM_ROOM
......@@ -245,32 +235,17 @@ class MeasurementPlot:
# refresh temperature and humidity of external sensor in subplot for measurement
# for instrument temperature and measurement instrument humidity, Michael
temp_meas_instr = data_frame.TEMP_MEAS_INSTR
hum_meas_instr = data_frame.HUM_MEAS_INSTR
minimum, maximum = self.get_extended_min_max(temp_meas_instr)
self.ax1[4].set_ylim(minimum, maximum)
minimum, maximum = self.get_extended_min_max(hum_meas_instr)
self.third_ext_hum_sens_axis.set_ylim(minimum, maximum)
self.path_collection_temp_meas_instr.set_offsets(np.c_[timestamps, temp_meas_instr])
self.path_collection_hum_meas_instr.set_offsets(np.c_[timestamps, hum_meas_instr])
#########################################################################
## Block for refreshing heater percentages in subplot for heater values
val_trace_1, val_trace_2 = self.refresh_param_fith_subplot(data_frame)
# refresh heater percentage values of climate chamber in subplot of heater values, Michael
# temp_heater = data_frame.TEMP_HEATER
# hum_heater = data_frame.HUM_HEATER
# min_temp_heater, max_temp_heater = self.get_extended_min_max(temp_heater)
# min_hum_heater, max_hum_heater = self.get_extended_min_max(hum_heater)
# minimum = min(min_temp_heater, min_hum_heater)
# maximum = max(max_temp_heater, max_hum_heater)
# self.ax1[4].set_ylim(minimum-0.05*(maximum-minimum), maximum+0.05*(maximum-minimum))
# self.path_collection_temp_heater.set_offsets(np.c_[timestamps, temp_heater])
# self.path_collection_hum_heater.set_offsets(np.c_[timestamps, hum_heater])
minimum, maximum = self.get_extended_min_max(val_trace_1)
self.ax1[4].set_ylim(minimum, maximum)
minimum, maximum = self.get_extended_min_max(val_trace_2)
self.sec_plot_param_axis.set_ylim(minimum, maximum)
self.path_collection_trace_1.set_offsets(np.c_[timestamps, val_trace_1])
self.path_collection_trace_2.set_offsets(np.c_[timestamps, val_trace_2])
#########################################################################
self.path_collection_equi0.set_offsets(np.c_[timestamps, data_frame.EQUILIBRIUM_INDICATOR])
self.path_collection_equi1.set_offsets(np.c_[timestamps, data_frame.EQUILIBRIUM_INDICATOR])
......@@ -285,7 +260,59 @@ class MeasurementPlot:
self.fig.canvas.flush_events()
except Exception as e:
raise PlottingError from e
def config_fith_subplot(self):
# 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':
# 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':
# values for plotting evironmental conditions in measurement instrument chamber
values = ["chamber temperature\nmeas instruments", "chamber humidity\nmeas instruments", \
"TEMPERATURE [°C]", "HUMIDITY [%RH]"]
else:
# values for plotting heater activity in fith subplot
values = ["Temp Heater", "Temp Heater", \
"ACTIVITY [%]","ACTIVITY [%]"]
# generate dictionary from selection
config_subplot_dict = dict(zip(keys, values))
return config_subplot_dict
def refresh_param_fith_subplot(self, data_frame):
if self.env_cond_sensors == 'ext':
# 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':
val_trace_1 = data_frame.READBACK_TEMP_MEAS_INSTR
val_trace_2 = data_frame.READBACK_HUM_MEAS_INSTR
else:
# chose heater values for refreshing fift plot
val_trace_1 = data_frame.TEMP_HEATER
val_trace_2 = data_frame.HUM_HEATER
return val_trace_1, val_trace_2
# add 5 % of the distance between min and max to the range
@staticmethod
def get_extended_min_max(array):
......@@ -296,7 +323,7 @@ class MeasurementPlot:
# test procedure for measurement plot procedure
if __name__ == '__main__':
m = MeasurementPlot()
m = MeasurementPlot(env_cond_sensors = "int")
plt.ion()
measurements = []
......@@ -309,11 +336,11 @@ if __name__ == '__main__':
'EQUILIBRIUM_INDICATOR': i % 4,
'S21_PHASE': 20 - 2*i,
'S21_MAGNITUDE': 0.3*i,
###############################################################
##Block for simulation acivity temp heater and hum heater
# 'TEMP_HEATER': 10,
# # percentage humidity heater, Michael
# 'HUM_HEATER': 3,
#acivity temp heater and hum heater, Michael
'TEMP_HEATER': 10,
# activity humidity heater, Michael, Michael
'HUM_HEATER': 3,
# DUT Temperature of external temp sensor added, Michael
'TEMP_DUT': i,
# room temperature of external temp sensor added, Michael
......@@ -327,7 +354,12 @@ if __name__ == '__main__':
# measurement instrument temperature of external temp sensor added, Michael
'TEMP_MEAS_INSTR': 40-1.5*i,
# measurement instrument humidity of external hum sensor added, Michael
'HUM_MEAS_INSTR': 55
'HUM_MEAS_INSTR': 55,
'READBACK_TEMP_MEAS_INSTR': 50-2*i,
# measurement instrument humidity of external hum sensor added, Michael
'READBACK_HUM_MEAS_INSTR': 39
}
measurements.append(measurement)
......
......@@ -18,17 +18,17 @@ import curvefit_and_correlation
# 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):
def __init__(self, env_cond_sensors = ''):
# set python for opening an separate plot window
if 'ipykernel' in sys.modules:
from IPython import get_ipython
get_ipython().run_line_magic('matplotlib', 'qt')
self.measplot_obj = MeasurementPlot.MeasurementPlot(legend_loc = 'upper left', \
legend_bbox_to_anchor = (1.09, 1))
self.measplot_obj = MeasurementPlot.MeasurementPlot(env_cond_sensors = env_cond_sensors,\
legend_loc = 'upper left', legend_bbox_to_anchor = (1.09, 1))
# set parameter figure of class to object parameter figure
# set parameter figure of class to object parameter figure
self.fig = self.measplot_obj.fig
# read csv-file and import data to data frame
......@@ -131,7 +131,7 @@ if __name__ == '__main__':
# set result path for post plot
Results_Path = r'C:\Users\pawelzik\Desktop\Results\JBY240_14032023Copy'
Results_Path = r'C:\git\climate-lab-test-stand\Python_script\measurements\2023_07_29-15_16_03_results'
# set time unit for post post plot
......@@ -151,12 +151,14 @@ if __name__ == '__main__':
# activate plot curvefitting
plot_trace_curvefit = False
plot_trace_curvefit = False
trace_selection = ""
# create postplot object, Michael
plot_obj = PostPlot()
# create postplot object, Michael
plot_obj = PostPlot(env_cond_sensors= trace_selection)
fit_corr_obj = curvefit_and_correlation.reg_and_corr(plot_obj)
# empty data frame for concat the data frames from csv import to plot full transistion
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 2 11:08:12 2023
@author: michael pawelzik
@co-author: uros mavric
Some parts have been copied from uros mavric and then they have been modified for compatibility.
#### SYNTAX FOR CALLING CLASS OBJECTS ########################################
Look into module play_with_ahlborn.py
##############################################################################
"""
import time
from telnetlib import Telnet
import re
from datetime import datetime
class ahlborn:
# constructor of class
def __init__(self, ip = '192.168.115.44', wait_time = 1):
self.__ip_adress = ip
self.__buffer = ''
self.timestamp = datetime(1970,1,1,0,0,0)
self.__tn = Telnet(self.__ip_adress, 10001)
self.__wait_time = wait_time
self.temp_entries = []
# assign properties for temperature
self.temp_ids = []
self.temp_vals = []
self.temp_units = []
self.temp_val_categories = []
self.temp_info_fields = []
# assign properties for humidity
self.hum_ids =[]
self.hum_vals = []
self.hum_units = []
self.hum_val_categories = []
self.hum_info_fields = []
# assign properties for pressure
self.press_ids =[]
self.press_vals = []
self.press_units = []
self.press_val_categories = []
self.press_info_fields = []
# method that requests the sensor data from ahlborn
def request_temp_hum_data_from_ahlborn(self):
iteration = 0
while iteration < 3:
try:
# timestamp for sensor data from ahlborn
self.timestamp = datetime.now()
# A command for manual request of sensor data is sent to ahlborn
self.__tn.write(bytes('S1',encoding='utf8') + b'\r')
time.sleep(self.__wait_time)
# request timestamp from OS for sensor data
self.__timestamp = datetime.now()
# buffer of ahlborn is read and stored in buffer
buffer = self.__tn.read_very_eager()
time.sleep(self.__wait_time)
# data of buffer is decoded with cp437
self.__buffer = buffer.decode('cp437')
time.sleep(self.__wait_time)
if self.__buffer == '':
iteration += 1
print('An error has occured during readout of sensor data.')
else:
# leave while loop
break
except EOFError:
iteration += 1
print('An error has occured during readout of sensor data.')
return
# method for extraction of sensor temperatures out of buffer of ahlborn
def get_param_of_temp_entries(self):
self.temp_entries.clear()
#clear properties for temperature
self.temp_ids.clear()
self.temp_vals.clear()
self.temp_units.clear()
self.temp_val_categories.clear()
self.temp_info_fields.clear()
# find all temperature entries in buffer of ahlborn
list_temp_strings = re.findall(r'([0-9]{2}:.[+-].*\s[°C|K]+\s.*\r\n)', self.__buffer)
# for each temperature entry split string into list of parameters. Delimiter is white space char
list_temp_entries = [re.split(r'\s', element, maxsplit=4) for element in list_temp_strings]
# for each temp entry assign parameter to class property of parameter
for element in list_temp_entries:
self.temp_ids.append(int(element[0].rstrip(':')))
self.temp_vals.append(float(element[1].rstrip()))
self.temp_units.append(element[2].rstrip())
self.temp_val_categories.append(element[3].rstrip())
self.temp_info_fields.append(element[4].rstrip())
return
# method for extraction of sensor humidities out of buffer of ahlborn
def get_param_of_hum_entries(self):
# clear properties for humidity
self.hum_ids.clear()
self.hum_vals.clear()
self.hum_units.clear()
self.hum_val_categories.clear()
self.hum_info_fields.clear()
# find all humidity entries in buffer of ahlborn
list_hum_strings = re.findall(r'([0-9]{2}:.[+-].*\s%H\s.*\r\n)', self.__buffer)
# for each humidity entry split string into list of parameters. Delimiter is white space char
list_hum_entries = [re.split(r'\s', element, maxsplit=4) for element in list_hum_strings]
# for each hum entry assign parameter to class property of parameter
for element in list_hum_entries:
self.hum_ids.append(int(element[0].rstrip(':')))
self.hum_vals.append(float(element[1].rstrip()))
self.hum_units.append(element[2].rstrip())
self.hum_val_categories.append(element[3].rstrip())
self.hum_info_fields.append(element[4].rstrip())
return
def get_param_of_press_entries(self):
# clear properties for pressure
self.press_ids.clear()
self.press_vals.clear()
self.press_units.clear()
self.press_val_categories.clear()
self.press_info_fields.clear()
# find all pressure entries in buffer of ahlborn
list_press_strings = re.findall(r'([0-9]{2}:.[+-].*\smb\s.*\r\n)', self.__buffer)
# for each pressure entry split string into list of parameters. Delimiter is white space char
list_press_entries = [re.split(r'\s', element, maxsplit=4) for element in list_press_strings]
# for each pressure entry assign parameter to class property of parameter
for element in list_press_entries:
self.press_ids.append(int(element[0].rstrip(':')))
self.press_vals.append(float(element[1].rstrip()))
self.press_units.append(element[2].rstrip())
self.press_val_categories.append(element[3].rstrip())
self.press_info_fields.append(element[4].rstrip())
return
# close telenet connection
def close(self):
self.__tn.close()
# destructor of class
def __del__(self):
self.close()
\ No newline at end of file
......@@ -42,7 +42,7 @@ class almemo710:
# open telenet connection to ALMEMO 710
self.tn = Telnet(self.ip_adress, 10001, timeout)
except socket.time:
except socket.timeout:
print("Exception occurred accessing ALMEMO 710 via Telnet\n")
raise KeyboardInterrupt
......@@ -127,7 +127,18 @@ class almemo710:
# search date string in reply to command P13
# date alway has the following format: xx.xx.xx where x is within [0-9]
# get time out of read buffer and strip white space characters
date = re.search(r'([0-9]{2}\.[0-9]{2}\.[0-9]{2})', read_buffer).group(1)
try:
date = re.search(r'([0-9]{2}\.[0-9]{2}\.[0-9]{2})', read_buffer).group(1)
except AttributeError as attr_err:
# set date to 'N/A' if no valid date is returned by device
date = 'N/A'
print(read_buffer)
print('An error occured during parameter search.' \
'Parameter is set to default (N/A)\n')
print(traceback.print_tb(attr_err.__traceback__))
return date
......@@ -140,8 +151,19 @@ class almemo710:
# search time string in reply to command P10
# time alway has the following format: xx:xx:xx where x cis within [0-9]
# get time out of read buffer and strip white space characters
time = re.search(r'([0-9]{2}:[0-9]{2}:[0-9]{2})', read_buffer).group(1)
try:
time = re.search(r'([0-9]{2}:[0-9]{2}:[0-9]{2})', read_buffer).group(1)
except AttributeError as attr_err:
# set time to 'N/A' if no valid date is returned by device
time = 'N/A'
print(read_buffer)
print('An error occured during parameter search.' \
'Parameter is set to default (N/A)\n')
print(traceback.print_tb(attr_err.__traceback__))
return time
# method to set channel name of selected channel at ALMEMO 710
......@@ -183,10 +205,25 @@ class almemo710:
# search channel name in reply to cammand P00
# name follows after 2$\ in read_buffer
# get name out of read buffer
channel_name = re.search(r'(2\$\\[^;]+)', read_buffer).group(1)
try:
channel_name = re.search(r'(2\$\\[^;]+)', read_buffer).group(1)
# strip white space characters
channel_name = channel_name.strip(r'(2\$\\)')
# strip white space characters
return channel_name.strip(r'(2\$\\)')
except AttributeError as attr_err:
# set channel name to 'N/A' if no valid name is returned by device
channel_name = 'N/A'
print(read_buffer)
print('An error occured during parameter search.' \
'Parameter is set to default (N/A)\n')
print(traceback.print_tb(attr_err.__traceback__))
return channel_name
# method to request the list of all active measurement channels of all sensors
......@@ -301,6 +338,7 @@ class almemo710:
# sore measured values for all sensor channels in measurment buffer of class
self.meas_buffer.loc[:, 'meas_val'] = meas_vals_list
# if no line with measured values is found and error message is
# printed that contains relevant data
......
......@@ -35,7 +35,7 @@ class MeasurementData:
# values for measurement instruments temperature, measurement instruments humidity
def __init__(self, timestamp, temp, hum, power, frequency, s11, s21, s12, s22, perc_temp_heater, \
perc_hum_heater, temp_dut, temp_room, temp_meas_instr, hum_dut, hum_room, \
hum_meas_instr, air_press_room):
hum_meas_instr, air_press_room, temp_chamber_meas_instr, hum_chamber_meas_instr):
self.timestamp = timestamp
self.temp = temp
self.hum = hum
......@@ -53,12 +53,14 @@ class MeasurementData:
self.temp_dut = temp_dut
self.temp_room = temp_room
self.temp_meas_instr = temp_meas_instr
self.temp_chamber_meas_instr=temp_chamber_meas_instr
# new variables for DUT humidity, room humidity, air pressure room, Michael
self.hum_dut = hum_dut
self.hum_room = hum_room
self.air_press_room = air_press_room
# new variable for measurement instruments humidity, Michael
self.hum_meas_instr = hum_meas_instr
self.hum_chamber_meas_instr = hum_chamber_meas_instr
class Measurements:
......@@ -74,9 +76,11 @@ class Measurements:
self.vna_config_file = config_data["vna_config_file"]
target_accuracy = [self.max_delta_temp, self.max_delta_hum]
self.chamber = climate_chamber.create_chamber(chamber_address, target_accuracy)
self.instr_chamber = climate_chamber.create_chamber(config_data['instr_chamber_ip'],
target_accuracy)
self.vna = VNA.create_vna(vna_address, target_accuracy)
# new object for external sensors, decice 'ALMEMO710', fixed IP in code for device, Michael
self.ext_sensors = almemo710.almemo710(ip = logger_adress, timeout = 1)
self.ext_sensors = almemo710.almemo710(ip = logger_adress, timeout = 10)
self.standby = standby
self.output_basename = output_basename
self.clock = virtual_time.get_clock(chamber_address, target_accuracy)
......@@ -95,7 +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()
self.measurement_plot = MeasurementPlot.MeasurementPlot(env_cond_sensors = \
config_data['env_cond_sensors'])
self.data_collection = []
def perform_measurements(self, sweep_file):
......@@ -179,6 +184,7 @@ class Measurements:
'EQUILIBRIUM_INDICATOR', 'TEMP_HEATER', 'HUM_HEATER',
'TEMP_DUT', 'TEMP_ROOM', 'TEMP_MEAS_INSTR',
'HUM_DUT','HUM_ROOM', 'HUM_MEAS_INSTR', 'AIR_PRESS_ROOM',
'READBACK_TEMP_MEAS_INSTR', 'READBACK_HUM_MEAS_INSTR',
'S11_MAGNITUDE', 'S11_PHASE', 'S12_MAGNITUDE',
'S12_PHASE', 'S21_MAGNITUDE', 'S21_PHASE', 'S22_MAGNITUDE', 'S22_PHASE']
# csv.dict writer add adda row wise
......@@ -326,7 +332,6 @@ class Measurements:
# loop with 3 Itherations in case of ALMEMO 710 readout error, Michael
while iteration < 3:
try:
# request temperatures, humidities and and air pressure from external sensors, Michael
temp_dut, temp_room, temp_meas_instr, hum_dut, hum_room, hum_meas_instr, \
......@@ -341,13 +346,16 @@ class Measurements:
time.sleep(1)
iteration+=1
[temp_chamber_meas_instr, hum_chamber_meas_instr, mode_meas_instr, alarms_meas_instr] = \
self.instr_chamber.read_monitor().split(',')
# values percentage temp_heater, percentage hum_heater, temp_dut, temp_room, temp_meas_instr,
# hum_dut, hum_room, hum_meas_instr air_press_room added to parameterlist in returned
# values, Michael
return MeasurementData(int(self.clock.time()), temp, hum, power, frequency, s11, s21, s12, s22, \
perc_temp_heater, perc_hum_heater, temp_dut, temp_room, temp_meas_instr, \
hum_dut, hum_room, hum_meas_instr, air_press_room)
hum_dut, hum_room, hum_meas_instr, air_press_room, \
temp_chamber_meas_instr, hum_chamber_meas_instr)
def store_and_plot_data(self, target_temp, target_hum, data, equi_indicator):
measurement = {
......@@ -377,6 +385,8 @@ class Measurements:
'HUM_MEAS_INSTR': data.hum_meas_instr,
# Air pressure for room of external sensors added, Michael
'AIR_PRESS_ROOM': data.air_press_room,
'READBACK_TEMP_MEAS_INSTR': float(data.temp_chamber_meas_instr),
'READBACK_HUM_MEAS_INSTR': float(data.hum_chamber_meas_instr),
'S11_PHASE': self.calculate_mean_phase(data.s11),
'S11_MAGNITUDE': 20*math.log10(self.calculate_mean_magnitude(data.s11)),
'S21_PHASE': self.calculate_mean_phase(data.s21),
......@@ -396,6 +406,7 @@ class Measurements:
def get_trace_data(self, trace):
return self.vna.get_list_of_measurement_values(trace, "SDAT")
# new method to request temperaure values from external sensors of ahlborn, Michael
def get_ext_sensor_values(self):
......@@ -488,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(),'Plots')
# create objet for PostPlot class in PostPlot module, Michael
post_plot = PostPlot.PostPlot()
post_plot = PostPlot.PostPlot(env_cond_sensors = config_data['env_cond_sensors'])
for index, m in enumerate(measurements_appendices):
measurement_name = output_basename+'_'+str(m)
list_of_frames.append(pd.read_csv(measurement_name+'.csv'))
......
{"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", "vna_ip":"192.168.115.39", "data_folder":"measurements", "logger_ip": "192.168.115.94", "time_unit": "min"}
{"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": "int"}
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment