Commit 25d51758 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Enable XI scale interpreter for np_cluster

parent b7431d86
Loading
Loading
Loading
Loading
+19 −6
Original line number Diff line number Diff line
@@ -155,6 +155,8 @@ def parse_legacy_oclu(config):

        # Define the quantities that you need to extract
        alam = 0.0
        vk = 0.0
        scaleOnXi = False

        # Read the output file preamble
        for i in range(2):
@@ -182,9 +184,20 @@ def parse_legacy_oclu(config):
        nphs = 1 if phsstep == 0.0 else 1 + int((phslast - phsfirst) / phsstep)
        ndirs = nthi * nths * nphi * nphs
        
        while ("JXI =" not in file_line):
            file_line = oclu_file.readline() # read the next OSPH file line
            if ("XI IS SCALE FACTOR FOR LENGTHS" in file_line):
                scaleOnXi = True
                vk = float(file_line[5:20].replace('D', 'E'))
        
        # Parsing loop until the end of the OCLU file
        while (file_line != ""):
            file_line = oclu_file.readline() # read the next OCLU file line
            if (scaleOnXi):
                if (file_line.startswith("  XI=")):
                    xi = float(file_line[5:20].replace('D', 'E'))
                    alam = 2.0 * math.pi * xi / vk
            else:
                if (file_line.startswith("  VK=")):
                    # we found VK, so we calculate lambda
                    # extract VK as a number from a string section, after