code: def does_coord_increase_w_index(arr):
      
      diff = np.diff(arr)
      if not np.all(np.abs(np.sign(diff))):
          raise ValueError("Array is not monotonic: {}".format(arr))
      # Since we know its monotonic, just test the first value.
      return bool(diff[0])
docs: Determine if the array values increase with the index.
  
      Useful, e.g., for pressure, which sometimes is indexed surface to TOA and
      sometimes the opposite.