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 ...]
                        Path to posterior samples file(s). See documentation
                        for allowed formats. If path is on a remote server,
                        add username and servername in the form
                        {username}@{servername}:{path}. If path is on a public
                        webpage, ensure the path starts with https://. You may
                        also pass a string such as posterior_samples*.dat and
                        all matching files will be used
  --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 check_for_install()[source]

Check that predicates is installed

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 default_predicates()[source]

Set the default possibilities

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.

static resample_to_population(samples)[source]

Return samples that have been resampled to a sensibile population

Parameters

samples (list) – list of samples for a specific result file

pesummary.gw.p_astro

class pesummary.gw.p_astro.PAstro[source]

Class to handle the p_astro package

static check_for_install()[source]

Check that p_astro is installed

static classifications(samples)[source]

Return the source classification probabilities using both the default prior used in the analysis and the population prior

static default_classification(samples)[source]
static population_classification(samples)[source]