From d1a0ba6fec2bbc0501ce302d385b62b35f7aba68 Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Tue, 6 Jun 2023 13:51:38 +0200 Subject: [PATCH] Fix for gamma with the new data format Fix #57 --- pyzebra/ccl_io.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyzebra/ccl_io.py b/pyzebra/ccl_io.py index e655769..b6d001f 100644 --- a/pyzebra/ccl_io.py +++ b/pyzebra/ccl_io.py @@ -221,10 +221,12 @@ def parse_1D(fileobj, data_type): dataset.append({**metadata, **scan}) elif data_type == ".dat": - # TODO: this might need to be adapted in the future, when "gamma_angle" will be added to dat files - # This happen in April 2023 if metadata["zebra_mode"] == "nb": - metadata["gamma_angle"] = metadata["twotheta"] + if "gamma_angle" in metadata: + # support for the new format + metadata["gamma"] = metadata["gamma_angle"] + else: + metadata["gamma"] = metadata["twotheta"] scan = defaultdict(list) scan["export"] = True