Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:07

0001 #!/usr/bin/env python 
0002 import os, numpy as np, logging
0003 log = logging.getLogger(__name__)
0004 
0005 
0006 def rng_sequence(base):
0007     fold = os.path.expandvars(base)
0008     symbols = "abcdefghijklmnopqrstuvwxyz"
0009     names = sorted(os.listdir(fold))
0010 
0011     arrs = []
0012     for i, name in enumerate(names):
0013         sym = symbols[i]
0014         path = os.path.join(fold, name)
0015         arr = np.load(path)
0016         arrs.append(arr)
0017         msg = "%3s %20s %s" % (sym, str(arr.shape), path) 
0018         print(msg)
0019         globals()[sym] = arr 
0020     pass
0021     seq = np.concatenate(arrs) 
0022     globals()["seq"] = seq
0023 pass
0024 
0025 
0026 if __name__ == '__main__':
0027     #base = "/tmp/$USER/opticks/QSimTest/rng_sequence/rng_sequence_f_ni1000000_nj16_nk16_tranche100000"
0028     base = "$HOME/.opticks/precooked/QSimTest/rng_sequence/rng_sequence_f_ni1000000_nj16_nk16_tranche100000"
0029     rng_sequence(base) 
0030     print("seq.shape %s " % str(seq.shape))
0031 pass
0032 
0033