@@ -50,7 +50,8 @@ def read_indexed_array(
50
50
s , e = idx_con [0 ]
51
51
e = arr_idx [e ]
52
52
s = arr_idx [s ]
53
- fin .seek (I4 * int (s - e0 ), os .SEEK_CUR )
53
+ _log .warning (f"{ arr_idx .dtype } s={ s } , e={ e } , e0={ e0 } ," )
54
+ fin .seek (I4 * (int (s ) - e0 ), os .SEEK_CUR )
54
55
return np .fromfile (fin , count = int (e - s ), dtype = np .int32 ), int (e ) - int (
55
56
arr_idx [- 1 ]
56
57
)
@@ -59,9 +60,9 @@ def read_indexed_array(
59
60
for s , e in idx_con :
60
61
e = arr_idx [e ]
61
62
s = arr_idx [s ]
62
- fin .seek (I4 * int (s - e0 ), os .SEEK_CUR )
63
+ fin .seek (I4 * ( int (s ) - e0 ), os .SEEK_CUR )
63
64
ans .append (np .frombuffer (fin .read (int (e - s ) * I4 ), dtype = np .int32 ))
64
- e0 = e
65
+ e0 = int ( e )
65
66
return (
66
67
np .concatenate (ans ) if len (ans ) > 0 else np .array ([], np .int32 ),
67
68
int (e0 ) - int (arr_idx [- 1 ]),
@@ -77,8 +78,11 @@ def read_patterns(
77
78
) -> tuple [npt .NDArray [np .uint32 ], npt .NDArray [np .uint32 ], npt .NDArray [np .int32 ]]:
78
79
seek_start = PatternsSOneEMC .HEADER_BYTES + I4 * (len (ones_idx ) - 1 ) * 2
79
80
fin .seek (seek_start )
81
+ _log .warning ("CP0 ones" )
80
82
place_ones , e0 = read_indexed_array (fin , idx_con , ones_idx , 0 )
83
+ _log .warning (f"CP0 place_multi e0 { e0 } " )
81
84
place_multi , e0 = read_indexed_array (fin , idx_con , multi_idx , e0 )
85
+ _log .warning (f"CP0 count_multi e0 { e0 } " )
82
86
count_multi , e0 = read_indexed_array (fin , idx_con , multi_idx , e0 )
83
87
fin .seek (I4 * (- e0 ), os .SEEK_CUR )
84
88
if fin .read (1 ):
0 commit comments