def __init__(self,roach=None,wafer=0,roachip='roach',adc_valon=None): """ Class to represent the heterodyne readout system (high-frequency (1.5 GHz), IQ mixers) roach: an FpgaClient instance for communicating with the ROACH. If not specified, will try to instantiate one connected to *roachip* wafer: 0 Not used for heterodyne system roachip: (optional). Network address of the ROACH if you don't want to provide an FpgaClient adc_valon: a Valon class, a string, or None Provide access to the Valon class which controls the Valon synthesizer which provides the ADC and DAC sampling clock. The default None value will use the valon.find_valon function to locate a synthesizer and create a Valon class for you. You can alternatively pass a string such as '/dev/ttyUSB0' to specify the port for the synthesizer, which will then be used for creating a Valon class. Finally, for test suites, you can directly pass a Valon class or a class with the same interface. """ if roach: self.r = roach else: from corr.katcp_wrapper import FpgaClient self.r = FpgaClient(roachip) t1 = time.time() timeout = 10 while not self.r.is_connected(): if (time.time()-t1) > timeout: raise Exception("Connection timeout to roach") time.sleep(0.1) if adc_valon is None: import valon ports = valon.find_valons() if len(ports) == 0: raise Exception("No Valon found!") self.adc_valon_port = ports[0] self.adc_valon = valon.Synthesizer(ports[0]) #use latest port elif type(adc_valon) is str: import valon self.adc_valon_port = adc_valon self.adc_valon = valon.Synthesizer(self.adc_valon_port) else: self.adc_valon = adc_valon self.adc_atten = -1 self.dac_atten = -1 self.bof_pid = None self.roachip = roachip self.fs = self.adc_valon.get_frequency_a() self.wafer = wafer self.dac_ns = 2**16 # number of samples in the dac buffer self.raw_adc_ns = 2**12 # number of samples in the raw ADC buffer self.nfft = 2**14 self.boffile = 'iq2xpfb14mcr4_2013_Aug_02_1446.bof' self.bufname = 'ppout%d' % wafer
def __init__(self,roach=None,roachip='roach',adc_valon = None): """ Class to represent the heterodyne readout system (high frequency, 1.5 GHz, with IQ mixers) roach: an FpgaClient instance for communicating with the ROACH. If not specified, will try to instantiate one connected to *roachip* roachip: (optional). Network address of the ROACH if you don't want to provide an FpgaClient """ if roach: self.r = roach else: from corr.katcp_wrapper import FpgaClient self.r = FpgaClient(roachip) t1 = time.time() timeout = 10 while not self.r.is_connected(): if (time.time()-t1) > timeout: raise Exception("Connection timeout to roach") time.sleep(0.1) if adc_valon is None: import valon ports = valon.find_valons() if len(ports) == 0: raise Exception("No Valon found!") self.adc_valon_port = ports[0] self.adc_valon = valon.Synthesizer(ports[0]) #use latest port elif type(adc_valon) is str: import valon self.adc_valon_port = adc_valon self.adc_valon = valon.Synthesizer(self.adc_valon_port) else: self.adc_valon = adc_valon self.fs = self.adc_valon.get_frequency_a() self.dac_ns = 2**16 # number of samples in the dac buffer self.raw_adc_ns = 2**11 # number of samples in the raw ADC buffer self.nfft = 2**14 self.boffile = 'iqx2fft14dac14r1_2013_Jun_24_1921.bof'