def program(progname='adc5g_test.bof'): """ Program the roach2 with the standard program. After this, calibrate() should be called """ roach2.progdev(progname) adc5g.set_spi_control(roach2, zdok)
def set_ogp(fname = 'ogp'): """ Clear the control register and then load the offset, gain and phase registers for each core. These values are hard coded for now. """ adc5g.set_spi_control(roach2, zdok) t = np.genfromtxt(fname) set_offs(t[0], t[3], t[6], t[9]) set_gains(t[1], t[4], t[7], t[10]) set_phase(t[2], t[5], t[8], t[11])
def set_ogp(fname='ogp'): """ Clear the control register and then load the offset, gain and phase registers for each core. These values are hard coded for now. """ adc5g.set_spi_control(roach2, zdok) t = np.genfromtxt(fname) set_offs(t[0], t[3], t[6], t[9]) set_gains(t[1], t[4], t[7], t[10]) set_phase(t[2], t[5], t[8], t[11])
def dotest(plotcore = 1): """ Put the adc in test mode and get a sample of the test vector. Plot core 1 by default. """ global snap_name adc5g.set_spi_control(roach2, zdok, test=1) cores = (corea, corec, coreb, cored) = adc5g.get_test_vector(roach2, [snap_name,]) if plotcore == 2: plotcore = 3 elif plotcore == 3: plotcore = 2 plt.plot(cores[plotcore]) adc5g.set_spi_control(roach2, zdok)
def set_ogp(fname=None): """ Clear the control register and then load the offset, gain and phase registers for each core. These values are hard coded for now. fname defaults to the standard ogp name in /instance/configFiles on the roach. """ global ogp_name if fname == None: fname = ogp_name adc5g.set_spi_control(roach2, zdok) t = np.genfromtxt(fname) set_offs(t[0], t[3], t[6], t[9]) set_gains(t[1], t[4], t[7], t[10]) set_phase(t[2], t[5], t[8], t[11])
def set_ogp(fname = None): """ Clear the control register and then load the offset, gain and phase registers for each core. These values are hard coded for now. fname defaults to the standard ogp name in /instance/configFiles on the roach. """ global ogp_name if fname == None: fname = ogp_name adc5g.set_spi_control(roach2, zdok) t = np.genfromtxt(fname) set_offs(t[0], t[3], t[6], t[9]) set_gains(t[1], t[4], t[7], t[10]) set_phase(t[2], t[5], t[8], t[11])
def program(): """ Program the roach2 with the standard program. After this, calibrate() should be called """ global prog_name, roach2, samp_freq roach2.progdev(prog_name) adc5g.set_spi_control(roach2, zdok) if prog_name[:8] == 'sma_corr': print "this is correlator code" roach2.write_int('source_ctrl', 18) roach2.write_int('scope_ctrl', 1536) samp_freq = 2288. numpoints = 32768 set_zdok(zdok)
def program(): """ Program the roach2 with the standard program. After this, calibrate() should be called """ global prog_name, roach2, samp_freq roach2.progdev(prog_name) adc5g.set_spi_control(roach2, zdok) if prog_name[:10] != 'adc5g_test': # print "set up for correlator code" roach2.write_int('source_ctrl', 18) roach2.write_int('scope_ctrl', 1536) samp_freq = 2288. numpoints = 32768 set_zdok(zdok)
def dotest(plotcore=1): """ Put the adc in test mode and get a sample of the test vector. Plot core 1 by default. """ global snap_name adc5g.set_spi_control(roach2, zdok, test=1) cores = (corea, corec, coreb, cored) = adc5g.get_test_vector(roach2, [ snap_name, ]) if plotcore == 2: plotcore = 3 elif plotcore == 3: plotcore = 2 plt.plot(cores[plotcore]) adc5g.set_spi_control(roach2, zdok)