from labscript import start, stop, AnalogOut, DigitalOut from labscriptlib.ybclock.connection_table import define_connection_table from labscriptlib.ybclock.subsequences import * from labscript_utils.unitconversions import * from labscriptlib.ybclock.classes import * if __name__ == '__main__': define_connection_table() define_classes() # Begin issuing labscript primitives # start() elicits the commencement of the shot start() set_default_values() ms = 1e-3 us = 1e-6 kHz = 1e3 t = 200 * ms #calibration for i in range(1): t += exp_cavity.scan(t, label=f'empty_cavity') set_default_values(t + 1 * ms) stop(t + 1000 * ms) print("Compiled test_empty_cavity_scan!")
The problem is when compiling multiple shots, each time you do 'from connection_table import *` it won't run each of the device/channel declaration functions again, and so you would need to reset each compiler instance if you wanted to run another shot. With the function call format, it allows you to run the device/channel declaration everytime you compile, as desired. ''' define_hardware_cards() define_channels() #the labscript compiler spits out time markers defined in the main sequence. #this is to add text that should have been included in the main labscript #compiler. print("Time Markers:") if __name__ == '__main__': define_connection_table() # Begin issuing labscript primitives # start() elicits the commencement of the shot start() # Stop the experiment shot with stop() stop(1.0)
from labscript import * from labscript_devices.DummyPseudoclock.labscript_devices import DummyPseudoclock MOCK = False # labscript_init('test.h5', new=True, overwrite=True) from labscript_devices.ZaberStageController.labscript_devices import ( ZaberStage, ZaberStageController, ) from labscript import start, stop DummyPseudoclock() ZaberStageController('controller', com_port='COM1', mock=MOCK) ZaberStage('stage', controller, 'device 1', limits=(0, 30000)) start() stage.constant(30000) stop(1)
MOT_y_Bias_Prep=MOT_y_Bias_0, MOT_x_z_Bias_Prep=MOT_x_z_Bias_0, MOT_x_mz_Bias_Prep=MOT_x_mz_Bias_0, MOT_Quad_Prep=0, D2_Lock_Freq_Prep=D2_Lock_Freq_MOT, D2_Repump_Default_Shift_Prep=D2_Repump_Default_Shift) # # TOF! t += TOF_Time # Image! D2_Repump_DO.go_high(t) D2_Cooling_DO.go_high(t) D2_Repump_AO.constant(t, D2_Repump_Volts) D2_Cooling_AO.constant(t, D2_Cooling_Volts) MOT_x.expose(t, 'fluorescence', frametype='bright', trigger_duration=MOT_Fl_Exposure) t += 1 * ms # # Set Dafault state # SetDefaults(t) # Stop the experiment shot with stop() t += 10 * ms ls.stop(t)
# We then initiate an IMAQdxCamera using this RemoteBLACS instance # using mock=True to bypass any attempts to commmunicate with an # actual camera, and generate fake data at the end of the shot IMAQdxCamera( name='camera', parent_device=camera_trigger, connection='trigger', serial_number=0xDEADBEEF, worker=test_remote, mock=True, ) # Begin issuing labscript primitives # A timing variable t is used for convenience # start() elicits the commencement of the shot t = 0 add_time_marker(t, "Start", verbose=True) start() t += 1 add_time_marker(t, "Exposure: 'before' image", verbose=True) camera.expose(t, name='comparison', frametype='before', trigger_duration=0.2) t += 0.5 add_time_marker(t, "Exposure: 'after' image", verbose=True) camera.expose(t, name='comparison', frametype='after', trigger_duration=0.2) t += 0.5 stop(t)
from labscript import start, stop from labscriptlib.ybclock.connection_table import define_connection_table if __name__ == '__main__': define_connection_table() # Begin issuing labscript primitives # start() elicits the commencement of the shot start() # # simple expose methods test: success! for x in range(1, 4): wide_angle_cam.expose(t=x * 0.1, name=f'wide_test_pic_{x}', trigger_duration=0.03) isometric_cam.expose(t=x * 0.1, name=f'iso_test_pic_{x}', trigger_duration=0.03) # print(wide_angle_cam_trigger) # wide_angle_cam_trigger.go_high_analog(t=0.0001) # wide_angle_cam_trigger.go_low_analog(t=0.1) # wide_angle_cam_trigger.trigger(t=0.1, duration=0.1) stop(0.5)
# hardware instructions are executed on the hardware) will not be the same # as the wait instruction may take anywhere from 0 to "timeout" seconds, # and this number is only determined during execution time. t += 1 # Do something 1s after the wait! switch.go_high(t=t) # Examples programming in different units as specified in the # unitconversion classes passed as parameters to the channel definition analog0.constant(t=t, value=5, units='A') analog1.constant(t=t, value=1000, units='mGauss') dds3.setfreq(t=t, value=50, units='detuned_MHz') dds3.setamp(t=t, value=1.9, units='W') # Hold values for 2 seconds t += 2 analog0.ramp(t=t, duration=1, initial=5, final=7, samplerate=rate, units='Gauss') analog1.constant(t=t, value=3e6, units='uA') dds3.setfreq(t=t, value=60, units='detuned_MHz') dds3.setamp(t=t, value=500, units='mW') # Hold values for 2 seconds t += 2 # Stop at t=15 seconds, note that because of the wait timeout, this might # be as late as 17s (Plus a little bit of retriggering time) in execution # time stop(t=t)
from labscriptlib.ybclock.classes import * if __name__ == '__main__': define_connection_table() define_classes() # Begin issuing labscript primitives # start() elicits the commencement of the shot start() t = 0 t += 1 add_time_marker(t, label='Turn On') blue.mot.intensity.turnon(t, value=3) t += 1 add_time_marker(t, label='Turn Off') blue.mot.intensity.turnoff(t, warmup_value=1) t += 1 add_time_marker(t, label='Ramp') blue.mot.intensity.ramp(t=t, duration=0.5, initial=1, final=2, samplerate=1e3) stop(t + 1)
t += exp_cavity.scan(t, label='atoms_in_cavity', params={'unitary': RF.get_unitary()}) t += wait(10*ms) # add_time_marker(t, "Empty then Scan") t += empty_then_measure_cavity_frequency(t) ### take background mot image def take_background_green_mot_image(t): ms = 1e-3 trigger_duration = 20*ms green.mot.intensity.constant(t,value=0.12) isometric_cam.expose(t, name='green_mot', frametype='bg', trigger_duration=trigger_duration) return trigger_duration t += take_background_green_mot_image(t) ### Turn on mot again. t += mot_coil_current.ramp(t, duration=10*ms, initial=0, final=9.1, samplerate=10*kHz ) set_default_values(t) # Stop the experiment shot with stop() stop(t+0.1) print("Compiled loading_sequence!")
define_connection_table() define_classes() # Begin issuing labscript primitives # start() elicits the commencement of the shot start() set_default_values() ms = 1e-3 kHz = 1e3 t = 10*ms #load the atoms t += blue_mot(t, duration= 3000*ms, take_picture=True) t += transfer_blue_mot_to_green_mot(t, duration= 40*ms, samplerate=1*kHz) t += cool_atoms_in_green_mot(t, duration= 180*ms, samplerate=1*kHz) t += position_atoms_to_optical_lattice(t, duration= 40*ms, samplerate=1*kHz) #take a picture of the atoms add_time_marker(t+20*ms, "Take Picture of Green MOT", verbose=True) isometric_cam.expose(t + 20*ms, name='green_mot', frametype='signal', trigger_duration=20*ms) t += hold_atoms(t, duration= 40*ms) # Stop the experiment shot with stop() set_default_values(t+75*ms) stop(t+150*ms) print("Compiled loading_sequence!")
IMAQdxCamera(name='Mako2', parent_device=MOT_Camera_Trigger, connection='trigger', trigger_edge_type='rising', orientation = 'Mako2', serial_number=0xF315D2ACE, camera_attributes=Mako_camera_imaqdx_attributes, manual_mode_camera_attributes=Mako_manual_mode_imaqdx_attributes, stop_acquisition_timeout=10, exception_on_failed_shot=False) #'MOT_???' camera IMAQdxCamera(name='Mako3', parent_device=MOT_Camera_Trigger, connection='trigger', trigger_edge_type='rising', orientation = 'Mako3', serial_number=0xF315D2ACF, camera_attributes=Mako_camera_imaqdx_attributes, manual_mode_camera_attributes=Mako_manual_mode_imaqdx_attributes, stop_acquisition_timeout=10, exception_on_failed_shot=False) if __name__ == '__main__': # Begin issuing labscript primitives # start() elicits the commencement of the shot ls.start() # Stop the experiment shot with stop() ls.stop(1.0)
p7888_flushing_channel.disable(t) t += dt / 2 def send_photons(): ''' Turns on the green pumping light. ''' #set green power green_pumping_light.enable(t=0.0001) pump_aom_power.constant(t=0.0001, value=10) #scan green frequency pass def diagnostics(): pass if __name__ == '__main__': define_connection_table() # Begin issuing labscript primitives # start() elicits the commencement of the shot start() send_photons() repeat_p7888_start_triggers(ti=5.1, tf=10, dt=0.001) send_fake_photons(ti=5.1, tf=10, dt=0.0001) stop(11)