-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code speedup options #42
Comments
@telegraphic - Hi Danny,
Have you got the code for your detection rate estimation available somewhere? I'd be interested to take a look at how exactly you're going about it, the assumptions you've made about the input FRB population and whether you're comparing the simulated detection rate of another telescope with your survey's rate (and then looking at the actual numbers provided by real observations to make a prediction). I can see that Do you simply use this script and add your own survey properties to Thanks a lot in advance! |
Hi @0xCoto, @davidgardenier is of course the expert, and I was intending to get his input when we get more serious about simulations, so please consider below to be of dubious quality: Here's a gist, current quite basic: # And setup the survey (this reads from the CSV file, I added a line)
survey = Survey('eda')
# Now generate FRB population
n_source = 5e6
n_days = 1.0
cosmic_pop = CosmicPopulation.complex(n_source, n_days=n_days)
cosmic_pop.generate() Output:
Then we see what of the cosmic population our survey can see: # Calculate what we can see
survey_pop = SurveyPopulation(cosmic_pop, survey)
# Print stats
print(survey_pop.source_rate)
for DM in (100, 500, 1000, 2000):
print("DM smearing @ %i pc/cm3 [ms]: %2.3f" % (DM, survey.calc_dm_smear(DM)))
print("Fluence Limit [Jy ms]:", survey.calc_fluence_limit(10e-3)) Output:
For plotting I'm doing things like:
(or using the in-built web app plotter, which is pretty awesome!) Not sure if it is the best way to go, but you can edit params of existing surveys before generating populations: survey = Survey('utmost')
utmost2d_params = d[d['survey'] == 'utmost'].squeeze()
#print(utmost2d_params)
survey.bw = 45.0
survey.bw_chan = 100.0/1024
survey.T_rec = 70.0
survey.beam_size_at_fwhm = 26.0
survey.beam_size = 26.0
survey.gain = 0.21 My understanding is that the code does not directly give you an event rate in FRBs/sky/day, but just tells you what fraction of the simulated population of FRBs is detected. IYou then need to scale this by simulating an existing survey with well-pinned down event rate, e.g. Parkes HTRU;; survey = Survey('parkes-htru')
survey_pop = SurveyPopulation(cosmic_pop, survey) As for the surveys, @davidgardenier 's paper has a table comparing them. To me (please correct if I've misunderstood!), there are three models, where 'simple' is a toy model and 'complex' and 'optimal' boil down to two hypotheses:
From my simulations at low frequency these have drastic implications for the source counts: the complex model predicts far more detectable FRBs than the optimal model. |
Thank you very much for your input, I'll definitely keep everything you mentioned in mind! |
Hi David,
I've been using your code to estimate how many FRBs we could detect with a new survey -- thank you very much for making this available, it is fantastic! (I will be in touch about the science via email once it's a bit better fleshed out).
I had some ideas for speeding up the code, which are in this notebook.
The first is to speed up
gen_dm()
inCosmicPopulation
by using healpy to do the coordinate lookup, instead of sqlite (there is a fair bit of overhead with making multiple sql queries). I just uploaded a precomputed NE2001 and YMW16 healpix maps to PyGEDM, which is essentially equivalent to the sqlite table frbpoppy populates.The second is to speed up
gen_dist()
by usinginterp1d
from scipy, to generate interpolation functions that can be used instead of the DistanceTable lookup.Combined, these should significantly speed up the time taken for
CosmicPopulation.generate()
.As you'll see in the notebook, the NE2001 models have some disagreement. I'm not sure if this is due to rounding or something else?
The text was updated successfully, but these errors were encountered: