def loop_surveys(self, cosmic_pop, z_max):
     for survey in self.surveys:
         surv_pop = SurveyPopulation(cosmic_pop, survey)
         surv_pop.z_max = z_max
         rate = surv_pop.source_rate.det
         n = surv_pop.n_sources()
         errs = [np.abs(e - n) for e in poisson_interval(n)]
         d = {
             'survey': survey.name,
             'pop': cosmic_pop.name,
             'rate': rate,
             'err_low': errs[0],
             'err_high': errs[1],
             'z_max': z_max
         }
         self.data.append(d)
Exemple #2
0
    ax.set_aspect('auto')

# Get norm pop
y = 0
ys = []
names = []
rates = []
norm_sim_rate = surv_pops[0].source_rate.det
norm_real_rate = EXPECTED['parkes-htru'][0] / EXPECTED['parkes-htru'][1]
norm_rate = norm_sim_rate / norm_real_rate

for i, surv_pop in enumerate(surv_pops):

    name = surv_pop.name.split('_')[-1]
    pprint(name)
    if surv_pop.n_sources() == 0:
        print(surv_pop.source_rate)
        print(f'{name} | no FRBs in population')
        continue

    names.append(name)
    ys.append(y)

    # Dimensions measure plot
    ax = axes[0]
    ax.set_xlabel(r'DM ($\textrm{pc}\ \textrm{cm}^{-3}$)')
    ax.set_ylabel(r'\#')
    ax.set_yscale('log')

    bins, values = hist(surv_pop.frbs.dm,
                        bin_type='lin',