def _plot(self, axes_list, data=None):
        """
        Plot 1: self.data['tau'], the list of times specified for a given experiment, verses self.data['counts'], the data
        received for each time
        Plot 2: the pulse sequence performed at the current time (or if plotted statically, the last pulse sequence
        performed

        Args:
            axes_list: list of axes to write plots to (uses first 2)
            data (optional) dataset to plot (dictionary that contains keys counts, tau), if not provided use self.data
        """

#        if self.scripts['find_nv'].is_running: #self.scripts['find_nv'].data['maximum_point']:
#            # self.scripts['find_nv'].plot(axes_list)
#             self.scripts['find_nv']._plot(axes_list)
#             self._plot_refresh = True
#        else:
        if data is None:
            data = self.data

        if 'counts' in data.keys():
            # The following does not work for pulsedelays; you need to comment out the 'if' for it to work.
            # if counts != []:
            #     plot_1d_simple_timetrace_ns(axes_list[0], data['tau'], [data['counts'])
          #  print('plotting with tau values: ', data['tau'])
            plot_1d_simple_timetrace_ns(axes_list[0], data['tau'], [data['counts']])
            plot_pulses(axes_list[1], self.pulse_sequences[self.sequence_index])
Esempio n. 2
0
    def _plot_validate(self, axes_list):
        """
        Preview pulse sequence by plotting first and last sequence to plots 1 and 0, respectively
        Args:
            axes_list: List containing axes to plot to

        Returns:

        """
        axis0 = axes_list[0]
        axis1 = axes_list[1]

        pulse_sequences, tau_list, _ = self.create_pulse_sequences(
            logging=False)

        #  if pulse_sequences[0]:
        if pulse_sequences:
            plot_pulses(axis0, pulse_sequences[0])
            axis0.set_title(
                'Pulse Visualization for Minimum tau (tau = {:f} ns)'.format(
                    tau_list[0]))

            plot_pulses(axis1, pulse_sequences[-1])
            axis1.set_title(
                'Pulse Visualization for Maximum tau (tau = {:f} ns)'.format(
                    tau_list[-1]))
        else:
            print('no pulse sequences passed validation!!!')
Esempio n. 3
0
    def _plot(self, axes_list, data=None):
        """
        Plot 1: self.data['tau'], the list of times specified for a given experiment, verses self.data['counts'], the data
        received for each time
        Plot 2: the pulse sequence performed at the current time (or if plotted statically, the last pulse sequence
        performed

        Args:
            axes_list: list of axes to write plots to (uses first 2)
            data (optional) dataset to plot (dictionary that contains keys counts, tau), if not provided use self.data
        """

        #        if self.scripts['find_nv'].is_running: #self.scripts['find_nv'].data['maximum_point']:
        #            # self.scripts['find_nv'].plot(axes_list)
        #             self.scripts['find_nv']._plot(axes_list)
        #             self._plot_refresh = True
        #        else:
        if data is None:
            data = self.data

        if 'counts' in data.keys():
            # The following does not work for pulsedelays; you need to comment out the 'if' for it to work.
            # if counts != []:
            #     plot_1d_simple_timetrace_ns(axes_list[0], data['tau'], [data['counts'])
            #  print('plotting with tau values: ', data['tau'])
            plot_1d_simple_timetrace_ns(axes_list[0], data['tau'],
                                        [data['counts']])
            plot_pulses(axes_list[1],
                        self.pulse_sequences[self.sequence_index])
Esempio n. 4
0
    def _plot(self, axes_list, data=None):
        """
        Very similar to plot for PulseBlasterBaseScript but here deals with case where first plot has counts=[], using
        PulseBlasterBaseScript plot leads to errors
        Plot 1: self.data['tau'], the list of times specified for a given experiment, verses self.data['counts'], the data
        received for each time
        Plot 2: the pulse sequence performed at the current time (or if plotted statically, the last pulse sequence
        performed

        Args:
            axes_list: list of axes to write plots to (uses first 2)
            data (optional) dataset to plot (dictionary that contains keys counts, tau), if not provided use self.data
        """
        if data is None:
            data = self.data

        counts = data['counts']
        x_data = data['tau']
        axis1 = axes_list[0]
        plot_1d_simple_timetrace_ns(axis1, x_data, [counts])
        axis2 = axes_list[1]
        plot_pulses(axis2, self.pulse_sequences[self.sequence_index])
Esempio n. 5
0
    def _plot(self, axes_list, data=None):
        """
        Very similar to plot for PulseBlasterBaseScript but here deals with case where first plot has counts=[], using
        PulseBlasterBaseScript plot leads to errors
        Plot 1: self.data['tau'], the list of times specified for a given experiment, verses self.data['counts'], the data
        received for each time
        Plot 2: the pulse sequence performed at the current time (or if plotted statically, the last pulse sequence
        performed

        Args:
            axes_list: list of axes to write plots to (uses first 2)
            data (optional) dataset to plot (dictionary that contains keys counts, tau), if not provided use self.data
        """
        if data is None:
            data = self.data

        counts = data['counts']
        x_data = data['tau']
        axis1 = axes_list[0]
        plot_1d_simple_timetrace_ns(axis1, x_data, [counts])
        axis2 = axes_list[1]
        plot_pulses(axis2, self.pulse_sequences[self.sequence_index])
Esempio n. 6
0
    def _plot(self, axes_list, data=None):
        '''
        Plot 1: self.data['tau'], the list of times specified for a given experiment, verses self.data['counts'], the data
        received for each time
        Plot 2: the pulse sequence performed at the current time (or if plotted statically, the last pulse sequence
        performed

        Args:
            axes_list: list of axes to write plots to (uses first 2)
            data (optional) dataset to plot, if not provided use self.data
        '''
        if data is None:
            data = self.data

        mw_frequencies = data['mw_frequencies']
        esr_counts = data['esr_counts']
        axis1 = axes_list[0]
        if not esr_counts == []:
            counts = esr_counts
            plot_esr(axis1, mw_frequencies[0:len(counts)], counts)
            axis1.hold(False)
        axis2 = axes_list[1]
        plot_pulses(axis2, self.pulse_sequences[0])
Esempio n. 7
0
    def _plot(self, axes_list, data = None):
        '''
        Plot 1: self.data['tau'], the list of times specified for a given experiment, verses self.data['counts'], the data
        received for each time
        Plot 2: the pulse sequence performed at the current time (or if plotted statically, the last pulse sequence
        performed

        Args:
            axes_list: list of axes to write plots to (uses first 2)
            data (optional) dataset to plot, if not provided use self.data
        '''
        if data is None:
            data = self.data

        mw_frequencies = data['mw_frequencies']
        esr_counts = data['esr_counts']
        axis1 = axes_list[0]
        if not esr_counts == []:
            counts = esr_counts
            plot_esr(axis1, mw_frequencies[0:len(counts)], counts)
            axis1.hold(False)
        axis2 = axes_list[1]
        plot_pulses(axis2, self.pulse_sequences[0])
    def _plot_validate(self, axes_list):
        """
        Preview pulse sequence by plotting first and last sequence to plots 1 and 0, respectively
        Args:
            axes_list: List containing axes to plot to

        Returns:

        """
        axis0 = axes_list[0]
        axis1 = axes_list[1]

        pulse_sequences, tau_list, _ = self.create_pulse_sequences(logging=False)

      #  if pulse_sequences[0]:
        if pulse_sequences:
            plot_pulses(axis0, pulse_sequences[0])
            axis0.set_title('Pulse Visualization for Minimum tau (tau = {:f} ns)'.format(tau_list[0]))

            plot_pulses(axis1, pulse_sequences[-1])
            axis1.set_title('Pulse Visualization for Maximum tau (tau = {:f} ns)'.format(tau_list[-1]))
        else:
            print('no pulse sequences passed validation!!!')
Esempio n. 9
0
    def _plot(self, axes_list, data=None):
        '''
        Plot 1: self.data['tau'], the list of times specified for a given experiment, verses self.data['counts'], the data
        received for each time
        Plot 2: the pulse sequence performed at the current time (or if plotted statically, the last pulse sequence
        performed

        Args:
            axes_list: list of axes to write plots to (uses first 2)
            data (optional) dataset to plot (dictionary that contains keys counts_for_mw, mw_power_values), if not provided use self.data
        '''
        if data is None:
            data = self.data

        counts = data['counts_for_mw']
        x_data = data['mw_power_values']
        axis1 = axes_list[0]
        if not counts == []:
            plot_1d_simple_timetrace_ns(axis1,
                                        x_data, [counts],
                                        x_label='microwave power (dBm)')
        axis2 = axes_list[1]
        plot_pulses(axis2, self.pulse_sequences[self.sequence_index])