コード例 #1
0
ファイル: scr.py プロジェクト: zbwang/abipy
    def windex(self, w, atol=0.001):
        """
        Find the index of the **closest** frequency in ``wpoints``.
        """
        if np.iscomplex(w):
            iw = bs_index(self.imag_wpoints.imag, w.imag, atol=atol)
            iw += self.nrew
        else:
            iw = bs_index(self.real_wpoints.real, w, atol=atol)

        return iw
コード例 #2
0
ファイル: scr.py プロジェクト: davidwaroquiers/abipy
    def windex(self, w, atol=0.001):
        """
        Find the index of the **closest** frequency in `wpts`.
        """
        if np.iscomplex(w):
            iw = bs_index(self.imag_wpts.imag, w, atol=atol)
            iw += self.nrew
        else:
            iw = bs_index(self.real_wpts.real, w, atol=atol)

        return iw