... | ... | @@ -6,102 +6,6 @@ Results of investigations into understanding the performance of different sample |
|
|
|
|
|
[Here is a recipe for generating a PP plot for a sampler](pp/howto)
|
|
|
|
|
|
Here is a recipe to generate pp-plots. You'll need three things. A **configuration file** `config.ini` with content:
|
|
|
|
|
|
```file
|
|
|
config.ini
|
|
|
label = bbh_pp_study
|
|
|
detectors = [H1, L1]
|
|
|
duration = 4
|
|
|
outdir=.
|
|
|
trigger-time = 0
|
|
|
prior-file = chirp_mass_mass_ratio.prior
|
|
|
create-output = True
|
|
|
injection = True
|
|
|
n-injection = 100
|
|
|
accounting = ligo.dev.o3.cbc.pe.lalinference
|
|
|
deltaT = 0.1
|
|
|
|
|
|
# Sampler specific configuration: to be varied
|
|
|
sampler = dynesty
|
|
|
sampler-kwargs = {'nlive': 1024, 'walks': 60}
|
|
|
```
|
|
|
|
|
|
A **prior-file** `chirp_mass_ratio.prior` with content:
|
|
|
|
|
|
```file
|
|
|
chirp_mass = Uniform(name='chirp_mass', minimum=25, maximum=100, unit='$M_{\\odot}$')
|
|
|
mass_ratio = Uniform(name='mass_ratio', minimum=0.125, maximum=1)
|
|
|
a_1 = 0
|
|
|
a_2 = 0
|
|
|
tilt_1 = 0
|
|
|
tilt_2 = 0
|
|
|
phi_12 = 0
|
|
|
phi_jl = 0
|
|
|
dec = Cosine(name='dec')
|
|
|
ra = Uniform(name='ra', minimum=0, maximum=2 * np.pi)
|
|
|
iota = Sine(name='iota')
|
|
|
psi = Uniform(name='psi', minimum=0, maximum=np.pi)
|
|
|
phase = Uniform(name='phase', minimum=0, maximum=2 * np.pi)
|
|
|
luminosity_distance = PowerLaw(alpha=2, minimum=100, maximum=1000, name='luminosity_distance')
|
|
|
geocent_time = 0
|
|
|
```
|
|
|
|
|
|
and a **Makefile** (a file literally named `Makefile`) with content:
|
|
|
|
|
|
```
|
|
|
SHELL = /bin/bash
|
|
|
|
|
|
simg = bilby_pipe_0.0.3.simg
|
|
|
|
|
|
.PHONY : clean submit
|
|
|
|
|
|
submit : clean $(simg)
|
|
|
./$(simg) config.ini
|
|
|
condor_submit_dag submit/dag*
|
|
|
|
|
|
clean :
|
|
|
rm -rf log_* result submit
|
|
|
|
|
|
$(simg) :
|
|
|
singularity pull --name $(simg) shub://lscsoft/bilby_pipe:0.0.3
|
|
|
```
|
|
|
|
|
|
Once these three files are in a directory, then running
|
|
|
|
|
|
```bash
|
|
|
$ make
|
|
|
```
|
|
|
|
|
|
will download the singularity container [^1], remove any old files (**WARNING: take care not to delete anything you are trying to add too**), generate the jobs and submit them.
|
|
|
|
|
|
[^1]: if you receive and error message about a timeout or SSLCertificate error, this is a known bug with the singularity-hub server. Please let me know if this happens!
|
|
|
|
|
|
Finally to generate a PP plot, add this script (say named `generate_pp_plots.py`) with content:
|
|
|
|
|
|
```python
|
|
|
import glob
|
|
|
import sys
|
|
|
import bilby
|
|
|
|
|
|
results_directory = sys.argv[1]
|
|
|
|
|
|
results_files = glob.glob(results_directory + '/*result.h5')
|
|
|
results = [bilby.core.result.read_in_result(f) for f in results_files]
|
|
|
bilby.core.result.make_pp_plot(results, filename='pp.png')
|
|
|
```
|
|
|
|
|
|
and run as
|
|
|
```bash
|
|
|
$ python generate_pp_plots.py results/
|
|
|
```
|
|
|
here the `results` is the path to where the output `*result.h5` files are stored by default for the run. If you change this, you'll also need to change this path.
|
|
|
|
|
|
|
|
|
#### Notes
|
|
|
|
|
|
* Using the container is preferred as it guarantees the version of bilby and bilby_pipe are consistent (you should indicate the versions when reporting results)
|
|
|
|
|
|
### Collected results
|
|
|
|
|
|
* [dynesty (Greg Ashton)](pp/dynesty.md) |
|
|
\ No newline at end of file |