File indexing completed on 2026-04-10 07:49:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 """
0022 optickscore-/tests/IndexerTest
0023 ================================
0024
0025 GPU and CPU indices mismatch
0026 -----------------------------
0027
0028 Maybe a stable sort type of issue.
0029
0030 In any case discrepancies are all in the low frequency of occurence tail,
0031 so probably acceptable.
0032
0033 ::
0034
0035 seqhis
0036 [[ 28 29]
0037 [ 22 23]
0038 [ 23 22]
0039 [ 32 255]
0040 [ 23 22]
0041 [ 28 29]
0042 [255 32]
0043 [ 31 30]
0044 [ 22 23]
0045 [ 23 22]
0046 [ 31 30]
0047 [ 23 22]
0048 [ 23 22]
0049 [ 22 23]
0050 [ 22 23]
0051 [ 31 30]
0052 [ 29 31]
0053 [ 23 22]
0054 [ 32 255]
0055 [ 22 23]
0056 [255 32]
0057 [ 22 23]
0058 [ 28 29]
0059 [ 22 23]
0060 [ 23 22]
0061 [ 29 31]
0062 [ 30 28]
0063 [ 30 28]
0064 [ 30 28]
0065 [ 29 31]]
0066
0067 """
0068 import os, logging, numpy as np
0069 log = logging.getLogger(__name__)
0070
0071 from opticks.ana.ana import Evt
0072
0073 def compare(a, b):
0074 return np.vstack([a,b]).T[a != b]
0075
0076
0077 if __name__ == '__main__':
0078
0079 typ = "torch"
0080 tag = "4"
0081 det = "dayabay"
0082 cat = "PmtInBox"
0083
0084 evt = Evt(tag=tag, src=typ, det=cat)
0085 print evt
0086 ps = np.load("/tmp/phosel.npy")
0087
0088 print "seqhis\n", compare(evt.ps[:,0,0], ps[:,0,0])
0089 print "seqmat\n", compare(evt.ps[:,0,1], ps[:,0,1])
0090
0091
0092
0093