File indexing completed on 2026-04-09 07:48:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 """
0022 tevt.py : Loads a single event
0023 ===================================================
0024
0025 Expected output below shows the dimensions of the constitent numpy arrays that comprise the event::
0026
0027 Evt(-4,"torch","PmtInBox","PmtInBox/torch/-4 : ", seqs="[]")
0028 fdom : (3, 1, 4) : (metadata) 3*float4 domains of position, time, wavelength (used for compression)
0029 idom : (1, 1, 4) : (metadata) int domain
0030 ox : (100000, 4, 4) : (photons) final photon step
0031 wl : (100000,) : (photons) wavelength
0032 post : (100000, 4) : (photons) final photon step: position, time
0033 dirw : (100000, 4) : (photons) final photon step: direction, weight
0034 polw : (100000, 4) : (photons) final photon step: polarization, wavelength
0035 flags : (100000,) : (photons) final photon step: flags
0036 c4 : (100000,) : (photons) final photon step: dtype split uint8 view of ox flags
0037 rx_raw : (100000, 10, 2, 4) : (records) photon step records RAW:before reshaping
0038 rx : (100000, 10, 2, 4) : (records) photon step records
0039 ph : (100000, 1, 2) : (records) photon history flag/material sequence
0040 ps : (100000, 1, 4) : (photons) phosel sequence frequency index lookups (uniques 30)
0041 rs : (100000, 10, 1, 4) : (records) RAW recsel sequence frequency index lookups (uniques 30)
0042 rsr : (100000, 10, 1, 4) : (records) RESHAPED recsel sequence frequency index lookups (uniques 30)
0043
0044
0045 """
0046 import os, sys, logging, numpy as np
0047 log = logging.getLogger(__name__)
0048
0049 from opticks.ana.base import opticks_main
0050 from opticks.ana.evt import Evt
0051
0052 if __name__ == '__main__':
0053 args = opticks_main(tag="10",src="torch", det="PmtInBox", doc=__doc__)
0054 np.set_printoptions(suppress=True, precision=3)
0055
0056 for utag in args.utags:
0057 try:
0058 evt = Evt(tag=utag, src=args.src, det=args.det, seqs=[], args=args)
0059 except IOError as err:
0060 log.fatal(err)
0061 sys.exit(args.mrc)
0062
0063 log.debug("evt")
0064 print evt
0065 log.debug("evt.history_table")
0066 evt.history_table(slice(0,20))
0067 log.debug("evt.history_table DONE")
0068
0069