docs: def calculate_bin_centers(edges):
      """
      Calculate the centers of wavelengths bins given their edges.
  
      Parameters
      ----------
      edges : array_like
          Sequence of bin edges. Must be 1D and have at least two values.
  
      Returns
      -------
      centers : ndarray
          Array of bin centers. Will be 1D and have one less value than ``edges``.
  
      """
      edges = np.asanyarray(edges, dtype=np.float)
  
      if edges.ndim != 1:
          raise ValueError('edges input array must be 1D.')
  
      if edges.size < 2:
          raise ValueError('edges input must have at least two values.')
  
      centers = np.empty(edges.size - 1, dtype=np.float)
  
      centers[0] = edges[:2].mean()
  
      for i in range(1, centers.size):
          centers[i] = 2. * edges[i] - centers[i - 1]
  
      return centers