Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In gamma ray code : Changed times to np.geomspace #2415

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Atharwa Kharkar <atharwa.kharkar19@vit.edu> atharwa_24 <atharwa.kharkar19@vit.ed

Atul Kumar <kr.atul.atk@gmail.com>

Anirban Dutta <anirbaniamdutta@gmail.com>

Barnabás Barna <bbarna@titan.physx.u-szeged.hu>

Caroline Sofiatti <c.sofiatti@gmail.com>
Expand Down
10 changes: 1 addition & 9 deletions tardis/energy_input/gamma_ray_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like a good choice (example comment)

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
times = np.geomspace(time_start, time_end, time_steps + 1)
times = np.logspace(time_start, time_end, time_steps + 1, base=np.e)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's better (example comment)

else:
times = np.linspace(time_start, time_end, time_steps + 1)

Expand Down