Skip to content
Snippets Groups Projects
Commit 05a74dd2 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Merge branch 'standardize-snr-calculation-method' into 'master'

Make the SNR calculation identical if done with an dataframe or dict

See merge request !835
parents a6f96f6a 032fb3df
No related branches found
No related tags found
No related merge requests found
......@@ -1116,13 +1116,14 @@ def compute_snrs(sample, likelihood):
if isinstance(sample, dict):
signal_polarizations =\
likelihood.waveform_generator.frequency_domain_strain(sample)
likelihood.parameters.update(sample)
for ifo in likelihood.interferometers:
signal = ifo.get_detector_response(signal_polarizations, sample)
per_detector_snr = likelihood.calculate_snrs(
signal_polarizations, ifo)
sample['{}_matched_filter_snr'.format(ifo.name)] =\
ifo.matched_filter_snr(signal=signal)
per_detector_snr.complex_matched_filter_snr
sample['{}_optimal_snr'.format(ifo.name)] = \
ifo.optimal_snr_squared(signal=signal) ** 0.5
per_detector_snr.optimal_snr_squared.real ** 0.5
else:
logger.info(
'Computing SNRs for every sample.')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment