From 36faad1d9d3d9920ea7cd206b753492051291938 Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Fri, 12 Feb 2021 11:05:15 +0100 Subject: [PATCH] Export the same number of angles for nb and bi modes --- pyzebra/ccl_io.py | 4 ++-- pyzebra/ccl_process.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pyzebra/ccl_io.py b/pyzebra/ccl_io.py index a1eb448..abac05e 100644 --- a/pyzebra/ccl_io.py +++ b/pyzebra/ccl_io.py @@ -62,7 +62,7 @@ CCL_FIRST_LINE = (("idx", int), ("h", float), ("k", float), ("l", float)) CCL_ANGLES = { "bi": (("twotheta", float), ("omega", float), ("chi", float), ("phi", float)), - "nb": (("gamma", float), ("omega", float), ("nu", float)), + "nb": (("gamma", float), ("omega", float), ("nu", float), ("skip_angle", float)), } CCL_SECOND_LINE = ( @@ -135,7 +135,7 @@ def parse_1D(fileobj, data_type): # read data scan = [] if data_type == ".ccl": - ccl_first_line = (*CCL_FIRST_LINE, *CCL_ANGLES[metadata["zebra_mode"]]) + ccl_first_line = CCL_FIRST_LINE + CCL_ANGLES[metadata["zebra_mode"]] ccl_second_line = CCL_SECOND_LINE for line in fileobj: diff --git a/pyzebra/ccl_process.py b/pyzebra/ccl_process.py index e54b68b..695b0de 100644 --- a/pyzebra/ccl_process.py +++ b/pyzebra/ccl_process.py @@ -40,6 +40,10 @@ def _parameters_match(scan1, scan2): return False for param in ("ub", "temp", "mf", *(vars[0] for vars in CCL_ANGLES[zebra_mode])): + if param.startswith("skip"): + # ignore skip parameters, like the last angle in 'nb' zebra mode + continue + if param == scan1["variable_name"] == scan2["variable_name"]: # check if ranges of variable parameter overlap range1 = scan1["variable"]