Beispiel #1
0
    def run_new_pzscan(self, **kw):
        enable_autosave = kw.pop('enable_autosave',True)
        self.reinitialize()
        self.ui.label_status_display.setText("<font style='color: red;'>SCANNING PIEZOs</font>")
        self._scan_mngr.set_scan_params (v_min=self._scan_mngr.minV_pzscan, v_max=self._scan_mngr.maxV_pzscan, nr_points=self._scan_mngr.nr_steps_pzscan)
        self._scan_mngr.initialize_piezos(wait_time=1)

        #self._scan_mngr.sync_delays_ms = np.ones(self._scan_mngr.nr_avg_scans)*sync_delay_ms

        self._scan_mngr.piezo_scan ()
        self.ui.label_status_display.setText("<font style='color: red;'>idle</font>")
        if self._scan_mngr.success:
            self.ui.plot_canvas.update_plot (x = self._scan_mngr.v_vals, y=self._scan_mngr.data[0], x_axis = 'piezo voltage [V]', 
                        y_axis = 'photodiode signal (a.u.)', color = 'RoyalBlue')
            self._scan_mngr.saveX_values = self._scan_mngr.v_vals
            self._scan_mngr.saveY_values = self._scan_mngr.PD_signal
            self._scan_mngr.save_tstamps_ms = self._scan_mngr.tstamps_ms                  
            self._scan_mngr.saveX_label = 'piezo_voltage'
            self._scan_mngr.saveY_label = 'PD_signal'
            self._scan_mngr.save_scan_type = 'msync'
            self._scan_mngr.curr_task = 'piezo_scan'
        else:        
            msg_text = 'Cannot Sync to Montana signal!'
            ex = MsgBox(msg_text = msg_text)
            ex.show()
            self._scan_mngr.curr_task = None
      
        if self._scan_mngr.autosave and enable_autosave:
            self.save()
        if self._scan_mngr.autostop:
            self._running_task = None
            self._exp_mngr.set_piezo_voltage (V = self._exp_mngr._fine_piezos)

        return self._scan_mngr.success
Beispiel #2
0
    def start_scan (self):

        if (self._exp_mngr.room_T == None and self._exp_mngr.low_T == None):
            msg_text = 'Set temperature before moving PiezoKnobs!'
            ex = MsgBox(msg_text=msg_text)
            ex.show()
        else:            
            if self.settings_correct():
                print 'Settings correct!'
                self.initialize_arrays()
                self._curr_row = 0
                self._curr_col = 0
                self._scan_step = +1
                self._curr_task = 'scan'
            else:
                print 'Check settings!'
Beispiel #3
0
    def move_pzk(self):
        """function to move the piezoknobs.
        """
        a = self._moc.status()
        if (self._exp_mngr.room_T == None and self._exp_mngr.low_T == None):
            msg_text = 'Set temperature before moving PiezoKnobs!'
            ex = MsgBox(msg_text=msg_text)
            ex.show()
        elif (a[:5]=='ERROR'): #SvD: this error handling should perhaps be done in the JPE_CADM instrument itself
            msg_text = 'JPE controller is OFF or in manual mode!'
            ex = MsgBox(msg_text=msg_text)
            ex.show()
        else:
            print 'Current JPE position: ', self._moc.print_current_position(), self._moc.print_tracker_params()
            s1, s2, s3 = self._moc.motion_to_spindle_steps (x=self.pzk_X/1000., y=self.pzk_Y/1000., z=self.pzk_Z/1000., update_tracker=False)

            msg_text = 'Moving the spindles by ['+str(s1)+' , '+str(s2)+' , '+str(s3)+' ] steps. Continue?'
            ex = MsgBox(msg_text=msg_text)
            ex.show()
            print ex.ret
            if (ex.ret==0):
                self._moc.move_spindle_steps (s1=s1, s2=s2, s3=s3, x=self.pzk_X/1000., y=self.pzk_Y/1000., z=self.pzk_Z/1000.)
                self.ui.label_curr_pos_readout.setText('[ '+str(self.pzk_X)+' ,'+str(self.pzk_Y)+' ,'+str(self.pzk_Z)+'] um')
                self._exp_mngr.update_coarse_piezos (x = self.pzk_X, y = self.pzk_Y, z = self.pzk_Z)
Beispiel #4
0
    def __init__(self, exp_mngr, parent=None):

        self._moc = exp_mngr._moc
        self._wm = exp_mngr._wm_adwin
        self._laser = exp_mngr._laser
        self._exp_mngr = exp_mngr
        QtGui.QWidget.__init__(self, parent)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        #self.setWindowTitle("Laser-Piezo Scan Interface")
        self.ui = Ui_Form()
        self.ui.setupUi(self)

        self.p1_V = 0
        self.p2_V = 0
        self.p3_V = 0
        self._exp_mngr.update_fine_piezos (0)
        self.piezo_locked = False
        self.pzk_X = self._moc.get_track_curr_x()*1000
        self.pzk_Y = self._moc.get_track_curr_y()*1000
        self.pzk_Z = self._moc.get_track_curr_z()*1000
        self.use_wm = False
        self._exp_mngr.room_T = None
        self._exp_mngr.low_T = None        
        self.ui.label_curr_pos_readout.setText('[ '+str(self.pzk_X)+' ,'+str(self.pzk_Y)+' ,'+str(self.pzk_Z)+'] um')
        self._exp_mngr.update_coarse_piezos (x=self.pzk_X, y=self.pzk_Y, z=self.pzk_Z)
        #Set all parameters and connect all events to actions
        # LASER
        self.ui.dSBox_coarse_lambda.setRange (635.00, 640.00)
        self.ui.dSBox_coarse_lambda.setSingleStep (0.01)
        self.ui.dSBox_coarse_lambda.setValue(637.0)
        self.ui.dSBox_coarse_lambda.valueChanged.connect(self.set_laser_coarse)
        self.ui.dsBox_fine_laser_tuning.setDecimals(1)
        self.ui.dsB_power.setRange (0.0, 15.0)
        self.ui.dsB_power.setSingleStep(0.1)     
        self.ui.dsB_power.setValue(0)   
        self.ui.dsB_power.valueChanged.connect(self.set_laser_power)
        self.ui.dsBox_fine_laser_tuning.setRange (0, 100)
        self.ui.dsBox_fine_laser_tuning.setDecimals(2)
        self.ui.dsBox_fine_laser_tuning.setSingleStep(0.01)
        self.ui.dsBox_fine_laser_tuning.setValue(50)
        self.ui.dsBox_fine_laser_tuning.valueChanged.connect(self.set_fine_laser_tuning)
        self.set_laser_coarse(637.0)
        #self.set_laser_power(0)
        self.set_fine_laser_tuning(50)

        # FINE PIEZOS
        self.ui.doubleSpinBox_p1.setRange (-2, 10)
        self.ui.doubleSpinBox_p1.setDecimals (3)        
        self.ui.doubleSpinBox_p1.setSingleStep (0.001)
        self.ui.doubleSpinBox_p1.setValue(self.p1_V)
        self.ui.doubleSpinBox_p1.valueChanged.connect(self.set_dsb_p1)
        self.ui.horizontalSlider_p1.setRange (0, 10000)
        self.ui.horizontalSlider_p1.setSingleStep (1)        
        self.ui.horizontalSlider_p1.valueChanged.connect(self.set_hsl_p1)
        self.set_dsb_p1 (self.p1_V)
        
        # PiezoKnobs
        self.ui.spinBox_X.setRange (-999, 999)
        self.ui.spinBox_X.setValue(self.pzk_X)
        self.ui.spinBox_X.valueChanged.connect(self.set_pzk_X)
        self.ui.spinBox_Y.setRange (-999, 999)
        self.ui.spinBox_Y.setValue(self.pzk_Y)
        self.ui.spinBox_Y.valueChanged.connect(self.set_pzk_Y)
        self.ui.spinBox_Z.setRange (-999, 999)
        self.ui.spinBox_Z.setValue(self.pzk_Z)
        self.ui.spinBox_Z.valueChanged.connect(self.set_pzk_Z)
        self.ui.pushButton_activate.clicked.connect (self.move_pzk)
        self.ui.pushButton_set_as_origin.clicked.connect (self.pzk_set_as_origin)

        #Temperature
        self.ui.radioButton_roomT.toggled.connect (self.room_T_button)
        self.ui.radioButton_lowT.toggled.connect (self.low_T_button)

        #Wavemeter
        self.ui.checkBox_wavemeter.stateChanged.connect (self.use_wavemeter)
        self._exp_mngr._system_updated = True
        self.refresh_time = 100

        timer = QtCore.QTimer(self)
        timer.timeout.connect(self.update)
        timer.start(self.refresh_time)

        a = self._moc.status()
        if (a[:5]=='ERROR'):
            msg_text = 'JPE controller is OFF or in manual mode!'
            ex = MsgBox(msg_text=msg_text)
            ex.show()