Exemple #1
0
 def test_subspace_fc_plot(self):
     fig = subspace_fc_plot(detector=self.detector,
                            stachans='all',
                            size=(10, 7),
                            show=False,
                            return_figure=True)
     return fig
Exemple #2
0
    def energy_capture(self, stachans='all', size=(10, 7), show=False):
        """
        Calculate the average percentage energy capture for this subspace.

        :return: Percentage energy capture
        :rtype: float
        """
        if show:
            return subspace_fc_plot(detector=self,
                                    stachans=stachans,
                                    size=size,
                                    show=show)
        percent_capture = 0
        if np.isinf(self.dimension):
            return 100
        for channel in self.sigma:
            fc = np.sum(channel[0:self.dimension]) / np.sum(channel)
            percent_capture += fc
        else:
            return 100 * (percent_capture / len(self.sigma))