Skip to content
Snippets Groups Projects
Commit 681f295e authored by Martin Killenberg's avatar Martin Killenberg
Browse files

prepare plot_measurement for re-plotting

parent ffef8a77
No related branches found
No related tags found
No related merge requests found
......@@ -276,8 +276,10 @@ class Measurements:
(float(readback_hum) <= target_hum+self.max_delta_hum)
# plot a single measurement (phase, magnitude, temp and hum against time) from a pandas data frame
def plot_measurement(data_frame, show_plot_window, save_pdf=True):
fig, ax1 = plt.subplots(2, figsize=(12, 10))
def plot_measurement(data_frame, show_blocking_plot, save_pdf=True, subplot_tuple = (None, None)):
fig, ax1 = subplot_tuple
if fig is None or ax1 is None:
fig, ax1 = plt.subplots(2, figsize=(12, 10))
fig.suptitle("Graphical representation of chamber output", color="red")
path_collection01 = ax1[0].scatter(data_frame.TIMESTAMP, data_frame.S21_PHASE, c='red', marker='<', label='Phase')
......@@ -319,12 +321,16 @@ def plot_measurement(data_frame, show_plot_window, save_pdf=True):
if save_pdf:
fig.savefig(output_basename + '_graph.pdf')
if show_plot_window:
plt.show()
# turn interactive on if we are not supposed to block, otherwise turn it off
if show_blocking_plot:
plt.ioff()
else:
plt.ion()
plt.show()
def plot_output(output_basename, show_plot_window, save_pdf=True):
def plot_output(output_basename, show_blocking_plot, save_pdf=True):
data_frame = pd.read_csv(output_basename+'.csv')
plot_measurement(data_frame, show_plot_window, save_pdf)
plot_measurement(data_frame, show_blocking_plot, save_pdf)
if __name__ == '__main__':
parser = ArgumentParser()
......@@ -344,7 +350,7 @@ if __name__ == '__main__':
help="Change Chamber mode to standby at the end")
parser.add_argument("-p", "--plot",
action="store_true", default=False,
help="Show plot window at the end")
help="Show blocking plot window at the end")
# parser.add_argument("-q", "--quiet",
# action="store_false", dest="verbose", default=True,
......
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