예제 #1
0
파일: scr.py 프로젝트: fgoudreault/abipy
    def plot_ggparams(self, **kwargs):
        plotter = ArrayPlotter(
            *[("$\\tilde\omega_{G G'}$",
               self.omegatw), ("$\\tilde\Omega^2_{G, G'}$",
                               self.bigomegatwsq)])

        return plotter.plot(**kwargs)
예제 #2
0
파일: gw.py 프로젝트: gmrigna/abipy
    def plot_eigvec_qp(self, spin, kpoint, band=None, **kwargs):

        if kpoint is None:
            from abipy.tools.plotting_utils import ArrayPlotter
            plotter = ArrayPlotter()
            for kpoint in self.ibz:
                ksqp_arr = self.reader.read_eigvec_qp(spin, kpoint, band=band)
                plotter.add_array(str(kpoint), ksqp_arr)

            fig = plotter.plot(**kwargs)

        else:
            from abipy.tools.plotting_utils import plot_array
            ksqp_arr = self.reader.read_eigvec_qp(spin, kpoint, band=band)

            fig = plot_array(ksqp_arr, **kwargs)

        return fig
예제 #3
0
파일: scr.py 프로젝트: fgoudreault/abipy
    def plot_ggmat(self, cplx_mode="abs", wpos=None, **kwargs):
        """
        Use imshow for plotting W_GG'.

        Args:
            cplx_mode:
            wpos: List of frequency indices to plot. If None, the first
                frequency is used (usually w=0). if wpos == "all" 
                all frequencies are shown (use it carefully)
                Other possible values: "real" if only real frequencies are wanted.
                "imag" for imaginary frequencies only.

        Returns:
            `matplotlib` figure.
        """
        # Get wpos indices.
        choice_wpos = {
            None: [0],
            "all": range(self.nw),
            "real": range(self.nrew),
            "imag": range(self.nrew, self.nw)
        }

        if any(wpos == k for k in choice_wpos):
            wpos = choice_wpos[wpos]
        else:
            if isinstance(wpos, int): wpos = [wpos]
            wpos = np.array(wpos)

        # Build plotter.
        plotter = ArrayPlotter()
        for iw in wpos:
            label = cplx_mode + " $\omega = %s" % self.wpts[iw]
            data = data_from_cplx_mode(cplx_mode, self.wggmat[iw, :, :])
            plotter.add_array(label, data)

        return plotter.plot(**kwargs)