diff --git a/pycbc/inject/inject.py b/pycbc/inject/inject.py index 1e15c692df8..32b99ada34b 100644 --- a/pycbc/inject/inject.py +++ b/pycbc/inject/inject.py @@ -568,6 +568,7 @@ def apply(self, strain, detector_name, f_lower=None, distance_scale=1, # safety buffer start_time = inj.tc - 2 * (inj_length + 1) if end_time < t0 or start_time > t1: + logger.warning("No injections applied.") continue signal = self.make_strain_from_inj_object(inj, delta_t, detector_name, f_lower=f_l, diff --git a/pycbc/strain/strain.py b/pycbc/strain/strain.py index 1e6d9e9bff0..4ff3b01d061 100644 --- a/pycbc/strain/strain.py +++ b/pycbc/strain/strain.py @@ -318,8 +318,6 @@ def from_cli(opt, dyn_range_fac=1, precision='single', distance_scale=opt.injection_scale_factor, injection_sample_rate=opt.injection_sample_rate, inj_filter_rejector=inj_filter_rejector) - else: - logger.warning("No injections applied.") if opt.sgburst_injection_file: logger.info("Applying sine-Gaussian burst injections")