ttl_clock module
- class TTLClock
TTLClock class is used for counting the number of TTL pulses and the time of the last TTL pulse
- get_time()
returns the current time of the clock :Returns: time (float) – the current time of the clock
- reset(start_time=0)
resets the clock and ttl-counter :param start_time: the time in seconds to start the clock from :type start_time: float
- update()
updates the ttl count and time of the last ttl pulse
- wait_for_first_ttl(wait=True)
This function waits for the first TTL and then resets the clock appropriately :param wait: if True, the function will wait for the first TTL :type wait: bool
- wait_until(time)
waits until the given time since the beginning of the run :param time: time in seconds :type time: float
- Returns:
real_time (float) – time that the real start occurs
start_ttl (int) – Number of TRs recorded since the beginning of the run
start_ttl_time (float) – Time since the last TR