From 93a557fea909e683e6d11c1adbc9fb37bd6be057 Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Mon, 8 Feb 2021 21:24:47 +0100 Subject: [PATCH] Assign default value of 0 to temp and mf --- pyzebra/ccl_io.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyzebra/ccl_io.py b/pyzebra/ccl_io.py index 29b0eca..834a27c 100644 --- a/pyzebra/ccl_io.py +++ b/pyzebra/ccl_io.py @@ -183,8 +183,9 @@ def parse_1D(fileobj, data_type): s["om"] = np.array(s["om"]) - if "mf" not in metadata: - print("Magnetic field is not present in dat file") + for param in ("mf", "temp"): + if param not in metadata: + s[param] = 0 s["n_points"] = len(s["om"]) s["monitor"] = s["Monitor1"][0]