本文整理汇总了Python中pylabcontrol.core.Script类的典型用法代码示例。如果您正苦于以下问题:Python Script类的具体用法?Python Script怎么用?Python Script使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Script类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, name=None, settings=None, log_function = None, data_path = None):
"""
Example of a script
Args:
name (optional): name of script, if empty same as class name
settings (optional): settings for this script, if empty same as default settings
"""
Script.__init__(self, name, settings, log_function= log_function, data_path = data_path)
示例2: __init__
def __init__(self, instruments = None, scripts = None, name = None, settings = None, log_function = None, data_path = None):
"""
Example of a script that emits a QT signal for the gui
Args:
name (optional): name of script, if empty same as class name
settings (optional): settings for this script, if empty same as default settings
"""
Script.__init__(self, name, settings = settings, instruments = instruments, scripts = scripts, log_function= log_function, data_path = data_path)
示例3: __init__
def __init__(self, instruments, scripts=None, name=None, settings=None, log_function=None, data_path=None):
"""
init script function see superclass for details on the parameters
"""
Script.__init__(self, name, settings=settings, scripts=scripts, instruments=instruments,
log_function=log_function, data_path=data_path)
self.data = None
示例4: __init__
def __init__(self, scripts, instruments = None, name = None, settings = None, log_function = None, data_path = None):
"""
Initializes the script
Args:
name (optional): name of script, if empty same as class name
settings (optional): settings for this script, if empty same as default settings
"""
self.scan_label = 'Motor Position [um]'
Script.__init__(self, name, settings, instruments, scripts, log_function= log_function, data_path = data_path)
示例5: __init__
def __init__(self, instruments, scripts = None, name=None, settings=None, log_function=None, data_path = None):
Script.__init__(self, name, settings=settings, scripts=scripts, instruments=instruments, log_function=log_function, data_path = data_path)
# defines which daqs contain the input and output based on user selection of daq interface
if self.settings['daq_type'] == 'PCI':
self.daq_in = self.instruments['NI6259']['instance']
self.daq_out = self.instruments['NI6259']['instance']
elif self.settings['daq_type'] == 'cDAQ':
self.daq_in = self.instruments['NI9402']['instance']
self.daq_out = self.instruments['NI9263']['instance']
示例6: __init__
def __init__(self, instruments = None, scripts = None, name = None, settings = None, log_function = None, data_path = None):
"""
Sets up script and sends width and height settings to camera
Args:
name (optional): name of script, if empty same as class name
settings (optional): settings for this script, if empty same as default settings
"""
Script.__init__(self, name, settings = settings, instruments = instruments, scripts = scripts, log_function= log_function, data_path = data_path)
self.instruments['Camera']['instance'].update({'width': self.settings['width'], 'height': self.settings['height']})
示例7: __init__
def __init__(self, scripts, name = None, settings = None, log_function = None, timeout = 1000000000, data_path = None):
self._recording = False
self._timeout = timeout
Script.__init__(self, name, settings, scripts = scripts, log_function= log_function, data_path = data_path)
self.data = deque()
self._sweep_values = list({'frequency' : [], 'x' : [], 'y' : [], 'phase': [], 'r':[]}.keys())
示例8: __init__
def __init__(self, instruments = None, name = None, settings = None, scripts = None, log_function = None, data_path = None):
"""
Example of a script that emits a QT signal for the gui
Args:
name (optional): name of script, if empty same as class name
settings (optional): settings for this script, if empty same as default settings
"""
Script.__init__(self, name, settings = settings, instruments = instruments, scripts = scripts, log_function= log_function, data_path = data_path)
self.data = {'baseline_image': [], 'new_image': [], 'image_extent': [], 'correlation_image': []}
示例9: __init__
def __init__(self, instruments, scripts=None, name=None, settings=None, log_function=None, data_path=None):
"""
Example of a script that emits a QT signal for the gui
Args:
name (optional): name of script, if empty same as class name
settings (optional): settings for this script, if empty same as default settings
"""
Script.__init__(self, name, settings=settings, scripts=scripts, instruments=instruments,
log_function=log_function, data_path=data_path)
self.data = {'counts': deque(), 'laser_power': deque(), 'normalized_counts': deque(), 'laser_power2': deque()}
示例10: __init__
def __init__(self, instruments, name = None, settings = None, log_function = None, data_path = None):
"""
Example of a script that makes use of an instrument
Args:
instruments: instruments the script will make use of
name (optional): name of script, if empty same as class name
settings (optional): settings for this script, if empty same as default settings
"""
# call init of superclass
Script.__init__(self, name, settings, instruments, log_function= log_function, data_path = data_path)
示例11: __init__
def __init__(self, instruments, scripts, name=None, settings=None, log_function=None, data_path=None):
"""
Standard script initialization
Args:
name (optional): name of script, if empty same as class name
settings (optional): settings for this script, if empty same as default settings
"""
self._DEFAULT_SETTINGS += PulsedExperimentBaseScript._DEFAULT_SETTINGS
Script.__init__(self, name, settings=settings, scripts=scripts, instruments=instruments,
log_function=log_function, data_path=data_path)
示例12: __init__
def __init__(self, instruments, scripts=None, name=None, settings=None, log_function=None, data_path=None):
"""
Example of a script that emits a QT signal for the gui
Args:
name (optional): name of script, if empty same as class name
settings (optional): settings for this script, if empty same as default settings
"""
Script.__init__(self, name, settings=settings, scripts=scripts, instruments=instruments,
log_function=log_function, data_path=data_path)
self.data_to_plot = {'voltage': deque(maxlen = self.settings['max_len_to_plot'])}
self.data['voltage'] = list()
示例13: __init__
def __init__(self, instruments = None, scripts = None, name = None, settings = None, log_function = None, data_path = None):
"""
Example of a script that emits a QT signal for the gui
Args:
name (optional): name of script, if empty same as class name
settings (optional): settings for this script, if empty same as default settings
"""
Script.__init__(self, name, settings = settings, instruments = instruments, scripts = scripts, log_function= log_function, data_path = data_path)
if self.settings['daq_type'] == 'PCI':
self.daq_out = self.instruments['NI6259_laser_power']['instance']
elif self.settings['daq_type'] == 'cDAQ':
self.daq_out = self.instruments['NI9263_laser_power']['instance']
示例14: __init__
def __init__(self, scripts, name=None, settings=None, log_function=None, data_path=None):
'''
Initializes GalvoScan script for use in gui
Args:
instruments: list of instrument objects
name: name to give to instantiated script object
settings: dictionary of new settings to pass in to override defaults
log_function: log function passed from the gui to direct log calls to the gui log
data_path: path to save data
'''
self._DEFAULT_SETTINGS = self._DEFAULT_SETTINGS + GalvoScanGeneric._DEFAULT_SETTINGS
Script.__init__(self, name, settings=settings, scripts=scripts, log_function=log_function, data_path = data_path)
示例15: __init__
def __init__(self, instruments, name = None, settings = None, log_function = None, timeout = 1000000000, data_path = None):
self._recording = False
self._timeout = timeout
Script.__init__(self, name, settings, instruments, log_function= log_function, data_path = data_path)
self.sweeper = self.instruments['zihf2']['instance'].daq.sweep(self._timeout)
self.sweeper.set('sweep/device', self.instruments['zihf2']['instance'].device)
self.data = deque()
# todo: clean this up! and plot data in gui!
self._sweep_values = list({'frequency' : [], 'x' : [], 'y' : [], 'phase': [], 'r':[]}.keys())