示例#1
0
    def _update_plot(self, axes_list):
        # fit the data and set piezo to focus spot

        axis_focus, axis_image = axes_list

        # if take image is running we take the data from there otherwise we use the scripts own image data
        if self._current_subscript_stage['current_subscript'] is self.scripts['take_image']:
            if 'image_data' in self.scripts['take_image'].data:
                current_image = self.scripts['take_image'].data['image_data']
            else:
                current_image = None
        elif self._current_subscript_stage['current_subscript'] is self.scripts['take_image_2']:
            if 'image_data' in self.scripts['take_image_2'].data:
                current_image = self.scripts['take_image_2'].data['image_data']
            else:
                current_image = None
        else:
            current_image = self.data['current_image']

        if current_image is not None:
            update_fluorescence(current_image, axis_image)

        axis_focus, axis_image = axes_list

        update_fluorescence(self.data['current_image'], axis_image)

        focus_data = self.data['focus_function_result']
        focus_data_2 = self.data['focus_function_result_2']
        sweep_voltages = self.data['sweep_voltages']
        if len(focus_data) > 0:
            axis_focus.clear() #ER 20181016 - axis.hold removed from old version of matplotlib
            axis_focus.plot(sweep_voltages[0:len(focus_data)], focus_data, sweep_voltages[0:len(focus_data_2)], focus_data_2)
 def _update_plot(self, axes_list):
     """
     updates the galvo scan image
     Args:
         axes_list: list of axes objects on which to plot plots the esr on the first axes object
     """
     update_fluorescence(self.data['image_data'], axes_list[0], self.settings['max_counts_plot'])
示例#3
0
 def _update_plot(self, axes_list):
     """
     updates the galvo scan image
     Args:
         axes_list: list of axes objects on which to plot plots the esr on the first axes object
     """
     update_fluorescence(self.data['image_data'], axes_list[0],
                         self.settings['max_counts_plot'])
示例#4
0
 def _update_plot(self, axes_list):
     extent = [
         self.settings['inner_loop']['min_pos'],
         self.settings['inner_loop']['max_pos'],
         self.settings['outer_loop']['min_pos'],
         self.settings['outer_loop']['max_pos']
     ]
     update_fluorescence(self.data['counts'], axes_list[0])
示例#5
0
    def _update_plot(self, axes_list):
        """
        updates the galvo scan image
        Args:
            axes_list: list of axes objects on which to plot plots the esr on the first axes object
        """
        print(('axes list lenght update', len(axes_list)))

        update_fluorescence(self.data['image_data'], axes_list[0])

        self.scripts['get_spectrum']._plot([axes_list[1]], trace_only=True)
示例#6
0
    def _update_plot(self, axes_list):
        """
        updates the galvo scan image
        Args:
            axes_list: list of axes objects on which to plot plots the esr on the first axes object
        """
        print(('axes list lenght update', len(axes_list)))

        update_fluorescence(self.data['image_data'], axes_list[0])

        self.scripts['get_spectrum']._plot([axes_list[1]], trace_only = True)
示例#7
0
    def _update_plot(self, axes_list):
        # fit the data and set piezo to focus spot

        axis_focus, axis_image = axes_list

        # if take image is running we take the data from there otherwise we use the scripts own image data
        if self._current_subscript_stage['current_subscript'] is self.scripts['take_image']:
            if 'image_data' in self.scripts['take_image'].data:
                current_image = self.scripts['take_image'].data['image_data']
            else:
                current_image = None
        elif self._current_subscript_stage['current_subscript'] is self.scripts['take_image_2']:
            if 'image_data' in self.scripts['take_image_2'].data:
                current_image = self.scripts['take_image_2'].data['image_data']
            else:
                current_image = None
        else:
            current_image = self.data['current_image']

        if current_image is not None:
            update_fluorescence(current_image, axis_image)

        axis_focus, axis_image = axes_list

        update_fluorescence(self.data['current_image'], axis_image)

        focus_data = self.data['focus_function_result']
        focus_data_2 = self.data['focus_function_result_2']
        sweep_voltages = self.data['sweep_voltages']
        if len(focus_data) > 0:
            axis_focus.clear() #ER 20181016 - axis.hold removed from old version of matplotlib
            axis_focus.plot(sweep_voltages[0:len(focus_data)], focus_data, 'r', label='Fluorescence')
   #         axis_focus.hold(True)
            axis_focus.plot(sweep_voltages[0:len(focus_data_2)], focus_data_2, 'g', label='Reflection')
            axis_focus.legend()
    #        axis_focus.hold(False)

        axis_focus.set_xlabel('Piezo Voltage [V]')

        if self.settings['focusing_optimizer'] == 'mean':
            ylabel = 'Image Mean [kcounts]'
        elif self.settings['focusing_optimizer'] == 'standard_deviation':
            ylabel = 'Image Standard Deviation [kcounts]'
        elif self.settings['focusing_optimizer'] == 'normalized_standard_deviation':
            ylabel = 'Image Normalized Standard Deviation [arb]'
        else:
            ylabel = self.settings['focusing_optimizer']

        axis_focus.set_ylabel(ylabel)
        axis_focus.set_title('Autofocusing Routine')
示例#8
0
    def _update_plot(self, axes_list):
        """
        updates the galvo scan image
        Args:
            axes_list: list of axes objects on which to plot plots the esr on the first axes object
        """
        print(('axes list lenght update', len(axes_list)))

        update_fluorescence(self.data['image_data'], axes_list[0])

        last_data = self.data['point_data'][-1]
        dt = self.data['meta_data']['xincrement']
        freq, psd = power_spectral_density(last_data, dt)
        plot_psd(freq, psd, axes_list[1], y_scaling='log', x_scaling='log')
        axes_list[1].hold(False)
示例#9
0
    def _update_plot(self, axes_list):
        """
        updates the galvo scan image
        Args:
            axes_list: list of axes objects on which to plot plots the esr on the first axes object
        """
        print(('axes list lenght update', len(axes_list)))

        update_fluorescence(self.data['image_data'], axes_list[0])

        last_data = self.data['point_data'][-1]
        dt = self.data['meta_data']['xincrement']
        freq, psd = power_spectral_density(last_data, dt)
        plot_psd(freq, psd, axes_list[1], y_scaling='log', x_scaling='log')
        axes_list[1].hold(False)
示例#10
0
    def _update_plot(self, axes_list):
        '''
        Plots the newly taken galvo scan to axis 2, and the correlation image to axis 1
        Args:
            axes_list: list of axes to plot to. Uses two axes.

        '''
        if self.scripts['GalvoScan'].is_running:
            self.scripts['GalvoScan']._update_plot(axes_list)
        else:
            if not self.data['new_image'] == [] and not self.data['image_extent'] == []:
                data = self.data['new_image']
                update_fluorescence(data, axes_list[1])
                if not self.data['correlation_image'] == []:
                    axes_list[0].imshow(self.data['correlation_image'])
            else:
                self.scripts['GalvoScan']._update_plot(axes_list)
示例#11
0
    def _update_plot(self, axes_list):
        '''
        Plots the newly taken galvo scan to axis 2, and the correlation image to axis 1
        Args:
            axes_list: list of axes to plot to. Uses two axes.

        '''
        if self.scripts['GalvoScan'].is_running:
            self.scripts['GalvoScan']._update_plot(axes_list)
        else:
            if not self.data['new_image'] == [] and not self.data[
                    'image_extent'] == []:
                data = self.data['new_image']
                update_fluorescence(data, axes_list[1])
                if not self.data['correlation_image'] == []:
                    axes_list[0].imshow(self.data['correlation_image'])
            else:
                self.scripts['GalvoScan']._update_plot(axes_list)
示例#12
0
 def _update_plot(self, axes_list):
     update_fluorescence(self.data['counts'], axes_list[0])