當前位置: 首頁>>代碼示例>>Python>>正文


Python cyclopean_instrument.CyclopeanInstrument類代碼示例

本文整理匯總了Python中cyclopean_instrument.CyclopeanInstrument的典型用法代碼示例。如果您正苦於以下問題:Python CyclopeanInstrument類的具體用法?Python CyclopeanInstrument怎麽用?Python CyclopeanInstrument使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CyclopeanInstrument類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _start_running

 def _start_running(self):
     #print 'counters started running'
     CyclopeanInstrument._start_running(self)
     self._ins_adwin.start_counter(
             set_integration_time=self._integration_time,
             set_avg_periods=self._avg_periods,
             set_single_run=0)
開發者ID:AdriaanRol,項目名稱:measurement,代碼行數:7,代碼來源:counters_via_adwin.py

示例2: _start_running

 def _start_running(self):
     CyclopeanInstrument._start_running(self)
     self._ins_ADwin.Stop_Process(4)
     self._ins_ADwin.Load('D:\\Lucio\\AdWin codes\\ADwin_Gold_II\\simple_counting.tb4')
     self._ins_ADwin.Set_Par(24,self._integration_time)
     time.sleep(0.001)
     self._ins_ADwin.Start_Process(4)
開發者ID:AdriaanRol,項目名稱:measurement,代碼行數:7,代碼來源:ADwin_counter.py

示例3: __init__

    def __init__(self, name, channel='1'):
        CyclopeanInstrument.__init__(self, name, tags=['measure'])
        
        # relevant parameters
        self.add_parameter('countrate',
                           flags=Instrument.FLAG_GET,
                           units='Hz',
                           tags=['measure'],
                           channels=('cntr1', 'cntr2'),
                           channel_prefix='%s_',
                           doc="""
                           Returns the count rates for all counters.
                           """)

        # public functions
        self.add_function("monitor_countrates")

        # init parameters
        self._countrate = {'cntr1': 0.0, 'cntr2': 0.0, }
        
        # instruments we need to access
        # import qt
        # self._ins_adwin = qt.instruments['adwin']

        # cyclopean features
        self._supported = {
            'get_running': True,
            'get_recording': True,
            'set_running': True,
            'set_recording': False,
            'save': False,
            }

        self._busy = False
開發者ID:AdriaanRol,項目名稱:measurement,代碼行數:34,代碼來源:counters_demo.py

示例4: save

    def save(self, meta=""):
        CyclopeanInstrument.save(self, meta)
	

        from wp_toolbox.qtlab_data import save
        save(self.get_name(), meta, x__x__um=self._x, y__y__um=self._y, 
        z__counts__Hz=self._data['countrates'])
開發者ID:AdriaanRol,項目名稱:measurement,代碼行數:7,代碼來源:scan2d_counts_original.py

示例5: _start_running

 def _start_running(self):
     CyclopeanInstrument._start_running(self)
     self._counter = self._ins_count.get_is_running()
     self._ins_count.set_is_running(False)
     self.setup_data()
     self._current_line = 0
     self._last_line = 0
開發者ID:AdriaanRol,項目名稱:measurement,代碼行數:7,代碼來源:ADwin_scan2d.py

示例6: __init__

    def __init__(self, name, address=None):
        CyclopeanInstrument.__init__(self, name, tags=['measure', 'generate', 'virtual'])

        # relevant parameters
        self.add_parameter('integration_time',
                           type=types.IntType,
                           flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET,
                           units='ms',
                           minval=1, maxval=10000,
                           doc="""
                           How long to count to determine the rate.
                           """)

        self.add_parameter('channel',
                           type=types.IntType,
                           flags=Instrument.FLAG_SET | Instrument.FLAG_SOFTGET,
                           units='',
                           minval=1, maxval=5,
                           doc="""
                           ADwin counter channel (1 - 4) or ADwiun counter 1 + counter 2 (channel 5)
                           """)

        self.add_parameter('counts',
                           type=types.IntType,
                           flags=Instrument.FLAG_GET,
                           units='counts',
                           tags=['measure'],
                           doc="""
                           Returns the counts acquired during the last counting period.
                           """)

        self.add_parameter('countrate',
                           type=types.IntType,
                           flags=Instrument.FLAG_GET,
                           units='Hz',
                           tags=['measure'],
                           doc="""
                           Returns the count rate based on the current count value.
                           """)

        # init parameters
        self.set_channel(5)
        self._counts = 0
        self._countrate = 0

        # instruments we need to access
        import qt
#        self._ins_pos = qt.instruments['dummy_pos']
        self._ins_ADwin = qt.instruments['ADwin']

        self.set_integration_time(20.0)

        self._supported = {
            'get_running': True,
            'get_recording': True,
            'set_running': True,
            'set_recording': False,
            'save': False,
            }
開發者ID:AdriaanRol,項目名稱:measurement,代碼行數:59,代碼來源:ADwin_counter.py

示例7: _start_running

 def _start_running(self):
     CyclopeanInstrument._start_running(self)
     self._prepare()
     self._linescan.set_is_running(True)
     qt.msleep(0.1)
     while self._linescan.get_is_running():
         qt.msleep(0.1)
     return self._process_fit()
開發者ID:AdriaanRol,項目名稱:measurement,代碼行數:8,代碼來源:optimize1d_counts.py

示例8: save

 def save(self, meta=""):
     CyclopeanInstrument.save(self, meta)
     
     # NOTE a test of hdf5 data
     dat = h5.HDF5Data(name=self.get_name())
     dat.create_dataset('x', data=self._x)
     dat.create_dataset('y', data=self._y)
     dat.create_dataset('countrate', data=self._data['countrates'])
     dat.close()
開發者ID:AdriaanRol,項目名稱:measurement,代碼行數:9,代碼來源:scan2d_counts.py

示例9: _start_running

    def _start_running(self):
        CyclopeanInstrument._start_running(self)

        # make sure the counter is off.
        if self._counters.get_is_running():
            self._counter_was_running = True
            self._counters.set_is_running(False)
        
        self.setup_data()
        self._current_line = 0
        self._last_line = 0
        self._next_line()
開發者ID:AdriaanRol,項目名稱:measurement,代碼行數:12,代碼來源:scan2d_demo.py

示例10: _start_running

    def _start_running(self):
        CyclopeanInstrument._start_running(self)

        # determine points of the line
        self._points = zeros((len(self._dimensions), self._steps))

        for i,d in enumerate(self._dimensions):

	    self._points[i,:] = linspace(self._starts[i], self._stops[i],self._steps)


        # start the linescan
        if not self._mos.linescan_start(self._dimensions, self._starts, 
                self._stops, self._steps, self._px_time, 
                value=self._scan_value):
            self.set_is_running(False)
開發者ID:AdriaanRol,項目名稱:measurement,代碼行數:16,代碼來源:linescan.py

示例11: save

    def save(self, meta=""):
        CyclopeanInstrument.save(self, meta)

        import qt
        qt.mstart()
        data = qt.Data(name='dummy 2D scan')
        data.add_coordinate('x [um]')
        data.add_coordinate('y [um]')
        data.add_value('counts [Hz]')
        data.create_file()
        for i in range(self._xsteps):
            for j in range(self._ysteps):
                data.add_data_point(self._x[i], self._y[j], self._data[j,i])
            data.new_block()
        data.close_file()
        qt.mend()
開發者ID:AdriaanRol,項目名稱:measurement,代碼行數:16,代碼來源:ADwin_scan2d.py

示例12: _start_running

    def _start_running(self):
        CyclopeanInstrument._start_running(self)

        # initalize data field and set current status (i.e, empty)
        # general feature for scan: data for points
        #
        # create a field of correct shape; each line, in whatever form
        # specified via starts and stops gets their own points
        pts_shape = list(self._linescan_starts.shape)
        pts_shape.append(self._linescan_steps)
        pts = zeros(tuple(pts_shape))

        dim_lines = zeros(self._linescan_starts.shape)
        dim_lines_flat = dim_lines.flat
        
        # index gets incremented after the item is being read out, so we
        # start populating before the first readout and stop before the
        # last one
        ndx = dim_lines_flat.coords
        pts[ndx] = linspace(self._linescan_starts[ndx],
               self._linescan_stops[ndx], self._linescan_steps)

        # line index of course without the dimensions in which we scan
        self._current_line = ndx[:-1]

        # print self._current_line
        
        for i in dim_lines_flat:
            i = linspace(self._linescan_starts[ndx],
                self._linescan_stops[ndx], self._linescan_steps)
             
            if dim_lines_flat.index < dim_lines.size:
                ndx = dim_lines_flat.coords
                pts[ndx] = linspace(self._linescan_starts[ndx],
                       self._linescan_stops[ndx], self._linescan_steps)
        
        self._data['points'] = pts

        # set up correct data field, to be implemented by user
        self._setup_data()

        # hook up linescanner changes
        self._linescan.connect('changed', self._linescan_update)

        # now start the actual scanning
        self._next_line()
開發者ID:AdriaanRol,項目名稱:measurement,代碼行數:46,代碼來源:scan.py

示例13: __init__

    def __init__(self, name, adwin):
        """
        Parameters:
            adwin : string
                qtlab-name of the adwin instrument to be used
        """
        CyclopeanInstrument.__init__(self, name, tags=['measure'])
        
        # relevant parameters
        self.add_parameter('countrate',
                           flags=Instrument.FLAG_GET,
                           units='Hz',
                           tags=['measure'],
                           channels=('cntr1', 'cntr2'),
                           channel_prefix='%s_',
                           doc="""
                           Returns the count rates for all counters.
                           """)
        self.add_parameter('integration_time',
                flags=Instrument.FLAG_GETSET,
                units='ms',
                minval=1,
                maxval=1e6)
        self.add_parameter('avg_periods',
                flags=Instrument.FLAG_GETSET,
                minval=1,
                maxval=1e6)

        # init parameters
        self._countrate = {'cntr1': 0.0, 'cntr2': 0.0, }
        self._integration_time = 1
        self._avg_periods = 100
        
        # instruments we need to access
        self._ins_adwin = qt.instruments[adwin]

        # cyclopean features
        self._supported = {
            'get_running': True,
            'get_recording': True,
            'set_running': True,
            'set_recording': False,
            'save': False,
            }

        self._busy = False
開發者ID:AdriaanRol,項目名稱:measurement,代碼行數:46,代碼來源:counters_via_adwin.py

示例14: __init__

    def __init__(self, name, use={}):
        CyclopeanInstrument.__init__(self, name, tags=[], use=use)
        
        self._supported = {
            'get_running': False,
            'get_recording': False,
            'set_running': False,
            'set_recording': False,
            'save': False,
            }

        self.add_parameter('keyword',
                           type = types.StringType,
                           flags=Instrument.FLAG_GETSET,
                           units='' )

        self.add_function('set_control_variable')
        self.add_function('get_control_variable')
開發者ID:machielblok,項目名稱:qtlab-user-diamond-master,代碼行數:18,代碼來源:setup_controller.py

示例15: __init__

    def __init__(self, name, linescan, mos):
        CyclopeanInstrument.__init__(self, name, tags=['measure'])

        self._mos = qt.instruments[mos]
        self._linescan = qt.instruments[linescan]


        # add the relevant parameters for a scanner based on line scans
        self.add_parameter('linescan_dimensions',
                type=types.TupleType,
                flags=Instrument.FLAG_GETSET)

        self.add_parameter('linescan_px_time', 
                type=types.FloatType,
                flags=Instrument.FLAG_GETSET,
                units='ms')

        self.add_parameter('linescan_steps',
                type=types.IntType,
                flags=Instrument.FLAG_GETSET)

        self.add_parameter('linescan_starts',
                type=types.ListType,
                flags=Instrument.FLAG_GETSET)

        self.add_parameter('linescan_stops',
                type=types.ListType,
                flags=Instrument.FLAG_GETSET)
         
        self.add_parameter('current_line',
                type=types.TupleType,
                flags=Instrument.FLAG_GET)
 

        self._supported = {
            'get_running': True,
            'get_recording': False,
            'set_running': False,
            'set_recording': False,
            'save': True,
            }

        # initialize vars
        self._current_line = ()
開發者ID:AdriaanRol,項目名稱:measurement,代碼行數:44,代碼來源:scan.py


注:本文中的cyclopean_instrument.CyclopeanInstrument類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。