pop.set_w(model='constant', value=1) pop.set_dm(mw=False, igm=True, host=False) # Add a distribution of Poisson burst rates if SINGLE_INPUT_RATE: rate_dist = RATE else: rate_dist = log10normal(RATE, 2, N_SRCS) pop.set_time(model='poisson', rate=rate_dist) pop.generate() # Survey the high fluences survey = Survey('perfect', n_days=N_DAYS) survey.set_beam(model='perfect') survey.snr_limit = 1e-6 survey.t_obs = 60 * 60 # seconds # Check the burst rate surv_pop = SurveyPopulation(pop, survey) time = surv_pop.frbs.time # Set up plot plot_aa_style() if isinstance(rate_dist, np.ndarray): min_rate = np.log10(np.min(rate_dist[rate_dist != 0])) max_rate = np.log10(max(rate_dist)) else: min_rate = np.log10(RATE) - 1 max_rate = np.log10(RATE) + 1 rate_dist = np.array(rate_dist)
time = np.where(t < day, t, np.nan) n_rep = ((~np.isnan(time)).sum(1) > 1).sum() n_one_offs = ((~np.isnan(time)).sum(1) == 1).sum() frac = n_rep / (n_rep + n_one_offs) fracs.append(frac) print(f'# one-offs: {n_one_offs}') print(f'# repeaters: {n_rep}') return days, fracs r_pop = setup_pop(N_SRCS) # Set up surveys survey = Survey('perfect', n_days=MAX_DAYS) survey.mount_type = 'transit' survey.t_obs = 60*60*24 survey.set_beam(model='perfect') survey.snr_limit = 10000 chime_survey = deepcopy(survey) chime_survey.set_beam(model='chime-frb') chime_survey.snr_limit = 1 # Set up plot style plot_aa_style(cols=2) f, (ax1, ax2) = plt.subplots(1, 2) colors = plt.rcParams['axes.prop_cycle'].by_key()['color'] linestyles = ['solid', 'dotted'] dist_types = ['rep', 'dist', 'mix']