From ff5a120e0c980a61e0f2d2052486555d5cc5ee4a Mon Sep 17 00:00:00 2001 From: Anirban Date: Thu, 21 Sep 2023 16:42:20 -0400 Subject: [PATCH] In gamma ray code : Changed times to np.geomspace (#2415) * Changed times to np.geomspace * Added myself to mailmap --- .mailmap | 2 ++ tardis/energy_input/gamma_ray_transport.py | 10 +--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.mailmap b/.mailmap index c005d9048fe..0baa7c0c71b 100644 --- a/.mailmap +++ b/.mailmap @@ -41,6 +41,8 @@ Atharwa Kharkar atharwa_24 +Anirban Dutta + Barnabás Barna Caroline Sofiatti diff --git a/tardis/energy_input/gamma_ray_transport.py b/tardis/energy_input/gamma_ray_transport.py index 713a5bd209e..e89098e8ca6 100644 --- a/tardis/energy_input/gamma_ray_transport.py +++ b/tardis/energy_input/gamma_ray_transport.py @@ -356,15 +356,7 @@ def main_gamma_ray_loop( ), "Error, simulation start time greater than end time!" if time_space == "log": - times = np.zeros(time_steps + 1) - - # log time steps - for i in range(time_steps + 1): - times[i] = ( - np.log(time_start) - + (np.log(time_end) - np.log(time_start)) / time_steps * i - ) - times[i] = np.exp(times[i]) + times = np.geomspace(time_start, time_end, time_steps + 1) else: times = np.linspace(time_start, time_end, time_steps + 1)