예제 #1
0
    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,
                        instruments,
                        scripts,
                        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']
예제 #2
0
    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())
예제 #3
0
    def __init__(self,
                 instruments=None,
                 name=None,
                 settings=None,
                 scripts=None,
                 log_function=None,
                 data_path=None):
        Script.__init__(self,
                        name,
                        settings=settings,
                        instruments=instruments,
                        scripts=scripts,
                        log_function=log_function,
                        data_path=data_path)

        self.data = {
            'baseline_image': [],
            'baseline_extent': [],
            'new_image': [],
            'new_image_extent': [],
            'initial_galvo_position': [],
            'shift': [],
            'correlation_image': []
        }

        self.baseline_processed_image = self.data['baseline_image']
        self.new_processed_image = self.data['new_image']
        self.count_executions = 0  # counts how often the script has been updated
예제 #4
0
    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()
        }
예제 #5
0
 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']
     })
예제 #6
0
    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': []
        }
예제 #7
0
    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 = {
            'plant_output': deque(maxlen=self.settings['buffer_length']),
            'control_output': deque(maxlen=self.settings['buffer_length'])
        }
예제 #8
0
    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())
예제 #9
0
    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()
예제 #10
0
 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)
예제 #11
0
 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)
    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
예제 #13
0
 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)
예제 #14
0
 def __init__(self, scripts, instruments = 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, instruments, scripts, log_function= log_function, data_path = data_path)
예제 #15
0
    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())
예제 #16
0
 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']
예제 #17
0
 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']})
예제 #18
0
 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)
예제 #19
0
    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': []}
    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)
예제 #21
0
    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)
예제 #22
0
    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()}
예제 #23
0
    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()
예제 #24
0
 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']
예제 #25
0
 def __init__(self, scripts, instruments = 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, instruments, scripts, log_function= log_function, data_path = data_path)
     #always want to use the autofocus's location
     self.scripts['find_NV'].settings['center_on_current_location'] = True
     self.scripts['set_laser'].settings['point'] = self.scripts['take_image'].settings['point_a']
     self.scripts['set_laser'].run()
 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)
예제 #27
0
    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())
예제 #28
0
    def __init__(self,
                 scripts,
                 name=None,
                 settings=None,
                 log_function=None,
                 timeout=1000000000,
                 data_path=None):

        Script.__init__(self,
                        name,
                        scripts=scripts,
                        settings=settings,
                        log_function=log_function,
                        data_path=data_path)
예제 #29
0
    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)
예제 #30
0
    def __init__(self, instruments = None, name = None, settings = None, scripts = None, log_function = None, data_path = None):
        Script.__init__(self, name, settings = settings, instruments = instruments, scripts = scripts, log_function= log_function, data_path = data_path)

        self.data = {'baseline_image': [],
                     'baseline_extent':[],
                     'new_image': [],
                     'new_image_extent': [],
                     'initial_galvo_position':[],
                     'shift': [],
                     'correlation_image': []
                     }

        self.baseline_processed_image = self.data['baseline_image']
        self.new_processed_image = self.data['new_image']
        self.count_executions = 0 # counts how often the script has been updated
예제 #31
0
    def __init__(self,
                 instruments=None,
                 name=None,
                 settings=None,
                 log_function=None,
                 data_path=None):
        """
        Default script initialization
        """

        Script.__init__(self,
                        name,
                        settings=settings,
                        instruments=instruments,
                        log_function=log_function,
                        data_path=data_path)
예제 #32
0
 def __init__(self, scripts, instruments = 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
     """
     self.scan_label = 'Piezo Voltage [V]'
     try:
         Script.__init__(self, name, settings, instruments, scripts, log_function= log_function, data_path = data_path)
     except:
         import sys
         import traceback
         exc_type, exc_value, exc_traceback = sys.exc_info()
         print("*** print_exception:")
         traceback.print_exception(exc_type, exc_value, exc_traceback,
                                   limit=2, file=sys.stdout)
예제 #33
0
    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
예제 #34
0
    def __init__(self,
                 instruments=None,
                 scripts=None,
                 name=None,
                 settings=None,
                 log_function=None,
                 data_path=None):
        """
        Select points by clicking on an image
        """
        Script.__init__(self,
                        name,
                        settings=settings,
                        instruments=instruments,
                        scripts=scripts,
                        log_function=log_function,
                        data_path=data_path)

        self.last_execution = None
예제 #35
0
    def __init__(self,
                 scripts,
                 name=None,
                 settings=None,
                 log_function=None,
                 data_path=None):
        """
        Default script initialization
        """
        Script.__init__(self,
                        name,
                        scripts=scripts,
                        settings=settings,
                        log_function=log_function,
                        data_path=data_path)
        self.iterator_type = self.get_iterator_type(self.settings, scripts)

        self._current_subscript_stage = None

        self._skippable = True
예제 #36
0
 def __init__(self,
              instruments=None,
              scripts=None,
              name=None,
              settings=None,
              log_function=None,
              data_path=None):
     """
     Select points by clicking on an image
     """
     Script.__init__(self,
                     name,
                     settings=settings,
                     instruments=instruments,
                     scripts=scripts,
                     log_function=log_function,
                     data_path=data_path)
     self.text = []
     self.patch_collection = None
     self.plot_settings = {}
예제 #37
0
    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)
예제 #38
0
 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']
예제 #39
0
    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)
예제 #40
0
    def __init__(self,
                 instruments,
                 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

        '''
        Script.__init__(self,
                        name,
                        settings=settings,
                        instruments=instruments,
                        log_function=log_function,
                        data_path=data_path)
예제 #41
0
 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']
 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)
예제 #43
0
    def __init__(self, scripts, name = None, settings = None, log_function = None, timeout = 1000000000, data_path = None):

        Script.__init__(self, name, scripts = scripts, settings=settings, log_function=log_function, data_path = data_path)