def __init__(self, hardware, parameters, parent = None): # STORM1 specific focus lock parameters. lock_params = parameters.addSubSection("focuslock") lock_params.add("qpd_zcenter", params.ParameterRangeFloat("Piezo center position in microns", "qpd_zcenter", 30.0, 0.0, 100.0)) lock_params.add("qpd_scale", params.ParameterRangeFloat("Offset to nm calibration value", "qpd_scale", 3200.0, 0.1, 6000.0)) lock_params.add("qpd_sum_min", 50.0) lock_params.add("qpd_sum_max", 1500.0) lock_params.add("is_locked_buffer_length", 10) lock_params.add("is_locked_offset_thresh", 0.01) # STORM1 Initialization. qpd = phreshQPD.PhreshQPDPRISM2() stage = mclController.MCLStage("c:/Program Files/Mad City Labs/NanoDrive/") lock_fn = lambda (x): -1.75 * x control_thread = stageOffsetControl.StageQPDThread(qpd, stage, lock_fn, parameters.get("focuslock.qpd_sum_min", 50.0), parameters.get("focuslock.qpd_zcenter"), parameters.get("focuslock.is_locked_buffer_length", 10), parameters.get("focuslock.is_locked_offset_thresh", 0.01)) ir_laser = LDC210.LDC210("PCIe-6321", 1) focusLockZ.FocusLockZQPD.__init__(self, parameters, control_thread, ir_laser, parent)
def __init__(self, hardware, parameters, parent = None): lock_fn = lambda(x): 0.05*x # The numpy fitting routine is apparently not thread safe. fit_mutex = QtCore.QMutex() # Lower objective camera and piezo. cam1 = uc480Cam.CameraQPD300(camera_id = 2, fit_mutex = fit_mutex) stage1 = mclController.MCLStage("c:/Program Files/Mad City Labs/NanoDrive/", serial_number = 2636) control_thread1 = stageOffsetControl.StageCamThread(cam1, stage1, lock_fn, 50.0, parameters.get("qpd_zcenter")) # Upper objective camera and piezo. cam2 = uc480Cam.CameraQPD300(camera_id = 3, fit_mutex = fit_mutex) stage2 = mclController.MCLStage("c:/Program Files/Mad City Labs/NanoDrive/", serial_number = 2637) control_thread2 = stageOffsetControl.StageCamThread(cam2, stage2, lock_fn, 50.0, parameters.get("qpd_zcenter")) ir_laser = LDC210.LDC210PWMLJ() focusLockZ.FocusLockZDualCam.__init__(self, parameters, [control_thread1, control_thread2], [ir_laser, False], parent)
def __init__(self, hardware, parameters, parent=None): qpd = phreshQPD.PhreshQPDPRISM2() stage = mclController.MCLStage("c:/Program Files/NanoDrive/") lock_fn = lambda (x): -1.75 * x control_thread = stageOffsetControl.StageQPDThread( qpd, stage, lock_fn, 50.0, parameters.qpd_zcenter) ir_laser = LDC210.LDC210("PCIe-6321", 1) focusLockZ.FocusLockZQPD.__init__(self, parameters, control_thread, ir_laser, parent)
def __init__(self, hardware, parameters, parent=None): cam = uc480Cam.CameraQPD300(camera_id=1) stage = mclController.MCLStage( "c:/Program Files/Mad City Labs/NanoDrive/") lock_fn = lambda (x): 0.3 * x control_thread = stageOffsetControl.StageCamThread( cam, stage, lock_fn, 50.0, parameters.get("qpd_zcenter")) #ir_laser = LDC210.LDC210("PCI-6722", 1) ir_laser = LDC210.LDC210PWMNI("PCI-MIO-16E-4", 0) focusLockZ.FocusLockZCam.__init__(self, parameters, control_thread, ir_laser, parent)
def __init__(self, hardware, parameters, parent=None): # Scope1 specific focus lock parameters lock_params = parameters.addSubSection("focuslock") lock_params.add("qpd_zcenter", params.ParameterRangeFloat( "Piezo center position in microns", "qpd_zcenter", 150.0, 0.0, 300.0)) # range of z-piezo lock_params.add("qpd_scale", params.ParameterRangeFloat( "Offset to nm calibration value", "qpd_scale", 1.0, 0.1, 1000.0)) # 50, 0.1 to 1000 lock_params.add("qpd_sum_min", 50.0) lock_params.add("qpd_sum_max", 256.0) lock_params.add("is_locked_buffer_length", 3) lock_params.add("is_locked_offset_thresh", 1) lock_params.add( "ir_power", params.ParameterInt("", "ir_power", 6, is_mutable=False)) offset_file = "cam_offsets_scope1.txt" cam = uc480Cam.CameraQPD( camera_id=0, x_width=180, y_width= 200, # x_width = 680, y_width = 200, 5/31/17 x_width = 540, y_width = 150 / 1280 x 1040 sigma=4.0, offset_file=offset_file) # sigma = 4.0 stage = MCLVZC.MCLVZControl("USB-6002", 0) # stage = noneWidgets.NanoP() # use this to bypass the stage lock_fn = lambda (x): -0.02 * x control_thread = stageOffsetControl.StageCamThread( cam, stage, lock_fn, parameters.get("focuslock.qpd_sum_min", 50.0), parameters.get("focuslock.qpd_zcenter"), #add a 0 parameters.get("focuslock.is_locked_buffer_length", 3), parameters.get("focuslock.is_locked_offset_thresh", 1)) ir_laser = LDC210.LDC210PWMNI( "PCIe-6353", 1 ) # Inputs here are (DAQ-card name, counter number). (was 0, switched to 1 and changed wiring 8/11/16) focusLockZ.FocusLockZCam.__init__(self, parameters, control_thread, ir_laser, parent) print 'focus lock started'
def __init__(self, hardware, parameters, parent=None): #cam = uc480Cam.CameraQPD752(camera_id = 1) cam = uc480Cam.CameraQPD(camera_id=1, x_width=752, y_width=80, offset_file="cam_offsets_storm2_1.txt") stage = MCLVZC.MCLVZControl("USB-6002", 0) lock_fn = lambda (x): 0.07 * x control_thread = stageOffsetControl.StageCamThread( cam, stage, lock_fn, parameters.get("focuslock.qpd_sum_min", 50.0), parameters.get("focuslock.qpd_zcenter"), parameters.get("focuslock.is_locked_buffer_length", 10), parameters.get("focuslock.is_locked_offset_thresh", 0.01)) ir_laser = LDC210.LDC210PWMNI("PCI-6601", 0) focusLockZ.FocusLockZCam.__init__(self, parameters, control_thread, ir_laser, parent)
def __init__(self, hardware, parameters, parent=None): qpd = phreshQPD.PhreshQPDSTORM2() stage = zstage.QPriorZ() # lock_fn = lambda (x): -1.75 * x lock_fn = lambda (x): x control_thread = stageOffsetControl.StageQPDThread( qpd, stage, lock_fn, 50.0, parameters.get("qpd_zcenter"), parameters.get("is_locked_buffer_length", 10), parameters.get("is_locked_offset_thresh", 0.01), slow_stage=True) ir_laser = LDC210.LDC210("PCIe-6259", 8) focusLockZ.FocusLockZQPD.__init__(self, parameters, control_thread, ir_laser, parent)
def __init__(self, hardware, parameters, parent = None): cam = uc480Cam.CameraQPD(camera_id = 1, x_width = 300, y_width = 50, background = 15250) stage = mclController.MCLStage("c:/Program Files/Mad City Labs/NanoDrive/") lock_fn = lambda (x): 0.09 * x control_thread = stageOffsetControl.StageCamThread(cam, stage, lock_fn, parameters.get("focuslock.qpd_sum_min", 50.0), parameters.get("focuslock.qpd_zcenter"), parameters.get("focuslock.is_locked_buffer_length", 3), parameters.get("focuslock.is_locked_offset_thresh", 1)) ir_laser = LDC210.LDC210PWMLJ() focusLockZ.FocusLockZCam.__init__(self, parameters, control_thread, ir_laser, parent)
def __init__(self, hardware, parameters, parent = None): qpd = phreshQPD.PhreshQPDPRISM2() stage = mclController.MCLStage("c:/Program Files/Mad City Labs/NanoDrive/") lock_fn = lambda (x): -1.75 * x control_thread = stageOffsetControl.StageQPDThread(qpd, stage, lock_fn, parameters.get("focuslock.qpd_sum_min", 50.0), parameters.get("focuslock.qpd_zcenter"), parameters.get("focuslock.is_locked_buffer_length", 10), parameters.get("focuslock.is_locked_offset_thresh", 0.01)) ir_laser = LDC210.LDC210("PCIe-6321", 1) focusLockZ.FocusLockZQPD.__init__(self, parameters, control_thread, ir_laser, parent)
def __init__(self, hardware, parameters, parent=None): cam = uc480Cam.CameraQPD(camera_id=1, x_width=200, y_width=50, offset_file="cam_offsets_storm3_1.txt") stage = mclController.MCLStage( "c:/Program Files/Mad City Labs/NanoDrive/") lock_fn = lambda (x): -0.02 * x control_thread = stageOffsetControl.StageCamThread( cam, stage, lock_fn, parameters.get("focuslock.qpd_sum_min", 50.0), parameters.get("focuslock.qpd_zcenter"), parameters.get("focuslock.is_locked_buffer_length", 10), parameters.get("focuslock.is_locked_offset_thresh", 0.01)) #ir_laser = LDC210.LDC210("PCI-6722", 1) ir_laser = LDC210.LDC210PWMNI("PCI-MIO-16E-4", 0) focusLockZ.FocusLockZCam.__init__(self, parameters, control_thread, ir_laser, parent)
def __init__(self, hardware, parameters, parent=None): offset_file = "cam_offsets_storm5.txt" cam = uc480Cam.CameraQPD(camera_id=0, x_width=540, y_width=150, sigma=4.0, offset_file=offset_file) stage = MCLVZC.MCLVZControl("cDAQ-9174", 0) lock_fn = lambda (x): 0.02 * x control_thread = stageOffsetControl.StageCamThread( cam, stage, lock_fn, parameters.get("focuslock.qpd_sum_min", 50.0), parameters.get("focuslock.qpd_zcenter"), parameters.get("focuslock.is_locked_buffer_length", 3), parameters.get("focuslock.is_locked_offset_thresh", 1)) ir_laser = LDC210.LDC210PWMNI("PCIe-6353", 0) focusLockZ.FocusLockZCam.__init__(self, parameters, control_thread, ir_laser, parent) print 'focus lock started'
def __init__(self, hardware, parameters, parent=None): # STORM4 specific focus lock parameters lock_params = parameters.addSubSection("focuslock") lock_params.add( "qpd_zcenter", params.ParameterRangeFloat("Piezo center position in microns", "qpd_zcenter", 50.0, 0.0, 100.0)) lock_params.add( "qpd_scale", params.ParameterRangeFloat("Offset to nm calibration value", "qpd_scale", 50.0, 0.1, 1000.0)) lock_params.add("qpd_sum_min", 50.0) lock_params.add("qpd_sum_max", 256.0) lock_params.add("is_locked_buffer_length", 3) lock_params.add("is_locked_offset_thresh", 1) lock_params.add( "ir_power", params.ParameterInt("", "ir_power", 6, is_mutable=False)) # STORM4 Initialization cam = uc480Cam.CameraQPD(camera_id=1, x_width=300, y_width=50, offset_file="cam_offsets_storm4_1.txt", background=15250) stage = mclController.MCLStage( "c:/Program Files/Mad City Labs/NanoDrive/") lock_fn = lambda (x): 0.09 * x control_thread = stageOffsetControl.StageCamThread( cam, stage, lock_fn, parameters.get("focuslock.qpd_sum_min", 50.0), parameters.get("focuslock.qpd_zcenter"), parameters.get("focuslock.is_locked_buffer_length", 3), parameters.get("focuslock.is_locked_offset_thresh", 1)) ir_laser = LDC210.LDC210PWMLJ() focusLockZ.FocusLockZCam.__init__(self, parameters, control_thread, ir_laser, parent)
def __init__(self, hardware, parameters, parent=None): # STORM3 specific focus lock parameters lock_params = parameters.addSubSection("focuslock") lock_params.add( "qpd_zcenter", params.ParameterRangeFloat("Piezo center position in microns", "qpd_zcenter", 100.0, 0.0, 200.0)) lock_params.add( "qpd_scale", params.ParameterRangeFloat("Offset to nm calibration value", "qpd_scale", -700.0, 0.1, 1000.0)) lock_params.add("qpd_sum_min", 50.0) lock_params.add("qpd_sum_max", 100000.0) lock_params.add("is_locked_buffer_length", 3) lock_params.add("is_locked_offset_thresh", 0.1) lock_params.add( "ir_power", params.ParameterInt("", "ir_power", 6, is_mutable=False)) # Create camera cam = uc480Cam.CameraQPD(camera_id=1, x_width=1000, y_width=70, sigma=4.0, offset_file="cam_offsets_jfocal_1.txt", background=125000) stage = MCLVZC.MCLVZControl("PCIe-6351", 0, scale=10.0 / 200.0) lock_fn = lambda (x): 0.1 * x control_thread = stageOffsetControl.StageCamThread( cam, stage, lock_fn, parameters.get("focuslock.qpd_sum_min", 50.0), parameters.get("focuslock.qpd_zcenter"), parameters.get("focuslock.is_locked_buffer_length", 3), parameters.get("focuslock.is_locked_offset_thresh", 0.1)) ir_laser = LDC210.LDC210PWMNI("PCIe-6351", 0) focusLockZ.FocusLockZCam.__init__(self, parameters, control_thread, ir_laser, parent)
def __init__(self, hardware, parameters, parent=None): # STORM2 specific focus lock parameters. lock_params = parameters.addSubSection("focuslock") lock_params.add( "qpd_zcenter", params.ParameterRangeFloat("Piezo center position in microns", "qpd_zcenter", 125.0, 0.0, 250.0)) lock_params.add( "qpd_scale", params.ParameterRangeFloat("Offset to nm calibration value", "qpd_scale", 45.0, 0.1, 1000.0)) lock_params.add("qpd_sum_min", 50.0) lock_params.add("qpd_sum_max", 256.0) lock_params.add("is_locked_buffer_length", 10) lock_params.add("is_locked_offset_thresh", 0.01) lock_params.add( "ir_power", params.ParameterInt("", "ir_power", 6, is_mutable=False)) # STORM2 Initialization. cam = uc480Cam.CameraQPD(camera_id=1, x_width=452, y_width=80, offset_file="cam_offsets_storm2_1.txt") stage = MCLVZC.MCLVZControl("USB-6002", 0) lock_fn = lambda (x): 0.07 * x control_thread = stageOffsetControl.StageCamThread( cam, stage, lock_fn, parameters.get("focuslock.qpd_sum_min", 50.0), parameters.get("focuslock.qpd_zcenter"), parameters.get("focuslock.is_locked_buffer_length", 10), parameters.get("focuslock.is_locked_offset_thresh", 0.01)) ir_laser = LDC210.LDC210PWMNI("PCI-6601", 0) focusLockZ.FocusLockZCam.__init__(self, parameters, control_thread, ir_laser, parent)
# ir laser control import sc_hardware.thorlabs.LDC210 as LDC210 # focus lock dialog. import focuslock.focusLockZ as focusLockZ # # Focus Lock Dialog Box specialized for STORM4 with # USB offset detector and MCL objective Z positioner. # import sc_hardware.nationalInstruments.nicontrol as nicontrol names = nicontrol.getDAQBoardInfo() print names ni_task = nicontrol.AnalogOutput("USB-6002", 0) ir_laser = LDC210.LDC210PWMNI("PCIe-6353", 0) #stage = MCLVZC.MCLVZControl("cDAQ-9174", 0) class AFocusLockZ(focusLockZ.FocusLockZCam): def __init__(self, hardware, parameters, parent=None): offset_file = "cam_offsets_storm5.txt" cam = uc480Cam.CameraQPD(camera_id=0, x_width=540, y_width=150, sigma=4.0, offset_file=offset_file) stage = MCLVZC.MCLVZControl("cDAQ-9174", 0) lock_fn = lambda (x): 0.02 * x control_thread = stageOffsetControl.StageCamThread(
def __init__(self, hardware, parameters, parent=None): # Jfocal specific focus lock parameters lock_params = parameters.addSubSection("focuslock") lock_params.add( "qpd_zcenter", params.ParameterRangeFloat("Piezo center position in microns", "qpd_zcenter", 100.0, 0.0, 200.0)) lock_params.add( "qpd_scale", params.ParameterRangeFloat("Offset to nm calibration value", "qpd_scale", -1000.0, -10000, 10000.0)) lock_params.add("qpd_sum_min", 50.0) lock_params.add("qpd_sum_max", 100000.0) lock_params.add( "is_locked_buffer_length", params.ParameterRangeInt("Length of in focus buffer", "is_locked_buffer_length", 3, 1, 100)) lock_params.add( "is_locked_offset_thresh", params.ParameterRangeFloat( "Offset distance still considered in focus", "is_locked_offset_thresh", 1, 0.001, 1000)) lock_params.add( "focus_rate", params.ParameterRangeFloat("Proportionality constant for focus", "focus_rate", 0.1, -1000, 1000)) lock_params.add( "ir_power", params.ParameterInt("", "ir_power", 6, is_mutable=False)) # Add parameters for hardware timed z offsets lock_params.add( "z_offsets", params.ParameterString( "Comma separated list of offset positions per frame", "z_offsets", "")) # Create camera cam = uc480Cam.CameraQPD(camera_id=1, x_width=900, y_width=50, sigma=4.0, offset_file="cam_offsets_jfocal_1.txt", background=50000) stage = MCLVZC.MCLVZControl("PCIe-6351", 0, scale=10.0 / 200.0, trigger_source="PFI0") lock_fn = lambda (x): lock_params.get("focus_rate") * x control_thread = stageOffsetControl.StageCamThread( cam, stage, lock_fn, parameters.get("focuslock.qpd_sum_min", 50.0), parameters.get("focuslock.qpd_zcenter"), parameters.get("focuslock.is_locked_buffer_length", 3), parameters.get("focuslock.is_locked_offset_thresh", 0.1)) ir_laser = LDC210.LDC210PWMNI("PCIe-6351", 0) focusLockZ.FocusLockZCam.__init__(self, parameters, control_thread, ir_laser, parent)