code: def airspeed(VFR_HUD, ratio=None, used_ratio=None, offset=None):
      '''recompute airspeed with a different ARSPD_RATIO'''
      import mavutil
      mav = mavutil.mavfile_global
      if ratio is None:
          ratio = 1.9936 # APM default
      if used_ratio is None:
          if 'ARSPD_RATIO' in mav.params:
              used_ratio = mav.params['ARSPD_RATIO']
          else:
              print("no ARSPD_RATIO in mav.params")
              used_ratio = ratio
      if hasattr(VFR_HUD,'airspeed'):
          airspeed = VFR_HUD.airspeed
      else:
          airspeed = VFR_HUD.Airspeed
      airspeed_pressure = (airspeed**2) / used_ratio
      if offset is not None:
          airspeed_pressure += offset
          if airspeed_pressure < 0:
              airspeed_pressure = 0
      airspeed = sqrt(airspeed_pressure * ratio)
      return airspeef airspeed(VFR_HUD, ratio=None, used_ratio=None, offset=None):
      '''recompute airspeed with a different ARSPD_RATIO'''
      import mavutil
      mav = mavutil.mavfile_global
      if ratio is None:
          ratio = 1.9936 # APM default
      if used_ratio is None:
          if 'ARSPD_RATIO' in mav.params:
              used_ratio = mav.params['ARSPD_RATIO']
          else:
              print("no ARSPD_RATIO in mav.params")
              used_ratio = ratio
      if hasattr(VFR_HUD,'airspeed'):
          airspeed = VFR_HUD.airspeed
      else:
          airspeed = VFR_HUD.Airspeed
      airspeed_pressure = (airspeed**2) / used_ratio
      if offset is not None:
          airspeed_pressure += offset
          if airspeed_pressure < 0:
              airspeed_pressure = 0
      airspeed = sqrt(airspeed_pressure * ratio)
      return airspeed
docs: recompute airspeed with a different ARSPD_RATIO