Gives a CompleteDos object with the DOS from the interpolated
            projected band structure
            Args:
                the structure (necessary to identify sites for projection)
                analyzer_for_second_spin must be specified to have a
                CompleteDos with both Spin components
            Returns:
                a CompleteDos object
            Example of use in case of spin polarized case:

                BoltztrapRunner(bs=bs,nelec=10,run_type="DOS",spin=1).run(path_dir='dos_up/')
                an_up=BoltztrapAnalyzer.from_files("dos_up/boltztrap/",dos_spin=1)

                BoltztrapRunner(bs=bs,nelec=10,run_type="DOS",spin=-1).run(path_dir='dos_dw/')
                an_dw=BoltztrapAnalyzer.from_files("dos_dw/boltztrap/",dos_spin=-1)

                cdos=an_up.get_complete_dos(bs.structure,an_dw)

def get_complete_dos(self, structure, analyzer_for_second_spin=None):
        """
            Gives a CompleteDos object with the DOS from the interpolated
            projected band structure
            Args:
                the structure (necessary to identify sites for projection)
                analyzer_for_second_spin must be specified to have a
                CompleteDos with both Spin components
            Returns:
                a CompleteDos object
            Example of use in case of spin polarized case:

                BoltztrapRunner(bs=bs,nelec=10,run_type="DOS",spin=1).run(path_dir='dos_up/')
                an_up=BoltztrapAnalyzer.from_files("dos_up/boltztrap/",dos_spin=1)

                BoltztrapRunner(bs=bs,nelec=10,run_type="DOS",spin=-1).run(path_dir='dos_dw/')
                an_dw=BoltztrapAnalyzer.from_files("dos_dw/boltztrap/",dos_spin=-1)

                cdos=an_up.get_complete_dos(bs.structure,an_dw)

        """
        pdoss = {}
        spin_1 = list(self.dos.densities.keys())[0]

        if analyzer_for_second_spin:
            if not np.all(self.dos.energies ==
                                  analyzer_for_second_spin.dos.energies):
                raise BoltztrapError(
                    "Dos merging error: energies of the two dos are different")

            spin_2 = list(analyzer_for_second_spin.dos.densities.keys())[0]
            if spin_1 == spin_2:
                raise BoltztrapError(
                    "Dos merging error: spin component are the same")

        for s in self._dos_partial:
            if structure.sites[int(s)] not in pdoss:
                pdoss[structure.sites[int(s)]] = {}
            for o in self._dos_partial[s]:
                if Orbital[o] not in pdoss[structure.sites[int(s)]]:
                    pdoss[structure.sites[int(s)]][Orbital[o]] = {}
                pdoss[structure.sites[int(s)]][Orbital[o]][
                    spin_1] = self._dos_partial[s][o]
                if analyzer_for_second_spin:
                    pdoss[structure.sites[int(s)]][Orbital[o]][
                        spin_2] = analyzer_for_second_spin._dos_partial[s][o]
        if analyzer_for_second_spin:
            tdos = Dos(self.dos.efermi, self.dos.energies,
                       {spin_1: self.dos.densities[spin_1],
                        spin_2: analyzer_for_second_spin.dos.densities[
                            spin_2]})
        else:
            tdos = self.dos

        return CompleteDos(structure, total_dos=tdos, pdoss=pdoss)