code: def mag_inclination(RAW_IMU, ATTITUDE, declination=None):
      '''give the magnitude of the discrepancy between observed and expected magnetic field'''
      if declination is None:
          import mavutil
          declination = degrees(mavutil.mavfile_global.param('COMPASS_DEC', 0))
      r = rotation(ATTITUDE)
      mag1 = Vector3(RAW_IMU.xmag, RAW_IMU.ymag, RAW_IMU.zmag)
      mag1 = r * mag1
      mag2 = Vector3(cos(radians(declination)), sin(radians(declination)), 0)
      inclination = degrees(mag1.angle(mag2))
      if RAW_IMU.zmag < 0:
          inclination = -inclination
      return inclinatiof mag_inclination(RAW_IMU, ATTITUDE, declination=None):
      '''give the magnitude of the discrepancy between observed and expected magnetic field'''
      if declination is None:
          import mavutil
          declination = degrees(mavutil.mavfile_global.param('COMPASS_DEC', 0))
      r = rotation(ATTITUDE)
      mag1 = Vector3(RAW_IMU.xmag, RAW_IMU.ymag, RAW_IMU.zmag)
      mag1 = r * mag1
      mag2 = Vector3(cos(radians(declination)), sin(radians(declination)), 0)
      inclination = degrees(mag1.angle(mag2))
      if RAW_IMU.zmag < 0:
          inclination = -inclination
      return inclination
docs: give the magnitude of the discrepancy between observed and expected magnetic field