diff --git a/Tests/Data/Parabolic/T/3D_Beier_sandbox/read_values_from_prj_curve.py b/Tests/Data/Parabolic/T/3D_Beier_sandbox/read_values_from_prj_curve.py index c487e1cb9f2495ff94b881932401f876de36f79a..9687f41ede65361d9e75e2792a7b37b2b6664f68 100644 --- a/Tests/Data/Parabolic/T/3D_Beier_sandbox/read_values_from_prj_curve.py +++ b/Tests/Data/Parabolic/T/3D_Beier_sandbox/read_values_from_prj_curve.py @@ -7,25 +7,27 @@ import numpy as np file = inspect.getfile(inspect.currentframe()) prj_path = os.path.split(os.path.realpath(file))[0] -#read prj-data -tree = ET.parse(prj_path + '/beier_sandbox.prj') +# read prj-data +tree = ET.parse(prj_path + "/beier_sandbox.prj") root = tree.getroot() -curve_elements = root.findall('.//curve') +curve_elements = root.findall(".//curve") for curve in curve_elements: - - curve_name = curve.find('name').text + curve_name = curve.find("name").text # read coordinates - coords_element = curve.find('coords') - coords_text = coords_element.text #replace("\n", " ") - coords_array = np.fromstring(coords_text, dtype=float, sep=' ') + coords_element = curve.find("coords") + coords_text = coords_element.text # replace("\n", " ") + coords_array = np.fromstring(coords_text, dtype=float, sep=" ") # Store array in binary format - coords_array.astype('<f8').tofile(prj_path + f'/{curve_name}_coords.bin') # < - little Endian | f - float | 8 - Bytes equal to 64bit(double) - + coords_array.astype("<f8").tofile( + prj_path + f"/{curve_name}_coords.bin" + ) # < - little Endian | f - float | 8 - Bytes equal to 64bit(double) # read values - values_element = curve.find('values') - values_text = values_element.text #replace("\n", " ") - values_array = np.fromstring(values_text, dtype=float, sep=' ') - values_array.astype('<f8').tofile(prj_path + f'/{curve_name}_values.bin') # < - little Endian | f - float | 8 - Bytes equal to 64bit(double) + values_element = curve.find("values") + values_text = values_element.text # replace("\n", " ") + values_array = np.fromstring(values_text, dtype=float, sep=" ") + values_array.astype("<f8").tofile( + prj_path + f"/{curve_name}_values.bin" + ) # < - little Endian | f - float | 8 - Bytes equal to 64bit(double)