From 7bb44eac46ac92a2931a64f6f9452514269d7f8f Mon Sep 17 00:00:00 2001 From: Peter Pang Date: Fri, 16 Feb 2024 20:24:17 +0100 Subject: [PATCH] Printing injected SNRs --- src/jimgw/single_event/detector.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/jimgw/single_event/detector.py b/src/jimgw/single_event/detector.py index 4cea21af..ddaba2f5 100644 --- a/src/jimgw/single_event/detector.py +++ b/src/jimgw/single_event/detector.py @@ -406,6 +406,14 @@ def inject_signal( signal = self.fd_response(freqs, h_sky, params) * align_time self.data = signal + noise_real + 1j * noise_imag + # also calculate the optimal SNR and match filter SNR + optimal_SNR = jnp.sqrt(jnp.sum(signal * signal.conj() / var).real) + match_filter_SNR = jnp.sum(self.data * signal.conj() / var) / optimal_SNR + + print(f"For detector {self.name}:") + print(f"The injected optimal SNR is {optimal_SNR}") + print(f"The injected match filter SNR is {match_filter_SNR}") + @jaxtyped def load_psd( self, freqs: Float[Array, " n_sample"], psd_file: str = ""