docs: def get_background_sources(self, src_filter, sample_factor=None):
          """
          Turn the background model of a given branch into a set of point sources
  
          :param src_filter:
              SourceFilter instance
          :param sample_factor:
              Used to reduce the sources if OQ_SAMPLE_SOURCES is set
          """
          background_sids = self.get_background_sids(src_filter)
          if sample_factor is not None:  # hack for use in the mosaic
              background_sids = random_filter(
                  background_sids, sample_factor, seed=42)
          with h5py.File(self.source_file, "r") as hdf5:
              grid_loc = "/".join(["Grid", self.idx_set["grid_key"]])
              # for instance Grid/FM0_0_MEANFS_MEANMSR_MeanRates
              mags = hdf5[grid_loc + "/Magnitude"].value
              mmax = hdf5[grid_loc + "/MMax"][background_sids]
              rates = hdf5[grid_loc + "/RateArray"][background_sids, :]
              locations = hdf5["Grid/Locations"][background_sids, :]
              sources = []
              for i, bg_idx in enumerate(background_sids):
                  src_id = "_".join([self.idx_set["grid_key"], str(bg_idx)])
                  src_name = "|".join([self.idx_set["total_key"], str(bg_idx)])
                  mag_idx = (self.min_mag <= mags) & (mags < mmax[i])
                  src_mags = mags[mag_idx]
                  src_mfd = EvenlyDiscretizedMFD(
                      src_mags[0],
                      src_mags[1] - src_mags[0],
                      rates[i, mag_idx].tolist())
                  ps = PointSource(
                      src_id, src_name, self.tectonic_region_type, src_mfd,
                      self.mesh_spacing, self.msr, self.aspect, self.tom,
                      self.usd, self.lsd,
                      Point(locations[i, 0], locations[i, 1]),
                      self.npd, self.hdd)
                  ps.id = self.id
                  ps.src_group_id = self.src_group_id
                  ps.num_ruptures = ps.count_ruptures()
                  sources.append(ps)
          return sources