Commit e8002fcb authored by Pardini, Lorenzo (lopa)'s avatar Pardini, Lorenzo (lopa)
Browse files

fixed small bug in parser bandstructure

parent fe893445
......@@ -52,13 +52,16 @@ class BandHandler(xml.sax.handler.ContentHandler):
self.backend.addValue("x_exciting_band_vertex_coordinates", self.vertexCoord)
self.backend.addValue("x_exciting_band_k_points",self.distance[-1])
if not self.spinTreat:
self.energySpin[0] = self.energy[0:bands]
self.energySpin[1] = self.energy[0:bands]
self.backend.addValue("x_exciting_band_number_of_eigenvalues",bands)
self.backend.addArrayValues("x_exciting_band_energies",np.asarray([self.energy]))
self.backend.addValue("x_exciting_band_energies",self.energySpin)
# print("self.energySpin=",self.energySpin)
else:
self.energySpin[0] = self.energy[0:bands2]
self.energySpin[1] = self.energy[bands2:bands]
self.backend.addValue("x_exciting_band_number_of_eigenvalues",bands2)
self.backend.addArrayValues("x_exciting_band_energies",np.asarray(self.energy))
self.backend.addValue("x_exciting_band_energies",self.energySpin)
def startElementNS(self, name, qname, attrs):
attrDict={}
......
......@@ -95,7 +95,7 @@ class ExcitingParserContext(object):
# exciting_parser_input.parseInput(f, backend)
if os.path.exists(dosFile):
with open(dosFile) as f:
exciting_parser_dos.parseDos(f, backend)
exciting_parser_dos.parseDos(f, backend, self.spinTreat)
if os.path.exists(bandFile):
with open(bandFile) as g:
exciting_parser_bandstructure.parseBand(g, backend, self.spinTreat)
......@@ -136,17 +136,27 @@ class ExcitingParserContext(object):
eigvalVal[-1].append(fromH(float(e)))
eigvalOcc[-1].append(float(occ))
if not self.spinTreat:
backend.addArrayValues("eigenvalues_values", np.asarray([eigvalVal]))
backend.addArrayValues("eigenvalues_occupation", np.asarray([eigvalOcc]))
for i in range(0,nkpt):
eigvalValSpin[0].append(eigvalVal[i][0:nstsv])
eigvalOccSpin[0].append(eigvalOcc[i][0:nstsv])
eigvalValSpin[1].append(eigvalVal[i][0:nstsv])
eigvalOccSpin[1].append(eigvalOcc[i][0:nstsv])
# backend.addArrayValues("eigenvalues_values", np.asarray(eigvalValSpin))
# backend.addArrayValues("eigenvalues_occupation", np.asarray(eigvalOccSpin))
backend.addValue("eigenvalues_values", eigvalValSpin)
backend.addValue("eigenvalues_occupation", eigvalOccSpin)
else:
for i in range(0,nkpt):
eigvalValSpin[0].append(eigvalVal[i][0:nstsv2])
eigvalOccSpin[0].append(eigvalOcc[i][0:nstsv2])
eigvalValSpin[1].append(eigvalVal[i][nstsv2:nstsv])
eigvalOccSpin[1].append(eigvalOcc[i][nstsv2:nstsv])
backend.addArrayValues("eigenvalues_values", np.asarray(eigvalValSpin))
backend.addArrayValues("eigenvalues_occupation", np.asarray(eigvalOccSpin))
backend.addArrayValues("eigenvalues_kpoints", np.asarray(eigvalKpoint))
backend.addValue("eigenvalues_values", eigvalValSpin)
backend.addValue("eigenvalues_occupation", eigvalOccSpin)
backend.addValue("eigenvalues_kpoints", eigvalKpoint)
# backend.addArrayValues("eigenvalues_values", np.asarray(eigvalValSpin))
# backend.addArrayValues("eigenvalues_occupation", np.asarray(eigvalOccSpin))
# backend.addArrayValues("eigenvalues_kpoints", np.asarray(eigvalKpoint))
backend.closeSection("section_eigenvalues",eigvalGIndex)
##########################Parsing Fermi surface##################
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment