def timeit(): Npols, Nazis = 181, 360 def randCgrid(Npols, Nazis): return np.random.rand(Npols, Nazis) + 1j*np.random.rand(Npols, Nazis) args = [randCgrid(Npols, Nazis) for _ in range(4)] dt_min, dt_avg, dt_max = ETutils.timedcalls(20., func, *args) print('Time function: min {0:.4f} s, average {1:.4f} s and max {2:.4f} s'.format(dt_min, dt_avg, dt_max))
def timeit(): azis = np.linspace(0, 2*np.pi, 360, endpoint = False) pols = np.linspace(0, np.pi, 181) xvec, yvec = ETwaves.principal_polarisation_axes_0Psi(azis, pols) print('Time function: min {0:.4f} s, average {1:.4f} s and max {2:.4f} s'.format(*ETutils.timedcalls(20., func, xvec, yvec)))
def timeit(): azis = np.linspace(0, 2*np.pi, 360, endpoint = False) pols = np.linspace(0, np.pi, 181) print('Time function: min {0:.4f} s, average {1:.4f} s and max {2:.4f} s'.format(*ETutils.timedcalls(10., FUNCTION, azis, pols)))
def timeit(): import ETwaves azis = np.linspace(0, 2*np.pi, 360, endpoint = False) pols = np.linspace(0, np.pi, 181) xvec, yvec = ETwaves.principal_polarisation_axes_0Psi(azis, pols) eplus, ecros = ETwaves.polarisation_tensor_bases(xvec, yvec) detensor = np.random.rand(3,3) print('Time function: min {0:.4f} s, average {1:.4f} s and max {2:.4f} s'.format(*ETutils.timedcalls(20., func, detensor, eplus, ecros)))