Example #1
0
def get_phase():
    """
  Get and print the delays for the four cores of the ADC.
  """
    for i in range(1, 5):
        print "%.3f " % adc5g.get_spi_phase(roach2, zdok, i),
    print
Example #2
0
def get_phase():
  """
  Get and print the delays for the four cores of the ADC.
  """
  for i in range(1,5):
    print "%.3f " % adc5g.get_spi_phase(roach2,zdok,i),
  print
Example #3
0
def phase_curve():
  f= 28/255.
  ofd = open('phasecurve', 'w')
  p = {}
  for i in range(1,5):
     p[i] = adc5g.get_spi_phase(roach2,zdok,i)
  for i in range(-10,11):
    set_phase(p[1]+ f*i,p[2] -f*i,p[3],p[4])
    ogp, gar = dosnap(rpt=5, plot=False)
    print >>ofd, "%.3f %.3f %.3f" % (f*i, ogp[5], ogp[8])
  set_phase(p[1],p[2],p[3],p[4])
Example #4
0
def phase_curve():
    f = 28 / 255.
    ofd = open('phasecurve', 'w')
    p = {}
    for i in range(1, 5):
        p[i] = adc5g.get_spi_phase(roach2, zdok, i)
    for i in range(-10, 11):
        set_phase(p[1] + f * i, p[2] - f * i, p[3], p[4])
        ogp, gar = dosnap(rpt=5, plot=False)
        print >> ofd, "%.3f %.3f %.3f" % (f * i, ogp[5], ogp[8])
    set_phase(p[1], p[2], p[3], p[4])
Example #5
0
File: spec.py Project: jkyl/xhorn
 def get_ogp(self):
     '''
     Returns the OGP matrix (4 rows of 3 values). 
     '''
     ogp = np.zeros((12), dtype='float')
     indx = 0
     for chan in range(1,5):
         ogp[indx] = adc.get_spi_offset(self._roach, 0, chan)
         indx += 1
         ogp[indx] = adc.get_spi_gain(self._roach, 0, chan)
         indx += 1
         ogp[indx] = adc.get_spi_phase(self._roach, 0, chan)
         indx += 1
     return ogp.reshape(4, 3)
Example #6
0
def get_ogp_array():
  """
  Read  the Offset, Gain and Phase corrections for each core from the ADC
  and return in a 1D array
  """
  ogp = np.zeros((12), dtype='float')
  indx = 0
  for chan in range(1,5):
    ogp[indx] = adc5g.get_spi_offset(roach2,zdok,chan)
    indx += 1
    ogp[indx] = adc5g.get_spi_gain(roach2,zdok,chan)
    indx += 1
    ogp[indx] = adc5g.get_spi_phase(roach2,zdok,chan)
    indx += 1
  return ogp
Example #7
0
def get_ogp_array():
    """
  Read  the Offset, Gain and Phase corrections for each core from the ADC
  and return in a 1D array
  """
    ogp = np.zeros((12), dtype='float')
    indx = 0
    for chan in range(1, 5):
        ogp[indx] = adc5g.get_spi_offset(roach2, zdok, chan)
        indx += 1
        ogp[indx] = adc5g.get_spi_gain(roach2, zdok, chan)
        indx += 1
        ogp[indx] = adc5g.get_spi_phase(roach2, zdok, chan)
        indx += 1
    return ogp
Example #8
0
    def calibrate_adc_phase(self, zdok=0, piter=0, ptol=1.0, verbose=10):
        """
		Attempt to match the core phases within the ADC.
		
		See ArtooDaq.calibrate_adc_ogp for more details.
		"""
        # phase controlled by float varying over [-14,14] ps with 0.11 ps resolution
        res_phase = 0.11
        lim_phase = [-14.0, 14.0]
        if verbose > 3:
            print "  Phase calibration ZDOK{0}:".format(zdok)
        core_phases = zeros(4)
        for ic in xrange(1, 5):
            core_phases[ic - 1] = adc5g.get_spi_phase(self.roach2, zdok, ic)
        if verbose > 5:
            print "    ...phase: tuning not implemented yet, phase parameters are [{0}]".format(
                ", ".join(["{0:+06.2f}".format(icp) for icp in core_phases]))
        return core_phases
Example #9
0
	def calibrate_adc_phase(self,zdok=0,piter=0,ptol=1.0,verbose=10):
		"""
		Attempt to match the core phases within the ADC.
		
		See ArtooDaq.calibrate_adc_ogp for more details.
		"""
		# phase controlled by float varying over [-14,14] ps with 0.11 ps resolution
		res_phase = 0.11
		lim_phase = [-14.0,14.0]
		if verbose > 3:
			print "  Phase calibration ZDOK{0}:".format(zdok)
		core_phases = zeros(4)
		for ic in xrange(1,5):
			core_phases[ic-1] = adc5g.get_spi_phase(self.roach2,zdok,ic)
		if verbose > 5:
			print "    ...phase: tuning not implemented yet, phase parameters are [{0}]".format(
				", ".join(["{0:+06.2f}".format(icp) for icp in core_phases])
			)
		return core_phases
Example #10
0
    def get_ogp_chan(self, chan):
        """
	   Returns ogp values for a channel 'chan'
	"""

        ogp_chan = []

        zdok, cores = self.get_channel_core_spi(chan)

        for core in cores:

            off = adc5g.get_spi_offset(self.roach, zdok, core)
            gain = adc5g.get_spi_gain(self.roach, zdok, core)
            phase = adc5g.get_spi_phase(self.roach, zdok, core)
            ogp_core = [off, gain, phase]

            ogp_chan.append(ogp_core)

        return ogp_chan
Example #11
0
    def get_ogp_chan(self, chan):

        """
	   Returns ogp values for a channel 'chan'
	"""

        ogp_chan = []
    
        zdok, cores = self.get_channel_core_spi(chan)

        for core in cores:

            off = adc5g.get_spi_offset(self.roach, zdok, core) 
            gain = adc5g.get_spi_gain(self.roach, zdok, core)
            phase = adc5g.get_spi_phase(self.roach, zdok, core)
            ogp_core = [off, gain, phase]

            ogp_chan.append(ogp_core)

        return ogp_chan