Пример #1
0
 def runCalibration(self, powerMeter=None, measureTime=0.1, settleTime=0.005, pCellVoltage=None, rate = 100000):
     daqName = self.getDAQName()[0]
     duration = measureTime + settleTime
     nPts = int(rate * duration)
     
     cmdOff = {'protocol': {'duration': duration, 'timeout': duration+5.0},
             self.name(): {'shutterMode':'closed', 'switchWaveform':np.zeros(nPts, dtype=np.byte)},
             powerMeter: {x: {'record':True, 'recordInit':False} for x in getManager().getDevice(powerMeter).listChannels()},
             daqName: {'numPts': nPts, 'rate':rate}
             }
     
     if self.hasPowerIndicator:
         powerInd = self.config['powerIndicator']['channel']
         cmdOff[powerInd[0]] = {powerInd[1]: {'record':True, 'recordInit':False}}
         
     if pCellVoltage is not None:
         if self.hasPCell:
             a = np.zeros(nPts, dtype=float)
             a[:] = pCellVoltage
             cmdOff[self.name()]['pCell'] = a
         else:
             raise Exception("Laser device %s does not have a pCell, therefore no pCell voltage can be set." %self.name())
         
     cmdOn = cmdOff.copy()
     wave = np.ones(nPts, dtype=np.byte)
     wave[-1] = 0
     shutterDelay = self.config.get('shutter', {}).get('delay', 0)
     wave[:shutterDelay*rate] = 0
     cmdOn[self.name()]={'shutterMode':'open', 'switchWaveform':wave}
     
     #print "cmdOff: ", cmdOff
     taskOff = getManager().createTask(cmdOff)
     taskOff.execute()
     resultOff = taskOff.getResult()
     
     taskOn = getManager().createTask(cmdOn)
     taskOn.execute()
     resultOn = taskOn.getResult()
         
     measurementStart = (shutterDelay+settleTime)*rate
         
     if self.hasPowerIndicator:
         powerOutOn = resultOn[powerInd[0]][0][measurementStart:].mean()
     else:
         powerOutOn, ok = self.outputPower()
         
     laserOff = resultOff[powerMeter][0][measurementStart:]
     laserOn = resultOn[powerMeter][0][measurementStart:]
 
     t, prob = stats.ttest_ind(laserOn.asarray(), laserOff.asarray())
     if prob > 0.001:
         raise Exception("Power meter device %s could not detect laser." %powerMeter)
     else:
         powerSampleOn = laserOn.mean()
         transmission = powerSampleOn/powerOutOn
         return (powerSampleOn, transmission)
Пример #2
0
    def updateList(self):
        ints = self.dir.listInterfaces(self.types)
        self.interfaceMap = []
        objects = set()

        preferred = self.preferredValue()
        current = self.currentText()
        try:
            self.blockSignals(True)
            self.clear()
            man = getManager()
            for typ, intList in ints.iteritems():
                for name in intList:
                    obj = man.getInterface(typ, name)
                    if obj in objects:
                        continue
                    objects.add(obj)
                    self.interfaceMap.append((typ, name))
                    self.addItem(name)
                    if name == preferred:
                        self.setCurrentIndex(self.count() - 1)
        finally:
            self.blockSignals(False)

        if self.currentText() != current:
            self.currentIndexChanged.emit(self.currentIndex())
Пример #3
0
    def updateList(self):        
        ints = self.dir.listInterfaces(self.types)
        self.interfaceMap = []
        objects = set()
        
        try:
            preferred = self.preferredValue()
            current = self.currentText()
        except RuntimeError:
            return # This happens when the combo has been deleted, but we are still receiving signals.

        try:
            self.blockSignals(True)
            self.clear()
            man = getManager()
            for typ,intList in ints.iteritems():
                for name in intList:
                    obj = man.getInterface(typ, name)
                    if obj in objects:
                        continue
                    objects.add(obj)
                    self.interfaceMap.append((typ, name))
                    self.addItem(name)
                    if name == preferred:
                        self.setCurrentIndex(self.count()-1)
        finally:
            self.blockSignals(False)
        
        if self.currentText() != current:
            self.currentIndexChanged.emit(self.currentIndex())
Пример #4
0
 def powerMeterChanged(self):
     powerDev = getManager().getDevice(self.ui.meterCombo.currentText())
     channels = powerDev.listChannels()
     self.ui.channelCombo.clear()
     for k in channels.keys():
         self.ui.channelCombo.addItem(k)
     self.channelChanged()
Пример #5
0
 def testTask(self):
     daqName = self.getDAQName('shutter')
     powerInd = self.config['powerIndicator']['channel']
     rate = self.config['powerIndicator']['rate']
     sTime = self.config['powerIndicator']['settlingTime']
     mTime = self.config['powerIndicator']['measurementTime']
     reps = 10
     dur = 0.1 + reps*0.1+(0.001+0.005)
     nPts = int(dur*rate)
    
     
     
     ### create a waveform that flashes the QSwitch(or other way of turning on) the number specified by reps
     waveform = np.zeros(nPts, dtype=np.byte)
     for i in range(reps):
         waveform[(i+1)/10.*rate:((i+1)/10.+sTime+mTime)*rate] = 1 ## divide i+1 by 10 to increment by hundreds of milliseconds
     
     cmd = {
         'protocol': {'duration': dur},
         self.name(): {'switchWaveform':waveform, 'shutterMode':'closed'},
         powerInd[0]: {powerInd[1]: {'record':True, 'recordInit':False}},
         daqName: {'numPts': nPts, 'rate': rate}
     }
     
     task = getManager().createTask(cmd)
     task.execute()
     result = task.getResult()
     
     print "Got result: ", result
Пример #6
0
 def handleResult(self, result, params):
     if not self.spotMarker.isVisible():
         self.spotMarker.show()
     #print 'ScannerTaskGui.handleResult() result:', result
     if 'position' in result:
         pos = result['position']
         ss = result['spotSize']
         self.spotMarker.setPos((pos[0]-ss*0.5, pos[1]-ss*0.5))
     #print 'handleResult'
     getManager().scanResult=result
Пример #7
0
 def __init__(self, parent=None, types=None):
     self.dir = getManager().interfaceDir
     self.interfaceMap = []
     self.preferred = None
     QtGui.QComboBox.__init__(self, parent)
     #QtCore.QObject.connect(self.dir, QtCore.SIGNAL('interfaceListChanged'), self.updateList)
     self.dir.sigInterfaceListChanged.connect(self.updateList)
     
     if types is not None:
         self.setTypes(types)
Пример #8
0
    def __init__(self, protoDir, parent=None):
        self.protoDir = protoDir
        QtGui.QMainWindow.__init__(self, parent)
        self.ui  =  Ui_MainWindow()
        self.ui.setupUi(self)
        
        self.flowchart = Flowchart()
        self.setCentralWidget(self.flowchart.widget())
        #self.ui.chartDock1.setWidget(self.flowchart.widget())
        self.flowchart.addInput("dataIn")

        self.ui.dataSourceCombo.setTypes(['dataSource'])

        #self.flowchart2 = Flowchart()
        #self.ui.chartDock2.setWidget(self.flowchart2.widget())
        #self.flowchart2.addInput("dataIn")
        
        self.loader = DirTreeLoader(protoDir)
        self.loader.save = self.saveProtocol
        self.loader.new = self.newProtocol
        self.loader.load = self.loadProtocol
        self.ui.loaderDock.setWidget(self.loader)
        
        self.dockItems = {}
        self.data = []   ## Raw data loaded
        self.results = {}  ## Processed output
        
        self.dataSource = None
        
        QtCore.QObject.connect(self.ui.dataSourceCombo, QtCore.SIGNAL("currentIndexChanged(int)"), self.setDataSource)
        QtCore.QObject.connect(self.ui.loadDataBtn, QtCore.SIGNAL("clicked()"), self.loadData)
        QtCore.QObject.connect(self.ui.loadSequenceBtn, QtCore.SIGNAL("clicked()"), self.loadSequence)
        QtCore.QObject.connect(self.ui.loadSessionBtn, QtCore.SIGNAL("clicked()"), self.loadSession)
        QtCore.QObject.connect(self.ui.recompSelectedBtn, QtCore.SIGNAL("clicked()"), self.recomputeSelected)
        QtCore.QObject.connect(self.ui.recompAllBtn, QtCore.SIGNAL("clicked()"), self.recomputeAll)
        QtCore.QObject.connect(self.ui.saveAllBtn, QtCore.SIGNAL("clicked()"), self.saveAll)
        QtCore.QObject.connect(self.ui.addOutputBtn, QtCore.SIGNAL("clicked()"), self.addOutput)
        QtCore.QObject.connect(self.ui.addPlotBtn, QtCore.SIGNAL("clicked()"), self.addPlot)
        QtCore.QObject.connect(self.ui.addCanvasBtn, QtCore.SIGNAL("clicked()"), self.addCanvas)
        QtCore.QObject.connect(self.ui.addTableBtn, QtCore.SIGNAL("clicked()"), self.addTable)
        QtCore.QObject.connect(self.ui.removeDockBtn, QtCore.SIGNAL("clicked()"), self.removeSelected)
        QtCore.QObject.connect(self.ui.dataTree, QtCore.SIGNAL("currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)"), self.dataSelected)

        QtCore.QObject.connect(self.flowchart.outputNode, QtCore.SIGNAL("terminalRenamed"), self.outputRenamed)
        i = 0
        while True:
            name = "Analyzer-%d"%i
            if getManager().declareInterface(name, ['dataSource'], self):
                break
            i += 1
        self.setWindowTitle(name)
        
        
        self.resize(1200,800)
        self.show()
Пример #9
0
    def __init__(self, pr):
        QtGui.QMainWindow.__init__(self)
        mp = os.path.dirname(__file__)
        self.setWindowIcon(QtGui.QIcon(os.path.join(mp, 'icon.png')))
        self.pr = pr

        self.stateFile = os.path.join('modules', self.pr.name + '_ui.cfg')
        uiState = getManager().readConfigFile(self.stateFile)
        if 'geometry' in uiState:
            geom = QtCore.QRect(*uiState['geometry'])
            self.setGeometry(geom)
Пример #10
0
 def loadSession(self):
     fh = open(getManager().currentFile.name())
     state = pickle.load(fh)
     fh.close()
     
     self.restoreProtocol(state['program'])
     self.clearData()
     for d in state['data']:
         self.loadSequence(d)
     
     self.results = state['results']
Пример #11
0
    def setBaseClicked(self):
        dh = self.dataManager.selectedFile()
        if dh is None:
            dh = getManager().getBaseDir()
        if dh is None:
            return
            #logMsg("Cannot set base directory because no directory is selected in Data Manager.", msgType='error')
            #return
        if not dh.isDir():
            dh = dh.parent()

        self.ui.dirTree.setBaseDirHandle(dh)
        self._baseDir = dh
        self.sigBaseChanged.emit(dh)
Пример #12
0
 def channelChanged(self):   
     powerDev = getManager().getDevice(self.ui.meterCombo.currentText())
     channels = powerDev.listChannels()
     text = str(self.ui.channelCombo.currentText())
     if text is not '':
         sTime = channels[text].get('settlingTime', None)
         mTime = channels[text].get('measurementTime', None)
     else:
         return
         
     if sTime is not None:
         self.ui.settlingSpin.setValue(sTime)
     if mTime is not None:
         self.ui.measurementSpin.setValue(mTime)
Пример #13
0
 def loadSequence(self, data=None):
     if data is None:
         data = getManager().currentFile
     item = QtGui.QTreeWidgetItem([data.shortName()])
     item.data = data
     self.ui.dataTree.addTopLevelItem(item)
     self.data.append(data)
     for sub in data.subDirs():
         try:
             int(sub)
         except:
             continue
         subd = data[sub]
         i2 = QtGui.QTreeWidgetItem([sub])
         i2.data = subd
         item.addChild(i2)
Пример #14
0
    def __init__(self, *args):
        AnalysisModule.__init__(self, *args)
        self.ui = Ui_Form()
        self.ui.setupUi(self)
        self.postGuiInit()
        self.man = getManager()
        #self.image=pg.ImageView()
        #self.ui.histogram.setImageItem(self.image)
        #self.ui.histogram.autoHistogramRange()
        #self.ui.plotWidget.addItem(self.image)
        #self.ui.plotWidget.setLabel('bottom', 'Time', 's')
        #self.ui.plotWidget.setLabel('left', 'Distance', 'm')
        #self.ui.plotWidget.register('ImagingPlot')
        self.ui.alphaSlider.valueChanged.connect(self.imageAlphaAdjust)        
        self.img = None  ## image shown in camera module

        self.ui.scannerComboBox.setTypes('scanner')
        self.ui.detectorComboBox.setTypes('daqChannelGroup')
Пример #15
0
 def addImage(self):
     fd = getManager().currentFile
     img = fd.read()
     if 'imagePosition' in fd.info():
         ps = fd.info()['pixelSize']
         pos = fd.info()['imagePosition']
     else:
         info = img.infoCopy()[-1]
         ps = info['pixelSize']
         pos = info['imagePosition']
         
     img = img.view(ndarray)
     if img.ndim == 3:
         img = img.max(axis=0)
     #print pos, ps, img.shape, img.dtype, img.max(), img.min()
     item = ImageItem(img)
     self.canvas.addItem(item, pos, scale=ps, z=self.z, name=fd.shortName())
     self.z += 1
     self.imageItems.append(item)
Пример #16
0
    def _load_data(self, seq_dir):
        self.clear_plot_data()

        man = getManager()
        model = man.dataModel

        # read all image data
        self.img_data = model.buildSequenceArray(
            seq_dir, 
            lambda dh: dh['Camera']['frames.ma'].read()['Time':0:200e-3].asarray(),
            join=True)
        
        first_subdir = seq_dir[seq_dir.ls()[0]]
        first_img = first_subdir['Camera']['frames.ma'].read()['Time':0:200e-3]
        self.img_data._info[2] = first_img._info[0]

        time_vals = self.img_data.xvals('Time')
        time_prof = self.img_data[:, 1].mean(axis=0).mean(axis=1).mean(axis=1)
        self.plot_data.append(self.plt1.plot(time_vals, time_prof))

        self.time_rgn_changed()
Пример #17
0
 def __init__(self, *args):
     AnalysisModule.__init__(self, *args)
     self.ui = Ui_Form()
     self.ui.setupUi(self)
     self.postGuiInit()
     self.man = getManager()
     #devs = self.man.listDevices()
     #for d in devs:
         #self.ui.scannerDevCombo.addItem(d)
         #self.ui.clampDevCombo.addItem(d)
         
     #self.fillModuleList()
     self.ui.scannerDevCombo.setTypes('scanner')
     self.ui.clampDevCombo.setTypes('clamp')
     self.ui.cameraModCombo.setTypes('cameraModule')
     
     
     self.tasks = {}
     self.currentTask = None
     self.ui.deleteBtn.clicked.connect(self.deleteSelected)
     self.stateGroup.sigChanged.connect(self.stateChanged)
     self.ui.taskList.currentItemChanged.connect(self.itemSelected)
     self.ui.taskList.itemClicked.connect(self.itemClicked)
     self.ui.recomputeBtn.clicked.connect(self.recompute)
Пример #18
0
 def load_from_dm_clicked(self):
     man = getManager()
     sel_dir = man.currentFile
     self.ui.set_path(sel_dir)
Пример #19
0
    def __init__(self, dev, taskRunner):
        TaskGui.__init__(self, dev, taskRunner)
        self.ui = Ui_Form()
        self.ui.setupUi(self)
        dm = getManager()
        self.targets = None
        self.items = {}
        self.haveCalibration = True   ## whether there is a calibration for the current combination of laser/optics
        self.currentOpticState = None
        self.currentCamMod = None
        self.displaySize = {}  ## maps (laser,opticState) : display size
                               ## since this setting is remembered for each objective.
        
        # Make sure DQ appears in this task
        daqName = dev.getDaqName()
        taskRunner.getDevice(daqName)
        
        ## Populate module/device lists, auto-select based on device defaults 
        self.defCam = None
        if 'defaultCamera' in self.dev.config:
            self.defCam = self.dev.config['defaultCamera']
        defLaser = None
        if 'defaultLaser' in self.dev.config:
            defLaser = self.dev.config['defaultLaser']
            
        daqDev = dev.getDaqName()
        self.daqUI = taskRunner.getDevice(daqDev)

        self.ui.cameraCombo.setTypes(['cameraModule'])
        self.ui.laserCombo.setTypes(['laser'])
        
        self.positionCtrlGroup = PositionCtrlGroup()
        self.positionCtrlGroup.sigAddNewRequested.connect(self.addPositionCtrl)
        self.ui.itemTree.setParameters(self.positionCtrlGroup, showTop=False)
        self.positionCtrlGroup.sigChildRemoved.connect(self.positionCtrlRemoved)
        self.ui.spotSequenceGroup.setCollapsed(True)
        self.ui.spotDisplayGroup.setCollapsed(True)
        
        self.scanProgram = ScanProgram()
        self.scanProgram.setDevices(scanner=self.dev)
        self.ui.programTree.setParameters(self.scanProgram.ctrlParameter(), showTop=False)

        ## Set up SpinBoxes
        self.ui.minTimeSpin.setOpts(dec=True, step=1, minStep=1e-3, siPrefix=True, suffix='s', bounds=[0, 50])
        self.ui.minDistSpin.setOpts(dec=True, step=1, minStep=1e-6, siPrefix=True, suffix='m', bounds=[0, 10e-3])
        self.ui.sizeSpin.setOpts(dec=True, step=1, minStep=1e-6, siPrefix=True, suffix='m', bounds=[1e-9, 1e-3])
        ## Create state group for saving/restoring state
        self.stateGroup = pg.WidgetGroup([
            (self.ui.cameraCombo,),
            (self.ui.laserCombo,),
            (self.ui.minTimeSpin, 'minTime'),
            (self.ui.minDistSpin, 'minDist'),
            (self.ui.simulateShutterCheck, 'simulateShutter'),
            (self.ui.sizeSpin, 'spotSize'),
            (self.ui.enablePosCtrlCheck, 'enablePosCtrl'),
            (self.ui.enableScanProgCheck, 'enableScanProg'),
        ])
        self.stateGroup.setState({'minTime': 10, 'minDist': 500e-6, 'sizeSpin':100e-6})
        self.tdPlot = self.ui.tdPlotWidget.plotItem
        self.tdPlot.setLabel('bottom', text="Distance", units='m')
        self.tdPlot.setLabel('left', text="Wait time", units='s')

        self.ui.scanProgramSplitter.setSizes([600, 100])
        self.ui.programTimeline.setDownsampling(True)
        ## Note we use lambda functions for all these clicks to strip out the arg sent with the signal
        
        self.ui.showPosCtrlCheck.toggled.connect(self.showPosCtrls)
        self.ui.cameraCombo.currentIndexChanged.connect(self.camModChanged)
        self.ui.laserCombo.currentIndexChanged.connect(self.laserDevChanged)
        self.ui.sizeFromCalibrationRadio.toggled.connect(self.updateSpotSizes)
        self.ui.sizeSpin.valueChanged.connect(self.sizeSpinEdited)
        self.ui.minTimeSpin.valueChanged.connect(self.sequenceChanged)
        self.ui.minDistSpin.valueChanged.connect(self.sequenceChanged)
        self.ui.recomputeBtn.clicked.connect(self.recomputeClicked)
        self.ui.loadConfigBtn.clicked.connect(self.loadConfiguration)
        self.ui.previewBtn.toggled.connect(self.previewProgram)
        self.ui.enablePosCtrlCheck.toggled.connect(self.enablePosCtrlToggled)
        self.ui.enableScanProgCheck.toggled.connect(self.enableScanProgToggled)
        self.ui.showLastSpotCheck.toggled.connect(self.showLastSpotToggled)
        self.ui.programPreviewSlider.valueChanged.connect(self.previewRateChanged)
        
        self.dev.sigGlobalSubdeviceChanged.connect(self.opticStateChanged)
        
        self.testTarget = TargetPoint(name="Test", ptSize=100e-6)
        self.testTarget.setPen(QtGui.QPen(QtGui.QColor(255, 200, 200)))
        self.spotMarker = TargetPoint(name="Last", ptSize=100e-6, movable=False)
        self.spotMarker.setPen(pg.mkPen(color=(255,255,255), width = 2))

        self.spotMarker.hide()
        self.laserDevChanged()  # also updates spot sizes
        self.camModChanged()
        self.updateTDPlot()
            
        #self.ui.simulateShutterCheck.setChecked(False)
        if 'offVoltage' not in self.dev.config: ## we don't have a voltage for virtual shuttering
            self.ui.simulateShutterCheck.setChecked(False)
            self.ui.simulateShutterCheck.setEnabled(False)

        self.daqChanged(self.daqUI.currentState())
        self.daqUI.sigChanged.connect(self.daqChanged)
Пример #20
0
    def newFrame(self, frame):
        """
        Called when task is finished (truly completes, no errors/abort)
        frame contains all of the data returned from all devices
        """
        imageDownSample = self.ui.downSampling.value() # this is the "image" downsample,
        # get the downsample for the daq. This is far more complicated than it should be...
        finfo = frame['result'][self.detectorDevice()]["Channel":'Input']
        info = finfo.infoCopy()
        #if 'downsampling' in info[1]['DAQ']['Input'].keys():
            #daqDownSample = info[1]['DAQ']['Input']['downsampling']
        #else:
            #daqDownSample = 1
        daqDownSample = info[1]['DAQ']['Input'].get('downsampling', 1)
        if daqDownSample != 1:
            raise HelpfulException("Set downsampling in DAQ to 1!")
        # get the data and the command used on the scanner
        pmtdata = frame['result'][self.detectorDevice()]["Channel":'Input'].asarray()
        t = frame['result'][self.detectorDevice()].xvals('Time')
        dt = t[1]-t[0]
        progs = frame['cmd'][self.scannerDevice()]['program']
        if len(progs) == 0:
            self.image.setImage(np.zeros((1,1)))
            return
        prog = progs[0]
        nscans = prog['nScans']
        limits = prog['points']
        dist = (pg.Point(limits[0])-pg.Point(limits[1])).length()
        startT = prog['startTime']
        endT = prog['endTime']
        
        if prog['type'] == 'lineScan':
            totSamps = prog['samplesPerScan']+prog['samplesPerPause']
            imageData = pmtdata[prog['startStopIndices'][0]:prog['startStopIndices'][0]+nscans*totSamps]
            imageData=imageData.reshape(nscans, totSamps)
            imageData = imageData[:,0:prog['samplesPerScan']] # trim off the pause data
            if imageDownSample > 1:
                imageData = fn.downsample(imageData, imageDownSample, axis=1)
            self.ui.plotWidget.setImage(imageData)
            self.ui.plotWidget.getView().setAspectLocked(False)
            self.ui.plotWidget.imageItem.setRect(QtCore.QRectF(startT, 0.0, endT-startT, dist ))
            self.ui.plotWidget.autoRange()
            #self.ui.histogram.imageChanged(autoLevel=True)
            storeFlag = frame['cmd']['protocol']['storeData'] # get flag 
            print "before StoreFlag and storeflag is:", storeFlag
            if storeFlag:
                dirhandle = frame['cmd']['protocol']['storageDir'] # grab directory
                self.info={'detector': self.detectorDevice(), 'scanner': self.scannerDevice(), 'indices': prog['startStopIndices'], 
                           'samplesPerScan': prog['samplesPerScan'], 'nscans': prog['nScans'], 
                           'scanPointList': prog['scanPointList'],
                           'positions': prog['points'],
                           'downSample': imageDownSample, 'daqDownSample': daqDownSample}

                info = [dict(name='Time', units='s', values=t[prog['startStopIndices'][0]:prog['startStopIndices'][1]-prog['samplesPerScan']:prog['samplesPerScan']]),
                        dict(name='Distance'), self.info]
                print 'imageData.shape: ', imageData.shape
                print 'prog: ', prog
                print 'startstop[0]: ', prog['startStopIndices'][0]
                print 'startstop[1]: ', prog['startStopIndices'][1]
                print 'samplesperscan: ', prog['samplesPerScan']
                print 'info: ', info
                # there is an error here that I haven't fixed. Use multilinescan until I do. 
                ma = metaarray.MetaArray(imageData, info=info)
                print 'I am writing imaging.ma for a simple line scan'
                dirhandle.writeFile(ma, 'Imaging.ma')

        if prog['type'] == 'multipleLineScan': 
            totSamps = int(np.sum(prog['scanPointList'])) # samples per scan, before downsampling
            imageData = pmtdata[prog['startStopIndices'][0]:prog['startStopIndices'][0]+int((nscans*totSamps))].copy()           
            #print imageData.shape
            #print nscans
            #print totSamps
            #print prog['samplesPerPause']
            imageData = imageData.reshape(nscans, totSamps)
            csum = np.cumsum(prog['scanPointList'])
            for i in xrange(0, len(csum), 2):
                    imageData[:,csum[i]:csum[i+1]] = 0

            #imageData = imageData[:,0:prog['samplesPerScan']] # trim off the pause data
            imageData = fn.downsample(imageData, imageDownSample, axis=1)
            self.ui.plotWidget.setImage(imageData)
            self.ui.plotWidget.getView().setAspectLocked(False)
            self.ui.plotWidget.imageItem.setRect(QtCore.QRectF(startT, 0.0, totSamps*dt*nscans, dist ))
            self.ui.plotWidget.autoRange()
            #self.ui.histogram.imageChanged(autoLevel=True)
            storeFlag = frame['cmd']['protocol']['storeData'] # get flag 
           # print "before StoreFlag and storeflag is:", storeFlag
           # print frame['cmd']
           # print prog['points']
            if storeFlag:
                dirhandle = frame['cmd']['protocol']['storageDir'] # grab directory
                self.info={'detector': self.detectorDevice(), 'scanner': self.scannerDevice(), 'indices': prog['startStopIndices'], 
                           'scanPointList': prog['scanPointList'], 'nscans': prog['nScans'], 
                           'positions': prog['points'],
                           'downSample': imageDownSample, 'daqDownSample': daqDownSample}
                #print 'totSamps: ', totSamps
                #print 'prog[startstop..]: ', prog['startStopIndices']
                info = [dict(name='Time', units='s', 
                             values=t[prog['startStopIndices'][0]:prog['startStopIndices'][1]-int(totSamps):int(totSamps)]), 
                        dict(name='Distance'), self.info]
            #    print info
                ma = metaarray.MetaArray(imageData, info=info)
                print 'I am writing imaging.ma for a multiple line scan'
                dirhandle.writeFile(ma, 'Imaging.ma')
                #raise Exception()

        if prog['type'] == 'rectScan':
            #samplesPerScan = int((prog['startStopIndices'][1]-prog['startStopIndices'][0])/prog['nScans'])
            samplesPerScan = prog['imageSize'][0]*prog['imageSize'][1]
            getManager().data = prog, pmtdata
            imageData = pmtdata[prog['startStopIndices'][0]:prog['startStopIndices'][0] + nscans*samplesPerScan]
#            imageData=imageData.reshape(samplesPerScan, nscans)
            imageData=imageData.reshape(nscans, prog['imageSize'][1], prog['imageSize'][0])
            imageData = imageData.transpose(0,2,1)
            # imageData = fn.downsample(imageData, imageDownSample, axis=0)
            self.ui.plotWidget.setImage(imageData)
            pts = prog['points']
            floatpoints =[ (float(x[0]), float(x[1])) for x in pts]
            width  = (pts[1] -pts[0]).length() # width is x in M
            height = (pts[2]- pts[0]).length() # heigh in M
            self.ui.plotWidget.getView().setAspectLocked(True)
            self.ui.plotWidget.imageItem.setRect(QtCore.QRectF(0., 0., width, height))
            self.ui.plotWidget.autoRange()
           # self.ui.histogram.imageChanged(autoLevel=True)
            #print 'rectscan - nscans, samplesperscan: ', prog['nScans'], samplesPerScan
            sd = self.pr.getDevice(self.scannerDevice())
            camMod = sd.cameraModule().window()
            if self.img is not None:
                camMod.removeItem(self.img)
                self.img = None
            self.img = pg.ImageItem(imageData.mean(axis=0))
            camMod.addItem(self.img)
            w = imageData.shape[1]
            h = imageData.shape[2]
            localPts = map(pg.Vector, [[0,0], [w,0], [0,h], [0,0,1]]) # w and h of data of image in pixels.
            globalPts = prog['points'] # sort of. - 
            m = pg.solve3DTransform(localPts, map(pg.Vector, globalPts+[[0,0,1]]))
            m[:,2] = m[:,3]
            m[2] = m[3]
            m[2,2] = 1
            tr = QtGui.QTransform(*m[:3,:3].transpose().reshape(9))
            self.img.setTransform(tr)
            storeFlag = frame['cmd']['protocol']['storeData'] # get flag 
           # print 'srttransform: ', pg.SRTTransform3D(tr)
            if storeFlag:
                dirhandle = frame['cmd']['protocol']['storageDir'] # grab directory
                self.info={'detector': self.detectorDevice(), 'scanner': self.scannerDevice(), 'indices': prog['startStopIndices'], 
                           'samplesPerScan': samplesPerScan, 'nscans': prog['nScans'], 
                           'positions': floatpoints, # prog['points'],
                           'downSample': imageDownSample,
                           'transform': pg.SRTTransform3D(tr),
                           }
                           
                # to line below, add x, y for the camera (look at camera video output)
                info = [dict(name='Time', units='s', 
                             values=t[prog['startStopIndices'][0]:prog['startStopIndices'][0]+nscans*samplesPerScan:samplesPerScan]), 
                        dict(name='Distance'), self.info]
                print self.info
                print info
                ma = metaarray.MetaArray(imageData, info=info)
                
                dirhandle.writeFile(ma, 'Imaging.ma')
Пример #21
0
 def __init__(self, **args):
     ptypes.ListParameter.__init__(self, **args)
     self.dir = getManager().interfaceDir
     self.dir.sigInterfaceListChanged.connect(self.updateList)
     self.updateList()
Пример #22
0
    def outputPower(self):
        """
        Return the output power of the laser in Watts.
        
        The power returned does not account for the effects of pockels cell, shutter, etc.
        This information is determined in one of a few ways:
           1. The laser directly reports its power output (function needs to be reimplemented in subclass)
           2. A photodiode receves a small fraction of the beam and reports an estimated power
           3. The output power is specified in the config file
           
        Use checkPowerValidity(power) to determine whether this level is within the expected range.
        """

        if self.hasPowerIndicator:
            ## run a task that checks the power
            daqName = self.getDAQName('shutter')
            powerInd = self.config['powerIndicator']['channel']
            rate = self.config['powerIndicator']['rate']

            pConfig = getManager().getDevice(
                self.config['powerIndicator']['channel'][0]).listChannels()[
                    self.config['powerIndicator']['channel'][1]]
            sTime = pConfig.get('settlingTime', None)
            mTime = pConfig.get('measurementTime', None)

            if mTime is None or sTime is None:
                raise Exception(
                    "The power indicator (%s) specified for %s needs to be configured with both a 'settlingTime' value and a 'measurementTime' value."
                    % (self.config['powerIndicator']['channel'], self.name()))

            dur = 0.1 + (sTime + mTime)
            nPts = int(dur * rate)

            ### create a waveform that flashes the QSwitch(or other way of turning on) the number specified by reps
            waveform = np.zeros(nPts, dtype=np.byte)
            #for i in range(reps):
            #waveform[(i+1)/10.*rate:((i+1)/10.+sTime+mTime)*rate] = 1 ## divide i+1 by 10 to increment by hundreds of milliseconds
            waveform[0.1 * rate:-2] = 1

            measureMode = self.measurementMode()
            cmd = {
                'protocol': {
                    'duration': dur
                },
                self.name(): {
                    'switchWaveform': waveform,
                    'shutterMode': measureMode['shutter']
                },
                powerInd[0]: {
                    powerInd[1]: {
                        'record': True,
                        'recordInit': False
                    }
                },
                daqName: {
                    'numPts': nPts,
                    'rate': rate
                }
            }
            #print "outputPowerCmd: ", cmd
            task = getManager().createTask(cmd)
            task.execute()
            result = task.getResult()

            ## pull out time that laser was on and off so that power can be measured in each state -- discard the settlingTime around each state change
            #onMask = np.zeros(nPts, dtype=np.byte)
            #offMask = np.zeros(nPts, dtype=np.byte)
            #for i in range(reps):
            #onMask[((i+1)/10+sTime)*rate:((i+1)/10+sTime+mTime)*rate] = 1
            #offMask[(i/10.+2*sTime+mTime)*rate:(i+1/10.)*rate] = 1
            powerIndTrace = result[powerInd[0]]
            if powerIndTrace is None:
                raise Exception("No data returned from power indicator")
            laserOn = powerIndTrace[0][0.1 * rate:-2].asarray()
            laserOff = powerIndTrace[0][:0.1 * rate].asarray()

            t, prob = stats.ttest_ind(laserOn, laserOff)
            if prob < 0.01:  ### if powerOn is statistically different from powerOff
                powerOn = laserOn.mean()
                if powerOn < 0:
                    powerOn = 0.0
                powerOff = laserOff.mean()
                #self.devGui.ui.outputPowerLabel.setText(siFormat(powerOn, suffix='W')) ## NO! device does not talk to GUI!
                self.setParam(currentPower=powerOn)
                powerOk = self.checkPowerValidity(powerOn)
                self.sigOutputPowerChanged.emit(powerOn, powerOk)
                self.updateSamplePower()
                return powerOn
            else:
                logMsg(
                    "No laser pulse detected by power indicator '%s' while measuring Laser.outputPower()"
                    % powerInd[0],
                    msgType='warning')
                self.setParam(currentPower=0.0)
                self.updateSamplePower()
                return 0.0

        ## return the power specified in the config file if there's no powerIndicator
        else:
            power = self.config.get('power', None)
            if power is None:
                return None
            else:
                return power
Пример #23
0
 def closeEvent(self, ev):
     geom = self.geometry()
     uiState = {'geometry': [geom.x(), geom.y(), geom.width(), geom.height()]}
     getManager().writeConfigFile(uiState, self.stateFile)
     
     self.pr.quit()
Пример #24
0
    def outputPower(self):
        """
        Return a tuple: (current output power, bool power within expected range)
        The output power returned excludes the effect of pockel cell, shutter, etc.
        This information is determined in one of a few ways:
           1. The laser directly reports its power output (function needs to be reimplemented in subclass)
           2. A photodiode receves a small fraction of the beam and reports an estimated power
           3. The output power is specified in the config file
        """
        
        if self.hasPowerIndicator:
            ## run a task that checks the power
            daqName =  self.getDAQName('shutter')
            powerInd = self.config['powerIndicator']['channel']
            rate = self.config['powerIndicator']['rate']
            
            pConfig = getManager().getDevice(self.config['powerIndicator']['channel'][0]).listChannels()[self.config['powerIndicator']['channel'][1]]
            sTime = pConfig.get('settlingTime', None)
            mTime = pConfig.get('measurementTime', None)
            
            if mTime is None or sTime is None:
                raise Exception("The power indicator (%s) specified for %s needs to be configured with both a 'settlingTime' value and a 'measurementTime' value." %(self.config['powerIndicator']['channel'], self.name()))
            
            dur = 0.1 + (sTime+mTime)
            nPts = int(dur*rate)
            
            ### create a waveform that flashes the QSwitch(or other way of turning on) the number specified by reps
            waveform = np.zeros(nPts, dtype=np.byte)
            #for i in range(reps):
                #waveform[(i+1)/10.*rate:((i+1)/10.+sTime+mTime)*rate] = 1 ## divide i+1 by 10 to increment by hundreds of milliseconds
            waveform[0.1*rate:-2] = 1
            
            cmd = {
                'protocol': {'duration': dur},
                self.name(): {'switchWaveform':waveform, 'shutterMode':'closed'},
                powerInd[0]: {powerInd[1]: {'record':True, 'recordInit':False}},
                daqName: {'numPts': nPts, 'rate': rate}
            }
            #print "outputPowerCmd: ", cmd
            task = getManager().createTask(cmd)
            task.execute()
            result = task.getResult()
            
            ## pull out time that laser was on and off so that power can be measured in each state -- discard the settlingTime around each state change
            #onMask = np.zeros(nPts, dtype=np.byte)
            #offMask = np.zeros(nPts, dtype=np.byte)
            #for i in range(reps):
                #onMask[((i+1)/10+sTime)*rate:((i+1)/10+sTime+mTime)*rate] = 1
                #offMask[(i/10.+2*sTime+mTime)*rate:(i+1/10.)*rate] = 1
            powerIndTrace = result[powerInd[0]]
            if powerIndTrace is None:
                raise Exception("No data returned from power indicator")
            laserOn = powerIndTrace[0][0.1*rate:-2].asarray()
            laserOff = powerIndTrace[0][:0.1*rate].asarray()
            
            t, prob = stats.ttest_ind(laserOn, laserOff)
            if prob < 0.01: ### if powerOn is statistically different from powerOff
                powerOn = laserOn.mean()
                if powerOn < 0:
                    powerOn = 0.0
                powerOff = laserOff.mean()
                #self.devGui.ui.outputPowerLabel.setText(siFormat(powerOn, suffix='W')) ## NO! device does not talk to GUI!
                self.setParam(currentPower=powerOn)
                powerOk = self.checkPowerValidity(powerOn)
                self.sigOutputPowerChanged.emit(powerOn, powerOk)
                self.updateSamplePower()
                return powerOn, powerOk
            else:
                logMsg("No laser pulse detected by power indicator '%s' while measuring Laser.outputPower()" % powerInd[0], msgType='warning')
                self.setParam(currentPower=0.0)
                self.updateSamplePower()
                return 0.0, self.checkPowerValidity(0.0)

            
        ## return the power specified in the config file if there's no powerIndicator
        else:
            power = self.config.get('power', None)
            if power is None:
                return None, None
            else:
                return power, self.checkPowerValidity(power)
 def load_from_dm_clicked(self):
     man = getManager()
     filename = man.currentFile.name()
     nwb = self.ui.load_nwb(filename)
 def load_from_dm_clicked(self):
     man = getManager()
     sel_dir = man.currentFile
     self.ui.set_path(sel_dir)
Пример #27
0
    def runCalibration(self,
                       powerMeter=None,
                       measureTime=0.1,
                       settleTime=0.005,
                       pCellVoltage=None,
                       rate=100000):
        daqName = self.getDAQName()[0]
        duration = measureTime + settleTime
        nPts = int(rate * duration)

        cmdOff = {
            'protocol': {
                'duration': duration,
                'timeout': duration + 5.0
            },
            self.name(): {
                'shutterMode': 'closed',
                'switchWaveform': np.zeros(nPts, dtype=np.byte)
            },
            powerMeter: {
                x: {
                    'record': True,
                    'recordInit': False
                }
                for x in getManager().getDevice(powerMeter).listChannels()
            },
            daqName: {
                'numPts': nPts,
                'rate': rate
            }
        }

        if self.hasPowerIndicator:
            powerInd = self.config['powerIndicator']['channel']
            cmdOff[powerInd[0]] = {
                powerInd[1]: {
                    'record': True,
                    'recordInit': False
                }
            }

        if pCellVoltage is not None:
            if self.hasPCell:
                a = np.zeros(nPts, dtype=float)
                a[:] = pCellVoltage
                cmdOff[self.name()]['pCell'] = a
            else:
                raise Exception(
                    "Laser device %s does not have a pCell, therefore no pCell voltage can be set."
                    % self.name())

        cmdOn = cmdOff.copy()
        wave = np.ones(nPts, dtype=np.byte)
        wave[-1] = 0
        shutterDelay = self.config.get('shutter', {}).get('delay', 0)
        wave[:shutterDelay * rate] = 0
        cmdOn[self.name()] = {'shutterMode': 'open', 'switchWaveform': wave}

        #print "cmdOff: ", cmdOff
        taskOff = getManager().createTask(cmdOff)
        taskOff.execute()
        resultOff = taskOff.getResult()

        taskOn = getManager().createTask(cmdOn)
        taskOn.execute()
        resultOn = taskOn.getResult()

        measurementStart = (shutterDelay + settleTime) * rate

        if self.hasPowerIndicator:
            powerOutOn = resultOn[powerInd[0]][0][measurementStart:].mean()
        else:
            powerOutOn = self.outputPower()

        laserOff = resultOff[powerMeter][0][measurementStart:]
        laserOn = resultOn[powerMeter][0][measurementStart:]

        t, prob = stats.ttest_ind(laserOn.asarray(), laserOff.asarray())
        if prob > 0.001:
            raise Exception("Power meter device %s could not detect laser." %
                            powerMeter)
        else:
            powerSampleOn = laserOn.mean()
            transmission = powerSampleOn / powerOutOn
            return (powerSampleOn, transmission)
Пример #28
0
 def load_from_dm_clicked(self):
     man = getManager()
     filename = man.currentFile.name()
     nwb = self.ui.load_nwb(filename)
Пример #29
0
 def loadData(self):
     data = getManager().currentFile
     self.flowchart.setInput(dataIn=data)
Пример #30
0
    def __init__(self, dev, taskRunner):
        TaskGui.__init__(self, dev, taskRunner)
        self.ui = Ui_Form()
        self.ui.setupUi(self)
        dm = getManager()
        self.targets = None
        self.items = {}
        self.haveCalibration = True   ## whether there is a calibration for the current combination of laser/optics
        self.currentOpticState = None
        self.currentCamMod = None
        self.programCtrls = []
        self.displaySize = {}  ## maps (laser,opticState) : display size
                               ## since this setting is remembered for each objective.
        
        ## Populate module/device lists, auto-select based on device defaults 
        self.defCam = None
        if 'defaultCamera' in self.dev.config:
            self.defCam = self.dev.config['defaultCamera']
        defLaser = None
        if 'defaultLaser' in self.dev.config:
            defLaser = self.dev.config['defaultLaser']

        self.ui.cameraCombo.setTypes(['cameraModule'])
        self.ui.laserCombo.setTypes(['laser'])
        
        self.positionCtrlGroup = PositionCtrlGroup()
        self.positionCtrlGroup.sigAddNewRequested.connect(self.addPositionCtrl)
        self.ui.itemTree.setParameters(self.positionCtrlGroup, showTop=False)
        self.positionCtrlGroup.sigChildRemoved.connect(self.positionCtrlRemoved)
        
        self.programCtrlGroup = ProgramCtrlGroup()
        self.programCtrlGroup.sigAddNewRequested.connect(self.addProgramCtrl)
        self.ui.programTree.setParameters(self.programCtrlGroup, showTop=False)
        self.programCtrlGroup.sigChildRemoved.connect(self.programCtrlRemoved)

        ## Set up SpinBoxes
        self.ui.minTimeSpin.setOpts(dec=True, step=1, minStep=1e-3, siPrefix=True, suffix='s', bounds=[0, 50])
        self.ui.minDistSpin.setOpts(dec=True, step=1, minStep=1e-6, siPrefix=True, suffix='m', bounds=[0, 10e-3])
        self.ui.sizeSpin.setOpts(dec=True, step=1, minStep=1e-6, siPrefix=True, suffix='m', bounds=[1e-9, 1e-3])
        ## Create state group for saving/restoring state
        self.stateGroup = pg.WidgetGroup([
            (self.ui.cameraCombo,),
            (self.ui.laserCombo,),
            (self.ui.minTimeSpin, 'minTime'),
            (self.ui.minDistSpin, 'minDist'),
            (self.ui.simulateShutterCheck, 'simulateShutter'),
            (self.ui.sizeSpin, 'spotSize'),
        ])
        self.stateGroup.setState({'minTime': 10, 'minDist': 500e-6, 'sizeSpin':100e-6})
        self.tdPlot = self.ui.tdPlotWidget.plotItem
        self.tdPlot.setLabel('bottom', text="Distance", units='m')
        self.tdPlot.setLabel('left', text="Wait time", units='s')

        ## Note we use lambda functions for all these clicks to strip out the arg sent with the signal
        
        self.ui.hideCheck.toggled.connect(self.showInterface)
        self.ui.hideMarkerBtn.clicked.connect(self.hideSpotMarker)
        self.ui.cameraCombo.currentIndexChanged.connect(self.camModChanged)
        self.ui.laserCombo.currentIndexChanged.connect(self.laserDevChanged)
        self.ui.sizeFromCalibrationRadio.toggled.connect(self.updateSpotSizes)
        self.ui.sizeSpin.valueChanged.connect(self.sizeSpinEdited)
        self.ui.minTimeSpin.valueChanged.connect(self.sequenceChanged)
        self.ui.minDistSpin.valueChanged.connect(self.sequenceChanged)
        self.ui.recomputeBtn.clicked.connect(self.recomputeClicked)
        self.ui.loadConfigBtn.clicked.connect(self.loadConfiguration)
        
        self.dev.sigGlobalSubdeviceChanged.connect(self.opticStateChanged)
        
        self.testTarget = TargetPoint(name="Test", ptSize=100e-6)
        self.testTarget.setPen(QtGui.QPen(QtGui.QColor(255, 200, 200)))
        self.spotMarker = TargetPoint(name="Last", ptSize=100e-6, movable=False)
        self.spotMarker.setPen(pg.mkPen(color=(255,255,255), width = 2))

        self.spotMarker.hide()
        self.updateSpotSizes()

        self.camModChanged()
        self.updateTDPlot()
        
            
        #self.ui.simulateShutterCheck.setChecked(False)
        if 'offVoltage' not in self.dev.config: ## we don't have a voltage for virtual shuttering
            self.ui.simulateShutterCheck.setChecked(False)
            self.ui.simulateShutterCheck.setEnabled(False)
Пример #31
0
 def data_manager(self):
     expt = self.experiment
     from acq4.Manager import getManager
     manager = getManager()
     mod = manager.getModule('Data Manager')
     mod.selectFile(expt.path)
Пример #32
0
    def _load_data(self, seqDir):
        man = getManager()
        model = man.dataModel

        # read all image data
        self.img_data = model.buildSequenceArray(
            seqDir, 
            lambda dh: dh['Camera']['frames.ma'].read(),
            join=False).asarray()
        seqParams = list(model.listSequenceParams(seqDir).items())
        if self.img_data.ndim == 1:
            self.img_data = self.img_data[np.newaxis, :]
            seqParams.insert(0, (None, [0]))

        transpose = seqParams[0][0] == ('protocol', 'repetitions')
        if transpose:
            self.img_data = np.swapaxes(self.img_data, 0, 1)
            seqParams = seqParams[::-1]
        self.seqParams = seqParams

        if seqParams[0][0] is None:
            self.seqColors = [pg.mkColor('w')]
        else:
            nSeq = len(seqParams[0][1])
            if nSeq == 2:
                # Special case: add in difference between two sequence trials
                seqParams[0] = (seqParams[0][0], list(seqParams[0][1]) + [np.mean(seqParams[0][1])])
                nSeq = 3
                img_data = np.empty((3,) + self.img_data.shape[1:], dtype=self.img_data.dtype)
                img_data[:2] = self.img_data
                for i in range(img_data.shape[1]):
                    minlen = min(self.img_data[0,i].shape[0], self.img_data[1,i].shape[0])
                    img_data[2,i] = self.img_data[0,i][:minlen].copy()
                    img_data[2,i]._data = self.img_data[0,i][:minlen].asarray().astype('float') - self.img_data[1,i][:minlen].asarray()
                self.img_data = img_data
                
                
            self.seqColors = [pg.intColor(i, nSeq*1.6) for i in range(nSeq)]

        # cull out truncated recordings :(
        self.img_data = [[d['Time':0:200e-3] for d in row if d.xvals('Time')[-1] > 150e-3] for row in self.img_data]

        # crop / concatenate
        img_len = min([min([d.shape[0] for d in row]) for row in self.img_data])
        self.img_data = [[d[:img_len] for d in row] for row in self.img_data]
        self.img_arrays = [np.concatenate([d.asarray()[np.newaxis, ...] for d in row], axis=0) for row in self.img_data]

        # average
        self.img_mean = [img_arr.mean(axis=0) for img_arr in self.img_arrays]

        for p in self.clamp_plots:
            self.plt2.removeItem(p)
            
        # read all clamp data
        first_subdir = seqDir[seqDir.ls()[0]]
        clamp_name = 'Clamp1'
        if not first_subdir[clamp_name + '.ma'].exists():
            clamp_name = 'Clamp2'
        
        clamp_file = first_subdir[clamp_name + '.ma']
        if clamp_file.exists():
            self.clamp_mode = model.getClampMode(clamp_file)
            chan = 'command' if self.clamp_mode == 'VC' else 'primary'
            self.clamp_data = model.buildSequenceArray(
                seqDir, 
                lambda dh: dh[clamp_name + '.ma'].read()['Channel': chan],
                join=False).asarray()
            if self.clamp_data.ndim == 1:
                self.clamp_data = self.clamp_data[np.newaxis, :]
            if transpose:
                self.clamp_data = np.swapaxes(self.clamp_data, 0, 1)

            self.plt2.setLabels(left=('Vm', 'V'))
            
            for i in range(self.clamp_data.shape[0]):
                for j in range(self.clamp_data.shape[1]):
                    trace = self.clamp_data[i,j]
                    pen = self.seqColors[i]
                    p = self.plt2.plot(trace.xvals('Time'), trace.asarray(), antialias=True, pen=pen)
                    self.clamp_plots.append(p)
            self.plt2.show()
        else:
            self.clamp_mode = None
            self.plt2.hide()

        self.img_t = self.img_data[0][0].xvals('Time')

        self.img1.setImage(self.img_mean[-1].mean(axis=0))

        self.roi_changed(None)
        self.time_rgn_changed(None)
        self.update_sequence_analysis()
Пример #33
0
 def submission_tool(self):
     from acq4.Manager import getManager 
     man = getManager()
     st = man.getModule('MultipatchSubmissionModule') 
     st.ui.set_path(man.dirHandle(self.experiment.path))
Пример #34
0
 def setRootClicked(self):
     m = getManager()
     f = m.currentFile
     self.ui.fileTree.setRoot(f)
Пример #35
0
 def __init__(self, **args):
     ptypes.ListParameter.__init__(self, **args)
     self.dir = getManager().interfaceDir
     self.dir.sigInterfaceListChanged.connect(self.updateList)
     self.updateList()