def get_core_offsets(r,snap_names=['snapshot_adc0'],cores=4): set_spi_register(r,0,0x05+0x80,0) #use counter set_test_mode(r, 0) sync_adc(r,zdok_0=True,zdok_1=True) test_vec = np.array(get_test_vector(r, snap_names)) s = test_vec[:,0] if np.any(s==255): # Lazy way to make sure we aren't looking at a wrapping section of the counter s = test_vec[100] offset = np.min(s) - s #these are the relative arrival times. i.e. -1 means arrival is one clock too soon return offset
def get_core_offsets(r, snap_names=['snapshot_adc0'], cores=4): set_spi_register(r, 0, 0x05 + 0x80, 0) #use counter set_test_mode(r, 0) sync_adc(r, zdok_0=True, zdok_1=True) test_vec = np.array(get_test_vector(r, snap_names)) s = test_vec[:, 0] if np.any( s == 255 ): # Lazy way to make sure we aren't looking at a wrapping section of the counter s = test_vec[100] offset = np.min( s ) - s #these are the relative arrival times. i.e. -1 means arrival is one clock too soon return offset
def use_counter_test(r,zdok): set_spi_register(r,zdok,0x05+0x80,0)
def use_strobe_test(r,zdok): set_spi_register(r,zdok,0x05+0x80,1)
def use_counter_test(r, zdok): set_spi_register(r, zdok, 0x05 + 0x80, 0)
def use_strobe_test(r, zdok): set_spi_register(r, zdok, 0x05 + 0x80, 1)