Commit 1edab368 authored by Hagen-Henrik Kowalski's avatar Hagen-Henrik Kowalski
Browse files

Added referencing for base calculations

parent f64ca59f
import numpy as np import numpy as np
from fnmatch import fnmatch
import os import os
import argparse import argparse
import setup_paths import setup_paths
...@@ -17,6 +18,17 @@ metaInfoEnv, warns = loadJsonFile(filePath=metaInfoPath, ...@@ -17,6 +18,17 @@ metaInfoEnv, warns = loadJsonFile(filePath=metaInfoPath,
extraArgsHandling=InfoKindEl.ADD_EXTRA_ARGS, extraArgsHandling=InfoKindEl.ADD_EXTRA_ARGS,
uri=None) uri=None)
def prep_ref(ref_listP, ref_listS, Emit, kindP, kindS):
sCalc = Emit.openSection("section_calculation_to_calculation_refs")
for ref in ref_listP:
Emit.addValue("calculation_to_calculation_kind", kindP)
Emit.addValue("calculation_to_calculation_external_url", ref)
for ref in ref_listS:
Emit.addValue("calculation_to_calculation_kind", kindS)
Emit.addValue("calculation_to_calculation_external_url", ref)
Emit.closeSection("section_calculation_to_calculation_refs", sCalc)
def parse(name): def parse(name):
Parse = JsonParseEventsWriterBackend(metaInfoEnv) Parse = JsonParseEventsWriterBackend(metaInfoEnv)
Parse.startedParsingSession(name, parser_info) Parse.startedParsingSession(name, parser_info)
...@@ -26,10 +38,11 @@ def parse(name): ...@@ -26,10 +38,11 @@ def parse(name):
Parse.addValue("x_qhp_formula", material) Parse.addValue("x_qhp_formula", material)
Parse.closeSection("section_system", system) Parse.closeSection("section_system", system)
results = Parse.openSection("section_single_configuration_calculation") results = Parse.openSection("section_single_configuration_calculation")
fref = Parse.openSection("section_calculation_to_calculation_refs") #fref = Parse.openSection("section_calculation_to_calculation_refs")
Parse.addValue("calculation_to_calculation_kind", "source_folder") #Parse.addValue("calculation_to_calculation_kind", "source_folder")
Parse.addValue("calculation_to_calculation_external_url", refname) #Parse.addValue("calculation_to_calculation_external_url", refname)
Parse.closeSection("section_calculation_to_calculation_refs", fref) #Parse.closeSection("section_calculation_to_calculation_refs", fref)
prep_ref(Phonon_path, Static_path, Parse, "source_phonon_calculations", "source_static_calculations")
frameSeq = Parse.openSection("section_frame_sequence") frameSeq = Parse.openSection("section_frame_sequence")
Parse.addArrayValues("frame_sequence_local_frames_ref", np.array([results])) Parse.addArrayValues("frame_sequence_local_frames_ref", np.array([results]))
sTD = Parse.openSection("section_thermodynamical_properties") sTD = Parse.openSection("section_thermodynamical_properties")
...@@ -64,6 +77,19 @@ if __name__ == '__main__': ...@@ -64,6 +77,19 @@ if __name__ == '__main__':
material = str(line.split()[-3]) material = str(line.split()[-3])
name = args.mainFileUri name = args.mainFileUri
refname = name.split("Quasi-harmonic_properties.txt")[0] refname = name.split("Quasi-harmonic_properties.txt")[0]
#cwd_ref = os.getcwd(refname)
con_ref = os.listdir(mainDir)
Phonon_path = []
Static_path = []
for con in con_ref:
if fnmatch(con, "Phonon*"):
for sub in os.listdir("%s/%s" % (refname, con)):
if fnmatch(sub, "phonopy-FHI-aims-displacement*"):
Phonon_path.append("%s/%s/%s/%s.out" % (refname,con,sub,sub))
elif fnmatch(con, "Murn_data"):
for sub in os.listdir("%s/%s" % (refname, con)):
if fnmatch(sub, "aims*"):
Static_path.append("%s/%s/%s" % (refname,con,sub))
T, V, alpha, B, Free, cV = np.loadtxt("Quasi-harmonic_properties.txt").T T, V, alpha, B, Free, cV = np.loadtxt("Quasi-harmonic_properties.txt").T
cV = kBoltzmann * cV cV = kBoltzmann * cV
cubAtocubm = convert_unit_function('angstrom**3', 'meter**3') cubAtocubm = convert_unit_function('angstrom**3', 'meter**3')
......
Markdown is supported
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