From 034fb49666a4de4fa051acd5b86fe20817f8721a Mon Sep 17 00:00:00 2001
From: Jonathan Wright <wright@esrf.fr>
Date: Wed, 22 Nov 2023 15:58:12 +0100
Subject: [PATCH] fixup fscan2d

---
 ImageD11/sinograms/assemble_label.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/ImageD11/sinograms/assemble_label.py b/ImageD11/sinograms/assemble_label.py
index 0fe0406e..335e0930 100644
--- a/ImageD11/sinograms/assemble_label.py
+++ b/ImageD11/sinograms/assemble_label.py
@@ -50,7 +50,12 @@ def harvest_masterfile( dset, outname,
         hout.attrs["h5input"] = dset.masterfile
         print("Harvesting",dset.masterfile,end=": ")
         with h5py.File(dset.masterfile, "r") as hin:
+            done = set()
             for scan in dset.scans:
+                if scan.find("::"):
+                    scan = scan.split("::")[0]
+                if scan in done:
+                    continue
                 gin = hin[scan]
                 bad = False
                 for check in ('title','measurement','measurement/'+dset.detector):
@@ -87,13 +92,14 @@ def harvest_masterfile( dset, outname,
                 g.attrs["shape0"] = frms.shape[1]
                 g.attrs["shape1"] = frms.shape[2]
                 print(scan, end=', ')
+                done.add(scan)
             print()
                         
         # Finished with master file. Now harvest the segmented files.
         idx = 0
         titles = ('row','col','intensity','nnz')
         print('Loading pixels:',end=' ')
-        for scan in dset.scans:
+        for scan in done:
             g = hout.require_group( scan )
             for name in 'row', 'col':
                 if name not in g: