plot_utils: add a generic plot_temperatures that can combine data from the framework and the governor
diff --git a/cr2/plot_utils.py b/cr2/plot_utils.py
index 7c447f8..59c93ba 100644
--- a/cr2/plot_utils.py
+++ b/cr2/plot_utils.py
@@ -103,6 +103,20 @@
dfr.plot(ax=ax)
post_plot_setup(ax, title=this_title)
+def plot_temperature(thermal, thermal_gov, **kwords):
+ """Plot temperatures
+
+ Extract the control_temp from the governor data and plot the
+ temperatures reported by the thermal framework. The governor
+ doesn't track temperature when its off, so the thermal framework
+ trace is more reliable.
+
+ """
+
+ gov_dfr = thermal_gov.get_data_frame()
+ control_temp_series = (gov_dfr["currT"] + gov_dfr["deltaT"]) / 1000
+ thermal.plot_temperature(control_temperature=control_temp_series, **kwords)
+
def plot_hist(data, title, bins, xlabel, xlim, ylim):
"""Plot a histogram"""