docs: def _get_catalogue_bin_limits(catalogue, dmag):
      """
      Returns the magnitude bins corresponing to the catalogue
      """
      mag_bins = np.arange(
          float(np.floor(np.min(catalogue.data['magnitude']))) - dmag,
          float(np.ceil(np.max(catalogue.data['magnitude']))) + dmag,
          dmag)
      counter = np.histogram(catalogue.data['magnitude'], mag_bins)[0]
      idx = np.where(counter > 0)[0]
      mag_bins = mag_bins[idx[0]:(idx[-1] + 2)]
      return mag_bins