Exemple #1
0
def iter_run(i):
    r = CosmicPopulation(N_SRCS, n_days=N_DAYS, repeaters=True)
    r.set_dist(model='vol_co', z_max=1.0)
    r.set_dm_host(model='gauss', mean=100, std=200)
    r.set_dm_igm(model='ioka', slope=1000, std=None)
    r.set_dm(mw=True, igm=True, host=True)
    r.set_emission_range(low=100e6, high=10e9)
    r.set_lum(model='powerlaw',
              per_source='different',
              low=1e40,
              high=1e45,
              power=0)
    r.set_si(model='gauss', mean=-1.4, std=1)
    r.set_w(model='lognormal', per_source='different', mean=0.1, std=1)
    rate = lognormal(RATE, 2, N_SRCS)
    if LARGE_POP:
        rate = lognormal(RATE, 2, int(MAX_SIZE))  # Not completely kosher
    r.set_time(model='poisson', rate=rate)

    # Set up survey
    s = Survey('chime-frb', n_days=N_DAYS)
    s.set_beam(model='chime-frb')
    s.gen_pointings()  # To ensure each sub pop has the same pointings

    # Only generate FRBs in CHIME's survey region
    r.set_direction(model='uniform',
                    min_ra=s.ra_min,
                    max_ra=s.ra_max,
                    min_dec=s.dec_min,
                    max_dec=s.dec_max)

    if LARGE_POP:
        surv_pop = LargePopulation(r, s, max_size=MAX_SIZE).pops[0]
    else:
        r.generate()
        surv_pop = SurveyPopulation(r, s)
    surv_pop.name = f'cosmic_chime_longer_{i}'
    surv_pop.save()

    print(surv_pop.source_rate)
    print(surv_pop.burst_rate)
    pprint(f'i: {i}')
    pprint(f'# one-offs: {surv_pop.n_one_offs()}')
    pprint(f'# repeaters: {surv_pop.n_repeaters()}')
Exemple #2
0
        print(f'rate: {ra}')
        r = CosmicPopulation(n, n_days=N_DAYS, repeaters=True)
        r.set_dist(model='vol_co', z_max=1.0)
        r.set_dm_host(model='gauss', mean=100, std=200)
        r.set_dm_igm(model='ioka', slope=1000, std=None)
        r.set_dm(mw=True, igm=True, host=True)
        r.set_emission_range(low=100e6, high=10e9)
        r.set_lum(model='powerlaw',
                  per_source='different',
                  low=1e40,
                  high=1e45,
                  power=0)
        r.set_si(model='gauss', mean=-1.4, std=1)
        r.set_w(model='lognormal', per_source='different', mean=0.1, std=1)
        rate = lognormal(ra, 1, int(n))
        r.set_time(model='poisson', rate=rate)

        # Set up survey
        s = Survey('chime-frb', n_days=N_DAYS)
        s.set_beam(model='chime-frb')

        # Only generate FRBs in CHIME's survey region
        r.set_direction(model='uniform',
                        min_ra=s.ra_min,
                        max_ra=s.ra_max,
                        min_dec=s.dec_min,
                        max_dec=s.dec_max)

        r.generate()

        surv_pop = SurveyPopulation(r, s)
# Dispersion measure properties
pop.set_dm_host(model='gauss', mean=100, std=200)
pop.set_dm_igm(model='ioka', slope=1000, std=None)
pop.set_dm_mw(model='ne2001')

# Emission range of FRB sources
pop.set_emission_range(low=100e6, high=10e9)

# Luminsity of FRBs
# See the per_source argument? That allows you to give different properties
# to different bursts from the same source. You can do that for the luminosity,
# or any of the following parameters
pop.set_lum(model='powerlaw', low=1e38, high=1e38, power=0,
            per_source='different')

# Pulse width
pop.set_w(model='uniform', low=10, high=10)

# Spectral index
pop.set_si(model='gauss', mean=0, std=0)

# If repeaters, how they repeat
pop.set_time(model='regular', rate=2)

# And then generate the population!
pop.generate()

# Or simply use some predefined models
pop_simple = CosmicPopulation.simple(1e4, generate=True)
pop_complex = CosmicPopulation.complex(1e4, generate=True)