save2dat.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import numpy as np
  2. import pandas as pd
  3. import matplotlib.pyplot as plt
  4. def save2dat(RMSE,T,calibrationMethods,numRuns):
  5. k = 0
  6. for method in calibrationMethods:
  7. min_gain = np.min(RMSE[method][::2],axis=0)
  8. min_offset = np.min(RMSE[method][1::2],axis=0)
  9. max_gain = np.max(RMSE[method][::2],axis=0)
  10. max_offset = np.max(RMSE[method][1::2],axis=0)
  11. med_gain = np.median(RMSE[method][::2],axis=0)
  12. med_offset = np.median(RMSE[method][1::2],axis=0)
  13. if numRuns > 1:
  14. k = k+1
  15. plt.subplot(len(calibrationMethods),2,k)
  16. plt.semilogy(T[method][0],min_gain)
  17. plt.semilogy(T[method][0],max_gain)
  18. plt.semilogy(T[method][0],med_gain)
  19. k = k+1
  20. plt.subplot(len(calibrationMethods),2,k)
  21. plt.semilogy(T[method][0],min_offset)
  22. plt.semilogy(T[method][0],max_offset)
  23. plt.semilogy(T[method][0],med_offset)
  24. else:
  25. k = k+1
  26. plt.subplot(len(calibrationMethods),2,k)
  27. plt.semilogy(T[method][:],min_gain)
  28. plt.semilogy(T[method][:],max_gain)
  29. plt.semilogy(T[method][:],med_gain)
  30. k = k+1
  31. plt.subplot(len(calibrationMethods),2,k)
  32. plt.semilogy(T[method][:],min_offset)
  33. plt.semilogy(T[method][:],max_offset)
  34. plt.semilogy(T[method][:],med_offset)
  35. plt.show()