def generate_discrete_times(station, detector_ids=[0, 2, 3]): """Generates possible arrival times for detectors The times are relative to the first detector, which is assumed to be at t = 0. """ r = station_size(station, detector_ids) max_dt = ceil_in_base(r / C, TIME_RESOLUTION) times = np.arange(-max_dt, max_dt, TIME_RESOLUTION) time_combinations = itertools.product(times, repeat=len(detector_ids) - 1) return time_combinations
def test_integers(self): self.assertEqual(utils.ceil_in_base(3, 4), 4) self.assertEqual(utils.floor_in_base(3, 4), 0) self.assertEqual(utils.round_in_base(3, 4), 4)
def test_ceil(self): self.assertEqual(utils.ceil_in_base(2.4, 2.5), 2.5) self.assertEqual(utils.ceil_in_base(0.1, 2.5), 2.5)