Bilby Pipe Interface
ptfp.bilby_pipe_interface
get_analysis_from_dag
get_analysis_from_dag(path_to_dag, data_case=0, analysis_interferometers='H1L1', data_analysis_input_class=DataAnalysisInput, parser_generator=create_parser)
Given a dag (and located in the correct directory) gets the bilby_pipe.data_analysis.DataAnalysisInput object corresponding to that bilby pipe run.
Parameters
path_to_dag : str
The path to the dag, absolute or relative to
directory from which it could be run
(i.e. outdir/submit/dagname.dag)
data_case : int
The case of the data to use (i.e. the index 0
in a ..._data0_... file name).
For multiple injection runs, this is the injection
index.
analysis_interferometers : str
The interferometers used in the analysis you wish to load,
used to search for the appropriate files. Defaults to H1L1
data_analysis_input_class: Callable = bilby_pipe.data_analysis.DataAnalysisInput
The input class from which to generate the analysis object.
Note that this has only been tested with the standard DataAnalysisInput
parser_generator: Callable = bilby_pipe.parser.create_parser,
The input class from which to generate the analysis object.
Note that this has only been tested with the standard bilby_pipe parser
Returns
bibly_pipe.data_analysis.DataAnalysisInput
The analysis input object corresponding to this run
Source code in ptfp/bilby_pipe_interface.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
draw_dict_sample_from_posterior
draw_dict_sample_from_posterior(posterior)
Gets a correctly formatted dict corresponding to a single sample in the posterior.
Parameters
posterior : pd.DataFrame
The dataframe representation of the posterior
to draw a sample from
Returns
Dict[str, float]
The dictionary of {param_name : param_value} for a given sample
Source code in ptfp/bilby_pipe_interface.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
get_all_analysis_components
get_all_analysis_components(base_directory, analysis_interferometers='H1L1', data_case=0)
Reconstruct the objects used in the bilby pipe run by parsing out necessary information in the output directory, using various dag and file parsing methods. Requires the original run output directory to function
Parameters
base_directory : str
The directory in which the analysis was run
analysis_interferometers : str
The interferometers used for the analysis
(as appears in bilby filenames)
data_case : Optional[int]=0
If there are multiple indexed data objects (e.g. from injections),
this indexes which to return
Returns
bilby.core.result.Result
The analysis result
bilby_pipe.utils.DataDump
The data dump object
bilby_pipe.data_analysis.DataAnalysisInput
The reconsructed analysis object
bilby.gw.likelihood.GravitationalWaveTransient
The likelihood used in the analysis
Source code in ptfp/bilby_pipe_interface.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
|