示例#1
0
    def change_plot(self):
        # Selected values
        node = self.tree_selected
        n = self.perturbations_table.selection_index

        # Don't change the plot under certain conditions
        if not isinstance(node, tb.Array):
            return 

        if len(node) != len(self.perturbations_table.table_data):
            return 

        # Read in the energy array
        if 'hi_res' in node._v_pathname:
            E_g = self.rx_h5.root.hi_res.energy.read()
        else:
            E_g = np.array(self.rx_h5.root.energy[n])

        # Read in the data value
        data = np.array(node[n])

        # Confirm that the data is graphable
        if data.shape == ():
            return 

        if len(E_g) != len(data) + 1:
            return 

        # Plot the data
        self.plot = stairstep_plot(E_g, data, node._v_pathname)
示例#2
0
 def _plot_default(self):
     E_g = np.array([0.1, 1.0])
     data = np.array([1.0])
     return stairstep_plot(E_g, data, "No Data Selected")