コード例 #1
0
ファイル: sweep_fringe.py プロジェクト: peteshadbolt/lab_code
def take_fringe(reck_heaters, heater_index, min_voltage, max_voltage, N,
                int_time, metadata):

    global output_file
    output_file = ctx(
        'C:/Users/Qubit/Code/lab_code/Calibration/Calibration/data/',
        metadata=metadata)
    output_file_name = output_file.filename
    parameter_space = np.linspace(min_voltage, max_voltage, N)

    # Connect to the counting gear and configure it
    counter = coincidence_counter(callback=handle_data)
    counter.set_integration_time(int_time)

    for index, parameter in enumerate(parameter_space):
        print 'Setting voltage %s' % str(parameter)
        reck_heaters.send_one_voltage(heater_index, parameter)

        current_context = reck_heaters.dict()
        counter.count(context=current_context)

    # Collect and log the last piece of data from the postprocessor
    counter.collect()
    # Close connections to hardware
    counter.kill()

    return output_file_name
コード例 #2
0
ファイル: sweep_fringe.py プロジェクト: peteshadbolt/lab_code
def take_fringe(reck_heaters, heater_index, min_voltage, max_voltage, N, int_time, metadata):
	
	global output_file
	output_file = ctx('C:/Users/Qubit/Code/lab_code/Calibration/Calibration/data/', metadata=metadata)	
	output_file_name = output_file.filename
	parameter_space=np.linspace(min_voltage, max_voltage, N)
	
	# Connect to the counting gear and configure it
	counter=coincidence_counter(callback=handle_data)
	counter.set_integration_time(int_time)

	for index, parameter in enumerate(parameter_space):
		print 'Setting voltage %s' % str(parameter)
		reck_heaters.send_one_voltage(heater_index, parameter)
		
		current_context=reck_heaters.dict()
		counter.count(context=current_context)
		
	# Collect and log the last piece of data from the postprocessor
	counter.collect()
	# Close connections to hardware
	counter.kill()
	
	return output_file_name
コード例 #3
0
ファイル: dip_example.py プロジェクト: peteshadbolt/lab_code
    # START HERE
    #####################################################

    # Get a file ready to store data
    metadata = {"label": "This is a test!", "mood": "hungry for knowledge"}
    output_file = ctx("C:/Users/Qubit/Desktop/data_from_example_scripts/", metadata=metadata)

    # Dip parameters
    parameter_space = np.linspace(0, 10, 11)
    which_motor = 3

    # Connect to the motor controllers
    motor_controller = smc100(callback=None)

    # Connect to the counting gear and configure it
    counter = coincidence_counter(callback=handle_data)
    counter.set_integration_time(1)

    # Loop over a dip
    for position in parameter_space:
        print "Moving to position %.3f" % position
        motor_controller.actuators[which_motor].move(position)
        current_context = motor_controller.dict()
        counter.count(context=current_context)

    # Collect and log the last piece of data from the postprocessor
    counter.collect()

    # Close connections to hardware
    counter.kill()
    motor_controller.kill()
コード例 #4
0
    parameter_space = np.linspace(0, 10, 11)
    which_motor = 3

    # Get a file ready to store data
    md = {'label': 'This is a test!', 'mood': 'hungry for knowledge'}
    output_file = ctx('C:/Users/Qubit/Desktop/data_from_example_scripts/',
                      metadata=md)

    # Make the GUI
    interface = gui()

    # Connect to the motor controllers
    motor_controller = smc100(callback=None)

    # Connect to the counting gear and configure it
    counter = coincidence_counter(callback=handle_data)
    counter.set_integration_time(1)

    # Loop over a dip
    for position in parameter_space:
        print 'Moving to position %.3f' % position
        motor_controller.actuators[which_motor].move(position)
        current_context = motor_controller.dict()
        counter.count(context=current_context)

    # Collect and log the last piece of data from the postprocessor
    counter.collect()

    # Close connections to hardware and GUI
    counter.kill()
    motor_controller.kill()