Waveform Generators
ptfp.waveform_generators
NegativeWaveformGenerator
NegativeWaveformGenerator(parent=None, duration=None, sampling_frequency=None, start_time=0, frequency_domain_source_model=None, time_domain_source_model=None, parameters=None, parameter_conversion=None, waveform_arguments=None)
Bases: WaveformGenerator
Initialize a negative waveform generator
Parameters
parent : Optional[bilby.gw.waveform_generator.WaveformGenerator]
If passed, uses this as the base waveform generator,
then modifies the output.
Obviates need for all other configuration.
sampling_frequency : float, optional
The sampling frequency
duration : float, optional
Time duration of data
start_time : float, optional
Starting time of the time array
frequency_domain_source_model : func, optional
A python function taking some arguments and returning the frequency
domain strain. Note the first argument must be the frequencies at
which to compute the strain
time_domain_source_model : func, optional
A python function taking some arguments and returning the time
domain strain. Note the first argument must be the times at
which to compute the strain
parameters : dict, optional
Initial values for the parameters
parameter_conversion : func, optional
Function to convert from sampled parameters to parameters of the
waveform generator. Default value is the identity, i.e. it leaves
the parameters unaffected.
waveform_arguments : dict, optional
A dictionary of fixed keyword arguments to pass to either
`frequency_domain_source_model` or `time_domain_source_model`.
Note: the arguments of frequency_domain_source_model (except the first,
which is the frequencies at which to compute the strain) will be added to
the WaveformGenerator object and initialised to `None`.
Source code in ptfp/waveform_generators.py
9 10 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 62 63 64 65 66 67 68 69 |
|
frequency_domain_strain
frequency_domain_strain(parameters=None)
Returns the negative frequency domain strain -h(f)
Parameters
parameters : Optional[Dict[str, float]]
The parameters of the sample to evaluate.
If unpassed attempts to use waveform generator parameters
Returns
Dict[str, np.array]
The strain dictionary of the negative
e.g. {'plus':strain['plus'] * -1, 'cross':strain['cross'] * -1}
Source code in ptfp/waveform_generators.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
InjectionResidualWaveformGenerator
InjectionResidualWaveformGenerator(injection_parameters, parent=None, duration=None, sampling_frequency=None, start_time=0, frequency_domain_source_model=None, time_domain_source_model=None, parameters=None, parameter_conversion=None, waveform_arguments=None)
Bases: WaveformGenerator
A waveform generator to inject the residual of a (PE) sample against an injection. That is, it injects h_inj - h_sample. This allows the production of residual posterior reconstructions
Initialization for the residual generator
Parameters
injection_parameters : Dict[str, float]
The parameters used for the *injection*
parent : Optional[bilby.gw.waveform_generator.WaveformGenerator]
If passed, uses this as the base waveform generator,
then modifies the output.
Obviates need for all other configuration.
sampling_frequency: float, optional
The sampling frequency
duration: float, optional
Time duration of data
start_time: float, optional
Starting time of the time array
frequency_domain_source_model: func, optional
A python function taking some arguments and returning the frequency
domain strain. Note the first argument must be the frequencies at
which to compute the strain
time_domain_source_model: func, optional
A python function taking some arguments and returning the time
domain strain. Note the first argument must be the times at
which to compute the strain
parameters: dict, optional
Initial values for the parameters
parameter_conversion: func, optional
Function to convert from sampled parameters to parameters of the
waveform generator. Default value is the identity, i.e. it leaves
the parameters unaffected.
waveform_arguments: dict, optional
A dictionary of fixed keyword arguments to pass to either
`frequency_domain_source_model` or `time_domain_source_model`.
Note: the arguments of frequency_domain_source_model (except the first,
which is the frequencies at which to compute the strain)
will be added to the WaveformGenerator object
and initialised to `None`.
Source code in ptfp/waveform_generators.py
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 |
|
injection_parameters
property
writable
injection_parameters
The parameters of the injection to take the residual against
frequency_domain_strain
frequency_domain_strain(parameters=None)
Returns the frequency domain residual strain (h_inj(f) - h_samp(f))
Parameters
parameters : Optional[Dict[str, float]]
The parameters of the sample to evaluate.
If unpassed attempts to use waveform generator parameters
Returns
Dict[str, np.array]
The strain dictionary of the residual (h_inj(f) - h_samp(f))
e.g. {'plus':array, 'cross':array}
Source code in ptfp/waveform_generators.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
|