Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:48:51

0001 #!/usr/bin/env python
0002 """
0003 vtk_dgplt.py
0004 ==============
0005 
0006 OR give the directory as first argument::
0007 
0008     vtk_dgplt.py /tmp/blyth/opticks/G4OKTest/evt/g4live/natural/1/
0009 
0010 
0011 
0012 """
0013 import logging 
0014 log = logging.getLogger(__name__)
0015 import sys
0016 import numpy as np, os
0017 import pyvista as pv   
0018 
0019 if __name__ == '__main__':
0020     logging.basicConfig(level=logging.INFO)
0021     if len(sys.argv) > 1 and os.path.isdir(sys.argv[1]):
0022         os.chdir(sys.argv[1])
0023         log.info("chdir %s " % os.getcwd())
0024     pass
0025     np.set_printoptions(suppress=True, linewidth=200)
0026 
0027     name = "dg"
0028 
0029     a = np.load("%s.npy" % name)
0030     print(a)
0031 
0032     size = 2*np.array([1024,768], dtype=np.int32)
0033     pl = pv.Plotter(window_size=size)
0034     pl.add_points(a[:,0,:3] )
0035     pl.show_grid()
0036     log.info("Showing the VTK/pyvista plotter window, it may be hidden behind other windows. Enter q to quit.")
0037     cpos = pl.show()
0038     log.info(cpos)
0039 
0040 
0041 
0042