# Dump our settings if comm.rank == 0: config.save(root + "config.txt") with open(root + "args.txt", "w") as f: argstring = " ".join([pipes.quote(a) for a in sys.argv[1:]]) f.write(argstring + "\n") sys.stdout.write(argstring + "\n") sys.stdout.flush() with open(root + "env.txt", "w") as f: for k, v in os.environ.items(): f.write("%s: %s\n" % (k, v)) with open(root + "ids.txt", "w") as f: for id in ids: f.write("%s\n" % str(id)) shutil.copyfile(filedb.cjoin(["root", "dataset", "filedb"]), root + "filedb.txt") try: shutil.copyfile(filedb.cjoin(["root", "dataset", "todinfo"]), root + "todinfo.hdf") except (IOError, OSError): pass # Read in all our scans data = scanutils.read_scans_autobalance(ids, actscan.ACTScan, comm, filedb.data, dets=args.dets, downsample=down, sky_local=dist,
C = R.dot(C).dot(R.T) return np.array([C[0,0],C[1,1],C[0,1]]) utils.mkdir(args.odir) # Dump our settings if myid == 0: config.save(args.odir + "/config.txt") with open(args.odir + "/args.txt","w") as f: f.write(" ".join([pipes.quote(a) for a in sys.argv[1:]]) + "\n") with open(args.odir + "/env.txt","w") as f: for k,v in os.environ.items(): f.write("%s: %s\n" %(k,v)) with open(args.odir + "/ids.txt","w") as f: for id in filelist: f.write("%s\n" % id) shutil.copyfile(filedb.cjoin(["root","dataset","filedb"]), args.odir + "/filedb.txt") try: shutil.copyfile(filedb.cjoin(["root","dataset","todinfo"]), args.odir + "/todinfo.txt") except (IOError, OSError): pass # Set up logging utils.mkdir(args.odir + "/log") logfile = args.odir + "/log/log%03d.txt" % myid log_level = log.verbosity2level(config.get("verbosity")) L = log.init(level=log_level, file=logfile, rank=myid, shared=False) # And benchmarking utils.mkdir(args.odir + "/bench") benchfile = args.odir + "/bench/bench%03d.txt" % myid # Read our point source list params = pointsrcs.src2param(pointsrcs.read(args.srcs)) ntot = len(params) # Eliminate insignificant sources
root = args.odir + "/" + (args.prefix + "_" if args.prefix else "") # Dump our settings if comm.rank == 0: config.save(root + "config.txt") with open(root + "args.txt","w") as f: argstring = " ".join([pipes.quote(a) for a in sys.argv[1:]]) f.write(argstring + "\n") print argstring with open(root + "env.txt","w") as f: for k,v in os.environ.items(): f.write("%s: %s\n" %(k,v)) with open(root + "ids.txt","w") as f: for id in filelist: f.write("%s\n" % str(id)) shutil.copyfile(filedb.cjoin(["root","dataset","filedb"]), root + "filedb.txt") try: shutil.copyfile(filedb.cjoin(["root","dataset","todinfo"]), root + "todinfo.hdf") except IOError: pass # Set up logging utils.mkdir(root + "log") logfile = root + "log/log%03d.txt" % comm.rank log_level = log.verbosity2level(config.get("verbosity")) L = log.init(level=log_level, file=logfile, rank=comm.rank) # And benchmarking utils.mkdir(root + "bench") benchfile = root + "bench/bench%03d.txt" % comm.rank def parse_desc(desc, default={}): res = default.copy() # Parse normally now that the : are out of the way for tok in utils.split_outside(desc, ",", "[({", "])}"):
C = R.dot(C).dot(R.T) return np.array([C[0,0],C[1,1],C[0,1]]) utils.mkdir(args.odir) # Dump our settings if myid == 0: config.save(args.odir + "/config.txt") with open(args.odir + "/args.txt","w") as f: f.write(" ".join([pipes.quote(a) for a in sys.argv[1:]]) + "\n") with open(args.odir + "/env.txt","w") as f: for k,v in os.environ.items(): f.write("%s: %s\n" %(k,v)) with open(args.odir + "/ids.txt","w") as f: for id in filelist: f.write("%s\n" % id) shutil.copyfile(filedb.cjoin(["root","dataset","filedb"]), args.odir + "/filedb.txt") try: shutil.copyfile(filedb.cjoin(["root","dataset","todinfo"]), args.odir + "/todinfo.txt") except IOError: pass # Set up logging utils.mkdir(args.odir + "/log") logfile = args.odir + "/log/log%03d.txt" % myid log_level = log.verbosity2level(config.get("verbosity")) L = log.init(level=log_level, file=logfile, rank=myid, shared=False) # And benchmarking utils.mkdir(args.odir + "/bench") benchfile = args.odir + "/bench/bench%03d.txt" % myid # Read our point source list params = pointsrcs.src2param(pointsrcs.read(args.srcs)) ntot = len(params) # Eliminate insignificant sources
root = args.odir + "/" + (args.prefix + "_" if args.prefix else "") # Dump our settings if comm.rank == 0: config.save(root + "config.txt") with open(root + "args.txt","w") as f: argstring = " ".join([pipes.quote(a) for a in sys.argv[1:]]) f.write(argstring + "\n") print(argstring) with open(root + "env.txt","w") as f: for k,v in os.environ.items(): f.write("%s: %s\n" %(k,v)) with open(root + "ids.txt","w") as f: for id in filelist: f.write("%s\n" % str(id)) shutil.copyfile(filedb.cjoin(["root","dataset","filedb"]), root + "filedb.txt") try: shutil.copyfile(filedb.cjoin(["root","dataset","todinfo"]), root + "todinfo.hdf") except (IOError, OSError): pass # Set up logging utils.mkdir(root + "log") logfile = root + "log/log%03d.txt" % comm.rank log_level = log.verbosity2level(config.get("verbosity")) L = log.init(level=log_level, file=logfile, rank=comm.rank) # And benchmarking utils.mkdir(root + "bench") benchfile = root + "bench/bench%03d.txt" % comm.rank def parse_desc(desc, default={}): res = default.copy() # Parse normally now that the : are out of the way for tok in utils.split_outside(desc, ",", "[({", "])}"):