From 868c7b78ed88416e3cf68f81921330eab61c6a7c Mon Sep 17 00:00:00 2001
From: Marc Arene <marc.arene@apc.in2p3.fr>
Date: Mon, 3 Feb 2020 12:24:09 +0100
Subject: [PATCH] Adding logger.debug message when lalsim waveform longer than
 bilby's.

---
 bilby/gw/source.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/bilby/gw/source.py b/bilby/gw/source.py
index 8b52ceeae..9a85ae51e 100644
--- a/bilby/gw/source.py
+++ b/bilby/gw/source.py
@@ -383,8 +383,10 @@ def _base_lal_cbc_fd_waveform(
     h_cross = np.zeros_like(frequency_array, dtype=np.complex)
 
     if len(hplus.data.data) > len(frequency_array):
-        # lalsim waveform arrays can be padded with zeros up to
-        # a power of two length which can be greater than our length.
+        logger.debug("LALsim waveform longer than bilby's `frequency_array`" +
+                    "({} vs {}), ".format(len(hplus.data.data), len(frequency_array)) +
+                    "probably because padded with zeros up to the next power of two length." +
+                    " Truncating lalsim array.")
         h_plus = hplus.data.data[:len(h_plus)]
         h_cross = hcross.data.data[:len(h_cross)]
 
-- 
GitLab