Skip to content

Commit

Permalink
Printing injected SNRs
Browse files Browse the repository at this point in the history
  • Loading branch information
tsunhopang authored Feb 16, 2024
1 parent c477887 commit 7bb44ea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/jimgw/single_event/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down

0 comments on commit 7bb44ea

Please sign in to comment.