Exemplo n.º 1
0
    def walsh_image(self,
                    walsh,
                    name,
                    delay=1,
                    measurements=1,
                    averaging_delay=0):
        '''
		TO DO: implement variant and duty cycle stuff
		'''
        data = structure.image_data(walsh, name)
        ppt = projector.PPT(walsh)
        ppt.start_pres()
        ppt.first_slide()
        time.sleep(5)

        for x in range(0, walsh.size):
            ppt.show_slide(x + 2)
            time.sleep(delay)
            measurement_list = []
            for y in range(0, measurements):
                measurement_list.append(
                    self.zva.get_network(name='measurement_' + str(y) +
                                         '.s1p'))
                time.sleep(averaging_delay)
            data.add_primary_data(decoder.mask2hex(walsh.primary_masks[x]),
                                  measurement_list)

        projector.kill_pptx()

        return data
Exemplo n.º 2
0
Arquivo: cai.py Projeto: mbe9a/caik
	def hadamard_image(self, hadamard, name, delay = 1, measurements = 1, averaging_delay = 0, duty_cycle = False):
		#take_data = True, duty_cycle = False, cal = None, averaging = True, caching = True, f = '634ghz', attr = 's_db'
		'''
		TO DO: implement modifiable duty_cyce
		NOTE: might have to change order of slides for variant = 'both' --> currently: all primary then all inverse
		future possibly: primary inverse primary inverse primary etc...
		'''
		data = structure.image_data(hadamard, name)

		#if take_data:
		ppt = projector.PPT(hadamard)
		ppt.start_pres()
		time.sleep(5)

		start_time = 0
		elapsed_time = 0

		#take primary data
		if hadamard.variant == 'primary' or hadmard.variant == 'both':
			for x in range (0, hadamard.size):
				start_time = time.time()
				ppt.show_slide(x + 2)
				time.sleep(delay)
				measurement_list = []
				for y in range (0, measurements):
					measurement_list.append(self.zva.get_network(name = 'measurement_' + str(y) + '.s1p'))
					time.sleep(averaging_delay)
				data.add_primary_data(decoder.mask2hex(hadamard.primary_masks[x]), measurement_list)
				elapsed_time = time.time() - start_time
				if duty_cycle:
					ppt.first_slide()
					time.sleep(elapsed_time)

		#take inverse data
		if hadamard.variant == 'inverse' or hadamard.variant == 'both':
			for x in range (0, hadamard.size):
				start_time = time.time()
				ppt.show_slide(hadamard.size + x + 2)
				time.sleep(delay)
				measurement_list = []
				for y in range (0, measurements):
					measurement_list.append(self.zva.get_network(name = 'measurement_' + str(y) + '.s1p'))
					time.sleep(averaging_delay)
				data.add_inverse_data(decoder.mask2hex(hadamard.inverse_masks[x]), measurement_list)
				elapsed_time = time.time() - start_time
				if duty_cycle:
					ppt.first_slide()
					time.sleep(elapsed_time)

		projector.kill_pptx()

		'''
		TO DO: implement variant options in decoder
		'''
		return data
Exemplo n.º 3
0
Arquivo: cai.py Projeto: mbe9a/caik
	def walsh_image(self, walsh, name, delay = 1, measurements = 1, averaging_delay = 0):
		'''
		TO DO: implement variant and duty cycle stuff
		'''
		data = structure.image_data(walsh, name)
		ppt = projector.PPT(walsh)
		ppt.start_pres()
		ppt.first_slide()
		time.sleep(5)

		for x in range (0, walsh.size):
			ppt.show_slide(x + 2)
			time.sleep(delay)
			measurement_list = []
			for y in range (0, measurements):
				measurement_list.append(self.zva.get_network(name = 'measurement_' + str(y) + '.s1p'))
				time.sleep(averaging_delay)
			data.add_primary_data(decoder.mask2hex(walsh.primary_masks[x]), measurement_list)

		projector.kill_pptx()

		return data
Exemplo n.º 4
0
    def hadamard_image(self,
                       hadamard,
                       name,
                       delay=1,
                       measurements=1,
                       averaging_delay=0,
                       duty_cycle=False):
        #take_data = True, duty_cycle = False, cal = None, averaging = True, caching = True, f = '634ghz', attr = 's_db'
        '''
		TO DO: implement modifiable duty_cyce
		NOTE: might have to change order of slides for variant = 'both' --> currently: all primary then all inverse
		future possibly: primary inverse primary inverse primary etc...
		'''
        data = structure.image_data(hadamard, name)

        #if take_data:
        ppt = projector.PPT(hadamard)
        ppt.start_pres()
        time.sleep(5)

        start_time = 0
        elapsed_time = 0

        #take primary data
        if hadamard.variant == 'primary' or hadmard.variant == 'both':
            for x in range(0, hadamard.size):
                start_time = time.time()
                ppt.show_slide(x + 2)
                time.sleep(delay)
                measurement_list = []
                for y in range(0, measurements):
                    measurement_list.append(
                        self.zva.get_network(name='measurement_' + str(y) +
                                             '.s1p'))
                    time.sleep(averaging_delay)
                data.add_primary_data(
                    decoder.mask2hex(hadamard.primary_masks[x]),
                    measurement_list)
                elapsed_time = time.time() - start_time
                if duty_cycle:
                    ppt.first_slide()
                    time.sleep(elapsed_time)

        #take inverse data
        if hadamard.variant == 'inverse' or hadamard.variant == 'both':
            for x in range(0, hadamard.size):
                start_time = time.time()
                ppt.show_slide(hadamard.size + x + 2)
                time.sleep(delay)
                measurement_list = []
                for y in range(0, measurements):
                    measurement_list.append(
                        self.zva.get_network(name='measurement_' + str(y) +
                                             '.s1p'))
                    time.sleep(averaging_delay)
                data.add_inverse_data(
                    decoder.mask2hex(hadamard.inverse_masks[x]),
                    measurement_list)
                elapsed_time = time.time() - start_time
                if duty_cycle:
                    ppt.first_slide()
                    time.sleep(elapsed_time)

        projector.kill_pptx()
        '''
		TO DO: implement variant options in decoder
		'''
        return data