calibrationStatistics.py 413 B

123456789101112131415
  1. import numpy as np
  2. def calibrationStatistics(data,res):
  3. F = res['F']
  4. Stat = {
  5. 'rmseGain': rms(F[0,0:-1]-data.F[0,0:-1]),
  6. 'nrmseGain': rms(F[0,0:-1]-data.F[0,0:-1])/rms(data.F[0,0:-1]),
  7. 'rmseOffset': rms(F[1,0:-1]-data.F[1,0:-1]),
  8. 'nrmseOffset': rms(F[1,0:-1]-data.F[1,0:-1])/rms(data.F[1,0:-1])
  9. }
  10. return Stat
  11. def rms(x):
  12. return np.sqrt(np.mean(x ** 2))