There is a maintenance of MPCDF Gitlab on Thursday, April 22st 2020, 9:00 am CEST - Expect some service interruptions during this time

added parser DOS

parent e5b8e50d
import xml.sax
import logging
class DosHandler(xml.sax.handler.ContentHandler):
def __init__(self, backend):
self.backend = backend
self.dosSectionGIndex = -1
self.inDos = False
def endDocument(self):
pass
def startElement(self, name, attrs):
if name == "dos":
self.dosSectionGIndex = self.backend.openSection("x_exciting_section_dos")
self.inDos = True
elif name == "point" and self.inDos:
self.backend.addValue("x_exciting_dos_value",float(attrs.getValue('dos')))
self.backend.addValue("x_exciting_dos_energy",float(attrs.getValue('e')))
# attrDict={}
# for name in attrs.getNames():
# attrDict[name] = attrs.getValue(name)
# logging.error("start element %s attr %s", name, attrDict)
def endElement(self, name):
if name == 'dos':
self.inDos = False
self.backend.closeSection("x_exciting_section_dos",self.dosSectionGIndex)
self.dosSectionGIndex = -1
# logging.error("end element %s", name)
def startElementNS(self, name, qname, attrs):
attrDict={}
for name in attrs.getNames():
attrDict[name] = attrs.getValue(name)
logging.error("start element %s ns %s attr %s", name, qname, attrDict)
def endElementNS(self, name, qname):
logging.error("end element %s ns %s", name, qname)
def characters(self, content):
pass
def parseDos(inF, backend):
handler = DosHandler(backend)
logging.error("will parse")
xml.sax.parse(inF, handler)
logging.error("did parse")
[{
"type": "nomad_parse_events_1_0",
"mainFileUri": "file://../../test/examples/GaAs/INFO.OUT",
"parserInfo": {
"name":"Elk"
},
"events": [{
"event":"openSection",
"gIndex":0,
"metaName":"section_run"
}, {
"event":"openSection",
"gIndex":0,
"metaName":"section_method"
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"program_version",
"value":"4.0.15"
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"program_basis_set_type",
"value":"(L)APW+lo"
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"program_name",
"value":"elk"
}, {
"event":"openSection",
"gIndex":0,
"metaName":"section_system"
}, {
"event":"openSection",
"gIndex":0,
"metaName":"x_elk_section_lattice_vectors"
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_lattice_vector_x",
"value":2.827658425215145e-10
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_lattice_vector_y",
"value":2.827658425215145e-10
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_lattice_vector_z",
"value":0.0
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_lattice_vector_x",
"value":2.827658425215145e-10
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_lattice_vector_y",
"value":0.0
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_lattice_vector_z",
"value":2.827658425215145e-10
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_lattice_vector_x",
"value":0.0
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_lattice_vector_y",
"value":2.827658425215145e-10
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_lattice_vector_z",
"value":2.827658425215145e-10
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"simulation_cell",
"value":[
[
2.827658425215145e-10,
2.827658425215145e-10,
0.0
],
[
2.827658425215145e-10,
0.0,
2.827658425215145e-10
],
[
0.0,
2.827658425215145e-10,
2.827658425215145e-10
]
]
}, {
"event":"closeSection",
"gIndex":0,
"metaName":"x_elk_section_lattice_vectors"
}, {
"event":"openSection",
"gIndex":0,
"metaName":"x_elk_section_reciprocal_lattice_vectors"
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_reciprocal_lattice_vector_x",
"value":11110226841.696657
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_reciprocal_lattice_vector_y",
"value":11110226841.696657
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_reciprocal_lattice_vector_z",
"value":-11110226841.696657
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_reciprocal_lattice_vector_x",
"value":11110226841.696657
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_reciprocal_lattice_vector_y",
"value":-11110226841.696657
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_reciprocal_lattice_vector_z",
"value":11110226841.696657
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_reciprocal_lattice_vector_x",
"value":-11110226841.696657
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_reciprocal_lattice_vector_y",
"value":11110226841.696657
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_reciprocal_lattice_vector_z",
"value":11110226841.696657
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_simulation_reciprocal_cell",
"value":[
[
11110226841.696657,
11110226841.696657,
-11110226841.696657
],
[
11110226841.696657,
-11110226841.696657,
11110226841.696657
],
[
-11110226841.696657,
11110226841.696657,
11110226841.696657
]
]
}, {
"event":"closeSection",
"gIndex":0,
"metaName":"x_elk_section_reciprocal_lattice_vectors"
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_unit_cell_volume",
"value":4.521794644902194e-29
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_brillouin_zone_volume",
"value":5.485658525754647e+30
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_atom_labels",
"value":"Ga"
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_muffin_tin_radius",
"value":1.2111825846962275e-10
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_muffin_tin_points",
"value":497
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_atom_number",
"value":"1"
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_atom_positions_x",
"value":0.0
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_atom_positions_y",
"value":0.0
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_atom_positions_z",
"value":0.0
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_atom_labels",
"value":"As"
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_muffin_tin_radius",
"value":1.2111825846962275e-10
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_muffin_tin_points",
"value":497
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_atom_number",
"value":"1"
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_atom_positions_x",
"value":1.322943026675e-11
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_atom_positions_y",
"value":1.322943026675e-11
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_geometry_atom_positions_z",
"value":1.322943026675e-11
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_number_kpoint_x",
"value":4
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_number_kpoint_y",
"value":4
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_number_kpoint_z",
"value":4
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_kpoint_offset_x",
"value":0.5
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_kpoint_offset_y",
"value":0.5
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_kpoint_offset_z",
"value":0.5
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_number_kpoints",
"value":20
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_rgkmax",
"value":3.70424047469e-10
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_gkmax",
"value":57794754391.024345
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_gmaxvr",
"value":226767135054.9394
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_gvector_size_x",
"value":30
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_gvector_size_y",
"value":30
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_gvector_size_z",
"value":30
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_gvector_total",
"value":8873
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_lmaxapw",
"value":8
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_nuclear_charge",
"value":-64.0
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_core_charge",
"value":36.0
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_valence_charge",
"value":28.0
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_electronic_charge",
"value":64.0
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_wigner_radius",
"value":1.04411007
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_empty_states",
"value":8
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_valence_states",
"value":23
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_core_states",
"value":36
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_lo",
"value":29
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_smearing_width",
"value":4.359743940000001e-19
}, {
"event":"addArrayValues",
"flatValues":[
true,
true,
true
],
"gIndex":-1,
"metaName":"configuration_periodic_dimensions",
"valuesShape":[
3
]
}, {
"event":"closeSection",
"gIndex":0,
"metaName":"section_system"
}, {
"event":"openSection",
"gIndex":0,
"metaName":"section_single_configuration_calculation"
}, {
"event":"openSection",
"gIndex":0,
"metaName":"section_scf_iteration"
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_fermi_energy_scf_iteration",
"value":4.530334567465577e-19
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"energy_sum_eigenvalues_scf_iteration",
"value":-1.0587324815035128e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"electronic_kinetic_energy_scf_iteration",
"value":1.8699206079776878e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_core_electron_kinetic_energy_scf_iteration",
"value":1.7344928741100222e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_coulomb_energy_scf_iteration",
"value":-3.636366408302897e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_coulomb_potential_energy_scf_iteration",
"value":-2.8381471017426835e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_nuclear_nuclear_energy_scf_iteration",
"value":-1.9015940652939077e-15
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_electron_nuclear_energy_scf_iteration",
"value":-4.054266901804329e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_hartree_energy_scf_iteration",
"value":6.080599000286431e-15
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_madelung_energy_scf_iteration",
"value":-2.2172928574315558e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"energy_XC_potential_scf_iteration",
"value":-9.05059877402612e-16
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_exchange_energy_scf_iteration",
"value":-6.822152812135417e-16
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_correlation_energy_scf_iteration",
"value":-1.361718537796743e-17
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_electron_entropic_energy_scf_iteration",
"value":-1.8633973037575367e-18
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"energy_total_scf_iteration",
"value":-1.8360290469851233e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_dos_fermi_scf_iteration",
"value":3.402698455267535e+16
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_indirect_gap_scf_iteration",
"value":2.424591884340468e-18
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_direct_gap_scf_iteration",
"value":3.0857173812961615e-18
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_core_charge_scf_iteration",
"value":36.0
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_valence_charge_scf_iteration",
"value":28.0
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_interstitial_charge_scf_iteration",
"value":3.216153569
}, {
"event":"closeSection",
"gIndex":0,
"metaName":"section_scf_iteration"
}, {
"event":"openSection",
"gIndex":1,
"metaName":"section_scf_iteration"
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_fermi_energy_scf_iteration",
"value":4.928703345174187e-19
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"energy_sum_eigenvalues_scf_iteration",
"value":-1.0584670671110853e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"electronic_kinetic_energy_scf_iteration",
"value":1.8701675091883265e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_core_electron_kinetic_energy_scf_iteration",
"value":1.7344196042228485e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_coulomb_energy_scf_iteration",
"value":-3.636354965117308e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_coulomb_potential_energy_scf_iteration",
"value":-2.8381277044048237e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_nuclear_nuclear_energy_scf_iteration",
"value":-1.9015940652939077e-15
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_electron_nuclear_energy_scf_iteration",
"value":-4.05426341277101e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_hartree_energy_scf_iteration",
"value":6.0806785418091345e-15
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_madelung_energy_scf_iteration",
"value":-2.2172911129148958e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"energy_XC_potential_scf_iteration",
"value":-9.050687189240846e-16
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_exchange_energy_scf_iteration",
"value":-6.82219764172565e-16
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_correlation_energy_scf_iteration",
"value":-1.3618003209253903e-17
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_electron_entropic_energy_scf_iteration",
"value":-4.001825220412249e-18
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"energy_total_scf_iteration",
"value":-1.835771232668362e-14
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_dos_fermi_scf_iteration",
"value":7.516134653999886e+16
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_indirect_gap_scf_iteration",
"value":2.355470350202202e-18
}, {
"event":"addValue",
"gIndex":-1,
"metaName":"x_elk_direct_gap_scf_iteration",