code: def to_radians(arr, is_delta=False):
      
      # Infer the units from embedded metadata, if it's there.
      try:
          units = arr.units
      except AttributeError:
          pass
      else:
          if units.lower().startswith('degrees'):
              warn_msg = ("Conversion applied: degrees -> radians to array: "
                          "{}".format(arr))
              logging.debug(warn_msg)
              return np.deg2rad(arr)
      # Otherwise, assume degrees if the values are sufficiently large.
      threshold = 0.1*np.pi if is_delta else 4*np.pi
      if np.max(np.abs(arr)) > threshold:
          warn_msg = ("Conversion applied: degrees -> radians to array: "
                      "{}".format(arr))
          logging.debug(warn_msg)
          return np.deg2rad(arr)
      return arr
docs: Force data with units either degrees or radians to be radians.