FloatingPointError: divide by zero encountered in log10
WARNING: Numerical dispersion analysis not carried out as either no waveform detected or waveform does not fit within specified time window and is therefore being truncated.C:\Users\fcss\Documents\gprMax>grep -R log10 *build/lib.win-amd64-3.5/gprMax/grid.py: power = 10 * np.log10(np.abs(np.fft.fft(waveformvalues))**2)build/lib.win-amd64-3.5/tests/test_models.py: datadiffs[:, i] = 20 * np.log10(datadiffs[:, i]) # Ignore any zero division in log10build/lib.win-amd64-3.5/tools/plot_antenna_params.py: Vincp = 20 * np.log10(np.abs((np.fft.fft(Vinc) * delaycorrection)))build/lib.win-amd64-3.5/tools/plot_antenna_params.py: Iincp = 20 * np.log10(np.abs(np.fft.fft(Iinc)))build/lib.win-amd64-3.5/tools/plot_antenna_params.py: Vrefp = 20 * np.log10(np.abs((np.fft.fft(Vref) * delaycorrection)))build/lib.win-amd64-3.5/tools/plot_antenna_params.py: Irefp = 20 * np.log10(np.abs(np.fft.fft(Iref)))build/lib.win-amd64-3.5/tools/plot_antenna_params.py: Vtotalp = 20 * np.log10(np.abs((np.fft.fft(Vtotal) * delaycorrection)))build/lib.win-amd64-3.5/tools/plot_antenna_params.py: Itotalp = 20 * np.log10(np.abs(np.fft.fft(Itotal)))build/lib.win-amd64-3.5/tools/plot_antenna_params.py: s11 = 20 * np.log10(s11)build/lib.win-amd64-3.5/tools/plot_antenna_params.py: s21 = 20 * np.log10(s21)build/lib.win-amd64-3.5/tools/plot_Ascan.py: power = 10 * np.log10(np.abs(np.fft.fft(outputdata))**2)build/lib.win-amd64-3.5/tools/plot_source_wave.py: start = np.where((10 * np.log10(waveform / np.amax(waveform))) > powerdrop)[0][0]build/lib.win-amd64-3.5/tools/plot_source_wave.py: stop = np.where((10 * np.log10(waveform[start:] / np.amax(waveform))) < powerdrop)[0][0] + startbuild/lib.win-amd64-3.5/tools/plot_source_wave.py: power = 10 * np.log10(np.abs(np.fft.fft(waveform))**2)build/lib.win-amd64-3.5/user_libs/antenna_patterns/plot_fields.py: ax.plot(theta, 10 * np.log10(pattplot), label='{:.2f}m'.format(radii[patt]), marker='.', ms=6, lw=1.5)build/lib.win-amd64-3.5/user_libs/antenna_patterns/plot_fields.py:# ax.plot(theta, 10 * np.log10(hertzplot1), label='Inf. dipole, 0.1m', color='black', ls='-.', lw=3)build/lib.win-amd64-3.5/user_libs/antenna_patterns/plot_fields.py:# ax.plot(theta, 10 * np.log10(hertzplot2), label='Inf. dipole, 0.58m', color='black', ls='--', lw=3)build/lib.win-amd64-3.5/user_libs/optimisation_taguchi/fitness_functions.py: tmp = 20 * np.log10(np.abs(modelresp - refresp) / np.amax(np.abs(refresp)))gprMax/grid.py: power = 10 * np.log10(np.abs(np.fft.fft(waveformvalues))**2)Binary file gprMax/__pycache__/grid.cpython-35.pyc matchestests/test_models.py: datadiffs[:, i] = 20 * np.log10(datadiffs[:, i]) # Ignore any zero division in log10tools/plot_antenna_params.py: Vincp = 20 * np.log10(np.abs((np.fft.fft(Vinc) * delaycorrection)))tools/plot_antenna_params.py: Iincp = 20 * np.log10(np.abs(np.fft.fft(Iinc)))tools/plot_antenna_params.py: Vrefp = 20 * np.log10(np.abs((np.fft.fft(Vref) * delaycorrection)))tools/plot_antenna_params.py: Irefp = 20 * np.log10(np.abs(np.fft.fft(Iref)))tools/plot_antenna_params.py: Vtotalp = 20 * np.log10(np.abs((np.fft.fft(Vtotal) * delaycorrection)))tools/plot_antenna_params.py: Itotalp = 20 * np.log10(np.abs(np.fft.fft(Itotal)))tools/plot_antenna_params.py: s11 = 20 * np.log10(s11)tools/plot_antenna_params.py: s21 = 20 * np.log10(s21)tools/plot_Ascan.py: power = 10 * np.log10(np.abs(np.fft.fft(outputdata))**2)tools/plot_source_wave.py: start = np.where((10 * np.log10(waveform / np.amax(waveform))) > powerdrop)[0][0]tools/plot_source_wave.py: stop = np.where((10 * np.log10(waveform[start:] / np.amax(waveform))) < powerdrop)[0][0] + starttools/plot_source_wave.py: power = 10 * np.log10(np.abs(np.fft.fft(waveform))**2)Binary file tools/__pycache__/plot_Ascan.cpython-35.pyc matchesuser_libs/antenna_patterns/plot_fields.py: ax.plot(theta, 10 * np.log10(pattplot), label='{:.2f}m'.format(radii[patt]), marker='.', ms=6, lw=1.5)user_libs/antenna_patterns/plot_fields.py:# ax.plot(theta, 10 * np.log10(hertzplot1), label='Inf. dipole, 0.1m', color='black', ls='-.', lw=3)user_libs/antenna_patterns/plot_fields.py:# ax.plot(theta, 10 * np.log10(hertzplot2), label='Inf. dipole, 0.58m', color='black', ls='--', lw=3)user_libs/optimisation_taguchi/fitness_functions.py: tmp = 20 * np.log10(np.abs(modelresp - refresp) / np.amax(np.abs(refresp)))user_models/sd.exe:extern __declspec(__host__) __declspec(__device__) __declspec(__device_builtin__) double __cdecl log10(double x) ;user_models/sd.exe:extern __declspec(__host__) __declspec(__device__) __declspec(__device_builtin__) float __cdecl log10f(float) ;user_models/sd.exe: double __cdecl log10( double _X);user_models/sd.exe: float __cdecl log10f( float _X);user_models/sd.exe: __inline long double __cdecl log10l( long double _X)user_models/sd.exe: return log10((double)_X);user_models/sd.exe: inline float log10( float _Xx) noexceptuser_models/sd.exe: return (:: log10f(_Xx));user_models/sd.exe: inline long double log10( long double _Xx) noexceptuser_models/sd.exe: return (:: log10l(_Xx));user_models/sd.exe:extern "C" double __cdecl log10( double); template<class _Ty> inline typename ::std:: enable_if< ::std:: is_integral<_Ty>::value, double>::type log10(_Ty _Left) { return (:: log10((double)_Left)); }user_models/sd.exe:using :: log10; using :: modf; using :: pow;user_models/sd.exe:using :: log10f; using :: modff; using :: powf;user_models/sd.exe:using :: log10l; using :: modfl; using :: powl;user_models/sd.exe:extern __declspec(__host__) __declspec(__device__) __declspec(__cudart_builtin__) float __cdecl log10(float) throw();user_models/sd.exe:__declspec(__device__) __declspec(__cudart_builtin__) __declspec(__device_builtin__) __declspec(__cudart_builtin__) float __log10f(float x) ;user_models/sd.exe:__declspec(__device__) complex<float> log10(const complex<float>&);user_models/sd.exe:__declspec(__device__) complex<double> log10(const complex<double>&);
The log10 evaluated on zero error you are experiencing comes from the dispersion analysis function (in the grid.py module if you are interested). The function is there to help guide users as to whether their model will likely suffer from the effects of numerical dispersion. I have put in a fix for the issue to catch the case when there is a zero from the FFT. Anyway if you update gprMax (pull from GitHub) the error should now be fixed.
Kind regards,
Craig