Skip to content

Commit

Permalink
Changed method of generating times in ToO mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tventers committed Feb 6, 2024
1 parent a3ec2b5 commit 0f0d655
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/nuspacesim/simulation/geometry/region_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,18 +478,19 @@ def throw(self, times=None) -> None:

def generate_times(self, times) -> np.ndarray:
"""
Function to generate random times within the simulation time period
Function to generate times within the simulation time period
"""
if isinstance(times, int):
times = np.random.rand(times)
# times = np.random.rand(times)
times = np.arange(0.0, 1.0, 1.0 / times)

if times is None:
raise RuntimeError(
"Provide a number of trajectories, or a 2D set of uniform random "
"numbers in [0, 1]"
)

times = np.sort(times)
# times = np.sort(times)
times *= self.sourceOBSTime # in s
times = TimeDelta(times, format="sec")
times = self.too_source.eventtime + times
Expand Down

0 comments on commit 0f0d655

Please sign in to comment.