Пример #1
0
    def add_xray_lines_markers(self, xray_lines):
        """
        Add marker on a spec.plot() with the name of the selected X-ray
        lines

        Parameters
        ----------
        xray_lines: list of string
            A valid list of X-ray lines
        """

        line_energy = []
        intensity = []
        for xray_line in xray_lines:
            element, line = utils_eds._get_element_and_line(xray_line)
            line_energy.append(self._get_line_energy(xray_line))
            relative_factor = elements_db[element][
                'Atomic_properties']['Xray_lines'][line]['weight']
            a_eng = self._get_line_energy(element + '_' + line[0] + 'a')
            intensity.append(self.isig[a_eng].data * relative_factor)
        for i in range(len(line_energy)):
            line = markers.vertical_line_segment(
                x=line_energy[i], y1=None, y2=intensity[i] * 0.8)
            self.add_marker(line, render_figure=False)
            string = (r'$\mathrm{%s}_{\mathrm{%s}}$' %
                      utils_eds._get_element_and_line(xray_lines[i]))
            text = markers.text(
                x=line_energy[i], y=intensity[i] * 1.1, text=string,
                rotation=90)
            self.add_marker(text, render_figure=False)
            self._xray_markers[xray_lines[i]] = [line, text]
            line.events.closed.connect(self._xray_marker_closed)
            text.events.closed.connect(self._xray_marker_closed)
        self._render_figure(plot=['signal_plot'])
Пример #2
0
    def add_xray_lines_markers(self, xray_lines):
        """
        Add marker on a spec.plot() with the name of the selected X-ray
        lines

        Parameters
        ----------
        xray_lines: list of string
            A valid list of X-ray lines
        """

        line_energy = []
        intensity = []
        for xray_line in xray_lines:
            element, line = utils_eds._get_element_and_line(xray_line)
            line_energy.append(self._get_line_energy(xray_line))
            relative_factor = elements_db[element]['Atomic_properties'][
                'Xray_lines'][line]['weight']
            a_eng = self._get_line_energy(element + '_' + line[0] + 'a')
            intensity.append(self.isig[a_eng].data * relative_factor)
        for i in range(len(line_energy)):
            line = markers.vertical_line_segment(x=line_energy[i],
                                                 y1=None,
                                                 y2=intensity[i] * 0.8)
            self.add_marker(line)
            string = (r'$\mathrm{%s}_{\mathrm{%s}}$' %
                      utils_eds._get_element_and_line(xray_lines[i]))
            text = markers.text(x=line_energy[i],
                                y=intensity[i] * 1.1,
                                text=string,
                                rotation=90)
            self.add_marker(text)
            self._xray_markers[xray_lines[i]] = [line, text]
            line.events.closed.connect(self._xray_marker_closed)
            text.events.closed.connect(self._xray_marker_closed)
Пример #3
0
    def add_xray_lines_markers(self, xray_lines, render_figure=True):
        """
        Add marker on a spec.plot() with the name of the selected X-ray
        lines

        Parameters
        ----------
        xray_lines: list of string
            A valid list of X-ray lines
        """

        line_energy = []
        intensity = []
        for xray_line in xray_lines:
            element, line = utils_eds._get_element_and_line(xray_line)
            line_energy.append(self._get_line_energy(xray_line))
            relative_factor = elements_db[element]['Atomic_properties'][
                'Xray_lines'][line]['weight']
            a_eng = self._get_line_energy(f'{element}_{line[0]}a')
            idx = self.axes_manager.signal_axes[0].value2index(a_eng)
            intensity.append(self.data[..., idx] * relative_factor)
        for i in range(len(line_energy)):
            line = markers.vertical_line_segment(x=line_energy[i],
                                                 y1=None,
                                                 y2=intensity[i] * 0.8)
            self.add_marker(line, render_figure=False)
            string = (r'$\mathrm{%s}_{\mathrm{%s}}$' %
                      utils_eds._get_element_and_line(xray_lines[i]))
            text = markers.text(x=line_energy[i],
                                y=intensity[i] * 1.1,
                                text=string,
                                rotation=90)
            self.add_marker(text, render_figure=False)
            self._xray_markers[xray_lines[i]] = [line, text]
            line.events.closed.connect(self._xray_marker_closed)
            text.events.closed.connect(self._xray_marker_closed)
        if render_figure:
            self._render_figure(plot=['signal_plot'])