Example #1
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 = {
            'frequency': [],
            'x': [],
            'y': [],
            'phase': [],
            'r': []
        }.keys()
Example #2
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
Example #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
Example #4
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': []
        }
Example #5
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
     """
     print('LOADING')
     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)
     print('LOADED')
Example #6
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()
Example #7
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)
        # 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']
Example #8
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)
Example #9
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)
Example #10
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']
Example #11
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 =  {'frequency' : [], 'x' : [], 'y' : [], 'phase': [], 'r':[]}.keys()
Example #12
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'])}
Example #13
0
    def __init__(self,
                 scripts,
                 name=None,
                 settings=None,
                 log_function=None,
                 timeout=1000000000,
                 data_path=None):

        Script.__init__(self,
                        name,
                        settings=settings,
                        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):
     Script.__init__(self,
                     name,
                     settings=settings,
                     scripts=scripts,
                     instruments=instruments,
                     log_function=log_function,
                     data_path=data_path)
Example #15
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)
    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 = {'temperature': deque()}
Example #17
0
    def __init__(self,
                 scripts,
                 name=None,
                 settings=None,
                 instruments=None,
                 log_function=None,
                 timeout=1000000000,
                 data_path=None):

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

        self.scripts['scan_z'].update({'scan_axes': 'z'})
        self.scripts['scan_z'].update({'RoI_mode': 'center'})
    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
Example #19
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)
Example #20
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)
     self.azimuth_controller = self.instruments['KDC101']['instance']
Example #21
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)
 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']['instance']
     elif self.settings['daq_type'] == 'cDAQ':
         self.daq_out = self.instruments['NI9263']['instance']
Example #23
0
    def __init__(self, instruments, name = None, settings = None, log_function = None, data_path = None):
        Script.__init__(self, name, settings, instruments, log_function= log_function, data_path = data_path)

        self.data = deque()