Add code for 1D detector #69

Merged
usov_i merged 118 commits from det1d into master 2020-10-22 12:07:50 +02:00
14 changed files with 775 additions and 818 deletions
Showing only changes of commit f79b4cbeee - Show all commits

View File

@ -31,14 +31,19 @@ def export_comm(data, path, lorentz=False):
with open(str(path + extension), "w") as out_file:
for keys, meas in data["Measurements"].items():
try:
if "fit" not in meas:
print("Measurement skipped - no fit value for:", keys)
continue
meas_number_str = f"{keys[1:]:{align}{padding[0]}}"
h_str = f'{int(meas["h_index"]):{padding[1]}}'
k_str = f'{int(meas["k_index"]):{padding[1]}}'
l_str = f'{int(meas["l_index"]):{padding[1]}}'
if meas["fit"]["export_fit"] is True:
area = float(meas["fit"]["g_amp"].value)
sigma_str = f'{"{:8.2f}".format(float(meas["fit"]["g_amp"].stderr)):{align}{padding[2]}}'
sigma_str = (
f'{"{:8.2f}".format(float(meas["fit"]["g_amp"].stderr)):{align}{padding[2]}}'
)
else:
area = float(meas["fit"]["int_area"].n)
sigma_str = (
@ -74,6 +79,3 @@ def export_comm(data, path, lorentz=False):
+ "\n"
)
out_file.write(line)
except KeyError:
print("Measurement skipped - no fit value for:", keys)