janosch314 / GWFish

Simulation of detector networks with Fisher-matrix PE
33 stars 19 forks source link

Removing heavy injection files: draw from distributions #38

Open jacopok opened 2 years ago

jacopok commented 2 years ago

Right now cloning this repo means downloading 65.24 MiB, most of which is really injections/BNS_8e5.txt and BBH_1e5.txt.

If these only serve as example files for population studies, maybe they could be smaller by 1-2 orders of magnitude? Then the repo could shrink to single MBs

janosch314 commented 2 years ago

These two files are examples of complete cosmological distributions, and it would not make sense to reduce the number of signals. However, since the mass distribution of the BBH file is simple, and the mass distribution of the BNS file to be ignored, the only valuable information in these two files are the redshift distributions. These two distributions could also be included in CBC_Population to be drawn from.

jacopok commented 2 years ago

I see; I guess my thinking is that people might want to take GWFish and use it with their own populations / single signals, and they'd benefit from a smaller download size if they don't need those distributions...

This might also be simply fixed by updating the pypi release, which does not need to include anything but the core module.

By including the redshift distributions in CBC_Population, do you mean including an analytical approximation for them that could be drawn from arbitrarily? That could be quite nice, although I guess one should be careful since there are so many uncertainties in these populations...

janosch314 commented 2 years ago

Yes, I mean an approximation calculated from the z-histogram of these two files. Then, we wouldn't need these two files anymore. People could just decide to draw as many signals as they want from the actual distributions. Certainly, we should not assume that the distribution in these two files is the final word, and of course we know from simulations already that distance and mass distributions at least for BBH have correlations. Anyway, if not with these two files, then in some other way we should provide a reasonable redshift distribution for BNS and BBH for people to play with.

jacopok commented 2 years ago

Sounds good to me! Maybe even better than fitting the histograms, we can go to the source: if I understand correctly all these come from Cosmorate, and the redshift merger distribution is basically given by the function merger_rate_density there. I think it shouldn't be hard to adapt that into a fiducial cosmological model to be integrated within GWFish. I can ask Filippo for a chat maybe just to make sure we don't do anything improper.

For fun, I tried to fit the histogram anyway - it's rather easy to capture the peak, but fitting the tail is more complicated, it seems to be quite featured (probably some interesting metallicity evolution)... metallicity_BNS_distrib

The model here is $f(z) \sim z^A \mathcal{N}(z, \mu_1, \sigma_1) + B \mathcal{N}(z, \mu_2, \sigma_2)$, where $\mathcal{N}$ is a Gaussian.