Skip to content
Snippets Groups Projects
Commit a4feaf28 authored by Max Jaeschke's avatar Max Jaeschke Committed by Dmitri Naumov
Browse files

Black formatting for pre commit

parent 442c8b2e
No related branches found
No related tags found
No related merge requests found
......@@ -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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment