本文整理汇总了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)
示例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)
示例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
示例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'])
示例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
示例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,
}
示例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()
示例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()
示例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()
示例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)
示例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()
示例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()
示例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
示例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')
示例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 = ()