gravelamps.inference

Inference configuration and running

The following are the functions which control the setup and running of a nested sampling inference run for lensed gravitational waveforms, including the production of lensed data and the actual nested sampling run. The main function is accessed via gravelamps_inference.

Written by Mick Wright 2022

Functions

generate_files(config, lens_module, lens_package, ...)

Generate required interpolator files, if necessary

generate_waveform_arguments(config, args)

Generate waveform arguments dictionary

generate_inference_args(args[, injection])

Generate additional argument set for main function

run_bilby_pipe_functions(bilby_pipe_config)

Execute bilby_pipe DAG generation functions

main()

Generate lensed infernece run

Module Contents

gravelamps.inference.generate_files(config, lens_module, lens_package, lens_generation_args, injection)

Generate required interpolator files, if necessary

Will generate a dictionary containing the needed files for the interpolator. Primarily this is done via gravelamps.generate_lens.main, however, if the specified module is capable of producing interpolator data directly via a function generate_interpolator_files, this will be used instead. None will be returned if no files are necessary.

Parameters:
configconfigparser.ConfigParser

INI Configuration Parser containing lens generation settings

lens_modulestr

Name of the module being used for lensing functions

lens_packageModuleType

Module containing the lensing function

lens_generation_argsNamespace

Namespace containing commandline arguments to main function

injectionbool

Flag to determine if run is injection or analysis

Returns:
interpolator_filesdict/None

Contains the paths to the files needed for interpolator generation if files are needed

gravelamps.inference.generate_waveform_arguments(config, args)

Generate waveform arguments dictionary

Parameters:
configconfigparser.ConfigParser

INI Configuration Parser containing waveform settings

argsargparse.Namespace

Namespace containing commandline arguments to main function

Returns:
waveform_argumentsdict

Arguments for the waveform generation

gravelamps.inference.generate_inference_args(args, injection=False)

Generate additional argument set for main function

Creates an additional copy of the commandline arguments provided to inference in order to run simultaneously an injection and analysis run of lens generation.

Parameters:
argsargparse.Namespace

Commandline arguments passed to main inference program

injectionbool, optional, default=False

Flag to determine whether result should be an injection or analysis configuration

Returns:
inference_argsargparse.Namespace

Commandline argument copy with specified settings

gravelamps.inference.run_bilby_pipe_functions(bilby_pipe_config)

Execute bilby_pipe DAG generation functions

Creates the DAG necessary to run the bilby_pipe aspects of the job which handle the waveform construction and nested sampling of the data.

Parameters:
bilby_pipe_configdict

Contains configuration options for running of bilby_pipe functions

gravelamps.inference.main()

Generate lensed infernece run

Configuration should be specified within provided INI file. THe function will then produce a complete configuration for the generation of necessary lensed interpolator data, and inference of signal data using the lensed waveforms. If the user specifies, this will be run directly, or a DAG will be generated for submission to HTCondor. If the user specifies, the DAG will be directly submitted to the scheduler.