From 5c4b5ccf7efdc8f6d165363249ac5ab3d36ac86c Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Tue, 7 Jun 2016 13:11:52 +0100 Subject: [PATCH] Corrected print statement for time to centre of pulse. --- tools/plot_builtin_wave.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/plot_builtin_wave.py b/tools/plot_builtin_wave.py index 98ede289..a7b0ebc4 100644 --- a/tools/plot_builtin_wave.py +++ b/tools/plot_builtin_wave.py @@ -83,7 +83,13 @@ def mpl_plot(w, timewindow, dt, iterations, fft=False): print('Type: {}'.format(w.type)) print('Amplitude: {:g}'.format(w.amp)) print('Centre frequency: {:g} Hz'.format(w.freq)) - print('Time to centre of pulse: {:g} s'.format(1 / w.freq)) + + if w.type == 'gaussian' or w.type == 'gaussiandot' or w.type == 'gaussiandotdot': + delay = 1 / w.freq + print('Time to centre of pulse: {:g} s'.format(delay)) + elif w.type == 'gaussiandotnorm' or w.type == 'gaussiandotdotnorm' or w.type == 'ricker': + delay = np.sqrt(2) / w.freq + print('Time to centre of pulse: {:g} s'.format(delay)) # Calculate pulse width for gaussian if w.type == 'gaussian':