I wish to create plots in the analyze section of my experiment using matplotlib. Specifically, I want the title of my plot to include the run ID of the experiment. Is there a way to obtain the runID of the experiment for use in the analyze function? I saw something about using current_scan.rid() from NIST, but this doesn't seem to work. Any help is greatly appreciated! The plotting section of my code looks like this currently:
plt.plot(x,fit,label = "fit")
plt.plot(x,y,label = "data")
plt.title(f"Raman Rabi Flops with Fit, RID = {rid}")
plt.axhline(y = 0.99, color = 'red',linestyle = '--',label = "99% fidelity")
plt.legend()
plt.grid()
plt.xlabel("Pulse time (us)")
plt.ylabel("Probability")
plt.show()
rid = self.current_scan.rid()
if not os.path.exists(plot_dir):
os.makedirs(plot_dir)
plot_filename = os.path.join(plot_dir,f"Experiment #{rid}.png")
plt.savefig(plot_filename)