summaryclassification
The summaryclassification executable allows the user to generate source based classification probabilities given the samples in a GW specific result file by interacting with the pesummary.gw.pepredicates and pesummary.gw.p_astro modules and PEPredicates and ligo.em-bright packages.
To see help for this executable please run:
$ summaryclassification --help
usage: summaryclassification [-h] [-w DIR] [-s SAMPLES [SAMPLES ...]]
[--labels LABELS [LABELS ...]]
[--prior {population,default,both}]
[--plot {bar,mass_1_mass_2}]
This executable is used to generate a txt file containing the source
classification probailities
optional arguments:
-h, --help show this help message and exit
-w DIR, --webdir DIR make page and plots in DIR
-s SAMPLES [SAMPLES ...], --samples SAMPLES [SAMPLES ...]
Posterior samples hdf5 file
--labels LABELS [LABELS ...]
labels used to distinguish runs
--prior {population,default,both}
Prior to use when calculating source classification
probabilities
--plot {bar,mass_1_mass_2}
name of the plot you wish to make
Generating classification probabilities
Below is an example of the output from summary summaryclassification on a result file,
$ summaryclassification --webdir ./ --samples posterior_samples.hdf5 \
--labels GW150914
$ ls ./
GW150914_default_prior_pe_classification.json
GW150914_population_prior_pe_classification.json
GW150914_population_pepredicates_bar.png
pesummary.gw.pepredicates
- class pesummary.gw.pepredicates.PEPredicates[source]
Class to handle the PEPredicates package
- static check_for_dataframe(samples=None, parameters=None, dataframe=None)[source]
Return dataframe if dataframe is not None else make a PEPredicate dataframe from samples and parameters.
- Parameters
samples (list) – list of samples for a specific result file
parameters (list) – list of parameters corresponding to samples
dataframe (pandas.DataFrame) – pandas DataFrame containing samples for specific result file. dataframe must have entries m1_source, m2_source, dist, redshift, a1, a2
- static classifications(samples, parameters)[source]
Return the source classification probabilities using both the default prior used in the analysis and the population prior
- static convert_to_PEPredicate_data_frame(samples, parameters)[source]
Convert the inputs to a pandas data frame compatible with PEPredicated
- Parameters
samples (list) – list of samples for a specific result file
parameters (list) – list of parameters for a specific result file
- static default_classification(samples=None, parameters=None, predicate_dataframe=None)[source]
Return the source classification probabilities using the default prior used
- Parameters
samples (list) – list of samples for a specific result file. Used only if predicate_dataframe is None
parameters (list) – list of parameters corresponding to samples. Used only if predicate_dataframe is None
predicate_dataframe (pandas.DataFrame) – pandas DataFrame containing samples for specific result file. predicate_dataframe must have entries m1_source, m2_source, dist, redshift, a1, a2.
- static plot(samples, parameters, population_prior=True)[source]
Make a plot of the samples classified by type
- Parameters
samples (list) – list of samples for a specific result file
- static population_classification(samples=None, parameters=None, predicate_dataframe=None)[source]
Return the source classification probabilities using a population prior
- Parameters
samples (list) – list of samples for a specific result file. Used only if predicate_dataframe is None
parameters (list) – list of parameters corresponding to samples. Used only if predicate_dataframe is None
predicate_dataframe (pandas.DataFrame) – pandas DataFrame containing samples for specific result file. predicate_dataframe must have entries m1_source, m2_source, dist, redshift, a1, a2.