File indexing completed on 2026-04-09 07:49:07
0001
0002 """
0003 reflect_specular_cf.py
0004 ===================================
0005
0006 Specular does not depend on the random stream, so no surprise get perfect match.
0007
0008 ::
0009
0010 In [3]: np.where( np.abs( a[:,:,:3] - b[:,:,:3] ) > 2e-5 )
0011 Out[3]: (array([], dtype=int64), array([], dtype=int64), array([], dtype=int64))
0012
0013
0014
0015 """
0016 import os, numpy as np
0017
0018 def eprint( expr, lprefix="", rprefix="", tail="" ):
0019 ret = eval(expr)
0020 lhs = "%s%s" % (lprefix, expr)
0021 rhs = "%s%s" % (rprefix, ret )
0022 print("%-50s : %s%s" % ( lhs, rhs, tail ) )
0023 return ret
0024
0025 def epr(arg, **kwa):
0026 p = arg.find("=")
0027 if p > -1:
0028 var_eq = arg[:p+1]
0029 expr = arg[p+1:]
0030 label = var_eq
0031 else:
0032 label, expr = "", arg
0033 pass
0034 return eprint(expr, lprefix=label, **kwa)
0035
0036
0037 a_key = "A_FOLD"
0038 b_key = "B_FOLD"
0039
0040 A_FOLD = os.environ[a_key]
0041 B_FOLD = os.environ[b_key]
0042 NPY_NAME = os.environ["NPY_NAME"]
0043
0044
0045 if __name__ == '__main__':
0046 print("a_key : %20s A_FOLD : %s" % ( a_key, A_FOLD) )
0047 print("b_key : %20s B_FOLD : %s" % ( b_key, B_FOLD) )
0048 a_path = os.path.join(A_FOLD, NPY_NAME)
0049 b_path = os.path.join(B_FOLD, NPY_NAME)
0050
0051 a = np.load(a_path)
0052 b = np.load(b_path)
0053 print("a.shape %10s : %s " % (str(a.shape), a_path) )
0054 print("b.shape %10s : %s " % (str(b.shape), b_path) )
0055
0056