File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -120,14 +120,16 @@ def normalize_by_monitor_integrated(
120120 )
121121 counts .masks [uuid4 ().hex ] = counts .data == sc .scalar (0.0 , unit = counts .unit )
122122 det_coord = detector .coords [dim ]
123- edge_dims = {
124- dim : size == det_coord .sizes [dim ] + 1 for dim , size in counts .sizes .items ()
125- }
123+ edge_dims = [
124+ dim
125+ for dim , size in counts .sizes .items ()
126+ if size + 1 == det_coord .sizes [dim ]
127+ ]
126128 if len (edge_dims ) != 1 :
127129 raise sc .CoordError (
128- f"Cannot determine edges of coordinate '{ dim } ' in detector data ."
130+ f"Cannot determine edge dimension of coordinate '{ dim } '."
129131 )
130- edge_dim = next ( iter ( edge_dims ))
132+ edge_dim = edge_dims [ 0 ]
131133 lo = counts .assign (det_coord [edge_dim , :- 1 ]).nanmin ().data
132134 hi = counts .assign (det_coord [edge_dim , 1 :]).nanmax ().data
133135
You can’t perform that action at this time.
0 commit comments