SHARE
TWEET

Untitled

a guest Aug 19th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3.  
  4. theo_vals = [3.69, 8.05, 22.16, 25.27, 43]
  5. default_vals = [4.3, 7.85, 22.39, 25.34, 43.11]
  6. #stp_vals = [3.61, 7.82, 23.09, 26.03, 44.21]
  7. tp_vals = [2.83, 6.55, 19.27, 21.72, 36.25]
  8. noam_vals = [3.53, 7.64, 22.57, 25.44, 42.92]
  9. data_path_output = '/Users/marialauraperez/Desktop/'
  10. my_xticks = ['Ca', 'Cu', 'Ag', 'Sn', 'Gd']
  11.  
  12.  
  13. def find_errors(calib_vals):
  14.     errors = list()
  15.     for i in range(len(calib_vals)):
  16.         errors.append(100 - (np.abs(theo_vals[i] - calib_vals[i])/theo_vals[i] *100))
  17.     return errors
  18.  
  19.  
  20. # def line_at_0(x):
  21. #     arr = list()
  22. #     for i in range(len(x)):
  23. #         arr.append(0)
  24. #     return arr
  25. #
  26.  
  27. err_default = find_errors(default_vals)
  28. #err_stp = find_errors(stp_vals)
  29. err_tp = find_errors(tp_vals)
  30. err_noam = find_errors(noam_vals)
  31.  
  32. plt.figure()
  33. plt.plot(theo_vals, err_default, label='Default', marker='o')
  34. #plt.plot(theo_vals, err_stp, label='STP', marker='o')
  35. plt.plot(theo_vals, err_tp, label='Test Pulses', marker='o')
  36. plt.plot(theo_vals, err_noam, label='STP', marker='o')
  37. plt.xticks(theo_vals, my_xticks, rotation=90)
  38. plt.xlabel('Test sources')
  39. plt.legend()
  40. plt.ylabel('Accuracy [%]')
  41. plt.title('Percentage of accuracy in calibration methods', fontweight='bold')
  42. plt.savefig(data_path_output+'accuracy_calibrations_noam.png')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top