diff --git a/tools/plot_antenna_params.py b/tools/plot_antenna_params.py index 053d4a51..2f4ad993 100644 --- a/tools/plot_antenna_params.py +++ b/tools/plot_antenna_params.py @@ -101,15 +101,19 @@ def calculate_antenna_params(filename, tltxnumber=1, tlrxnumber=None, rxnumber=N delaycorrection = np.exp(1j * 2 * np.pi * freqs * (dt / 2)) # Calculate s11 and (optionally) s21 - s11 = np.abs(np.fft.fft(Vref) / np.fft.fft(Vinc)) + with np.errstate(divide='ignore'): + s11 = np.abs(np.fft.fft(Vref) / np.fft.fft(Vinc)) if tlrxnumber or rxnumber: - s21 = np.abs(np.fft.fft(Vrec) / np.fft.fft(Vinc)) + with np.errstate(divide='ignore'): + s21 = np.abs(np.fft.fft(Vrec) / np.fft.fft(Vinc)) # Calculate input impedance - zin = (np.fft.fft(Vtotal) * delaycorrection) / np.fft.fft(Itotal) + with np.errstate(divide='ignore'): + zin = (np.fft.fft(Vtotal) * delaycorrection) / np.fft.fft(Itotal) # Calculate input admittance - yin = np.fft.fft(Itotal) / (np.fft.fft(Vtotal) * delaycorrection) + with np.errstate(divide='ignore'): + yin = np.fft.fft(Itotal) / (np.fft.fft(Vtotal) * delaycorrection) # Convert to decibels (ignore warning from taking a log of any zero values) with np.errstate(divide='ignore'):