From 81554856967c1d85fc248dd1efed438391856d9b Mon Sep 17 00:00:00 2001 From: Giovanni La Mura <giovanni.lamura@inaf.it> Date: Thu, 3 Apr 2025 14:49:54 +0200 Subject: [PATCH] Ensure that DEDFB type index for groups of spheres is larger than the index of the first sphere in the group --- src/scripts/model_maker.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/scripts/model_maker.py b/src/scripts/model_maker.py index 9705290e..10b10d0f 100755 --- a/src/scripts/model_maker.py +++ b/src/scripts/model_maker.py @@ -523,15 +523,22 @@ def write_legacy_sconf(conf): else: str_line = "{0:.3E} {1:.3E}\n".format(conf['xi_start'], conf['xi_step']) output.write(str_line) - sphere_count = 0 + sphere_line_count = 0 + placed_spheres = 0 + last_type = 0 + dedfb_type = 0 for si in range(nsph): - str_line = "{0:5d}".format(conf['vec_types'][si]) + if (conf['vec_types'][si] > last_type): + dedfb_type = placed_spheres + 1 + last_type = conf['vec_types'][si] + str_line = "{0:5d}".format(dedfb_type) output.write(str_line) - sphere_count += 1 - if (sphere_count == 16): + sphere_line_count += 1 + placed_spheres += 1 + if (sphere_line_count == 16): output.write("\n") - sphere_count = 0 - if (sphere_count != 0): + sphere_line_count = 0 + if (sphere_line_count != 0): output.write("\n") for ci in range(conf['configurations']): layers = conf['nshl'][ci] -- GitLab