File indexing completed on 2026-04-09 07:49:05
0001
0002 """
0003 lambertian_direction.py
0004 ==========================================
0005 ::
0006
0007 EYE=-1,-1,1 LOOK=0,0,0.5 PARA=1 ./QSimTest.sh ana
0008
0009
0010 """
0011 import os, numpy as np
0012 from opticks.ana.fold import Fold
0013 MODE = int(os.environ.get("MODE","0"))
0014 if MODE in [2,3]:
0015 from opticks.ana.pvplt import *
0016 import pyvista as pv
0017 pass
0018
0019 TEST = os.environ["TEST"]
0020 GUI = not "NOGUI" in os.environ
0021
0022 if __name__ == '__main__':
0023 t = Fold.Load(symbol="t")
0024 print(repr(t))
0025
0026 q = t.q
0027
0028 lim = slice(0,10000)
0029
0030 print( " TEST : %s " % TEST)
0031 print( "q.shape %s " % str(q.shape) )
0032
0033
0034 if MODE == 3:
0035 print(" using lim for plotting %s " % lim )
0036
0037 label = TEST
0038 pl = pvplt_plotter(label=label)
0039
0040
0041 pvplt_viewpoint( pl )
0042 pl.add_points( q[:,:3][lim] )
0043
0044
0045 outpath = os.path.expandvars("$FOLD/figs/%s.png" % label )
0046 outdir = os.path.dirname(outpath)
0047 if not os.path.isdir(outdir):
0048 os.makedirs(outdir)
0049 pass
0050
0051 print(" outpath: %s " % outpath )
0052 cp = pl.show(screenshot=outpath) if GUI else None
0053
0054 pass
0055 pass
0056
0057