Exemplo n.º 1
0
    def test_plot_functions(self):
        """Testing plotting tools for phonons."""
        phbst_filename = abidata.ref_file("trf2_5.out_PHBST.nc")
        with abilab.abiopen(phbst_filename) as nc:
            phbands = nc.phbands

        phb_objects = [
            phbands,
            phbst_filename,
        ]

        phdos_filename = abidata.ref_file("trf2_5.out_PHDOS.nc")
        phdos = PhdosFile(phdos_filename)
        phdos_objects = [
            phdos,
            phdos_filename,
        ]

        if self.has_matplotlib():
            assert phbands_gridplot(phb_objects,
                                    titles=["phonons1", "phonons2"],
                                    phdos_objects=phdos_objects,
                                    units="meV",
                                    show=False)

        phdos.close()
Exemplo n.º 2
0
    def test_plot_functions(self):
        """Testing plotting tools for phonons."""
        if not self.has_matplotlib():
            raise unittest.SkipTest("matplotlib missing")

        phbst_filename = abidata.ref_file("trf2_5.out_PHBST.nc")
        from abipy import abilab
        with abilab.abiopen(phbst_filename) as nc:
            phbands = nc.phbands

        phb_objects = [
            phbands,
            phbst_filename,
        ]

        phdos_filename = abidata.ref_file("trf2_5.out_PHDOS.nc")
        phdos = PhdosFile(phdos_filename)
        phdos_objects = [
            phdos,
            phdos_filename,
        ]

        fig = phbands_gridplot(phb_objects,
                               titles=["phonons1", "phonons2"],
                               phdos_objects=phdos_objects,
                               show=False)
        assert fig is not None
        phdos.close()
Exemplo n.º 3
0
    def test_plot_functions(self):
        """Testing plotting tools for phonons."""
        phbst_filename = abidata.ref_file("trf2_5.out_PHBST.nc")
        with abilab.abiopen(phbst_filename) as nc:
            phbands = nc.phbands

        phb_objects = [
            phbands,
            phbst_filename,
        ]

        phdos_filename = abidata.ref_file("trf2_5.out_PHDOS.nc")
        phdos = PhdosFile(phdos_filename)
        phdos_objects = [
            phdos,
            phdos_filename,
        ]

        if self.has_matplotlib():
            assert phbands_gridplot(phb_objects, titles=["phonons1", "phonons2"],
                                    phdos_objects=phdos_objects, units="meV", show=False)

        phdos.close()