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, shared=True) # Set up our geometry shape, wcs = enmap.read_map_geometry(args.area) shape = (ncomp, ) + shape[-2:] msys = config.get("map_sys") dist = config.get("map_dist") # Filter parameters filter_fknee = 0.2 filter_alpha = -3 # Get our tod list filedb.init() ids = todinfo.get_tods(args.sel, filedb.scans) # 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))
parser.add_argument("--nsub", type=int, default=2) parser.add_argument("--i0", type=int, default=None) parser.add_argument("--i1", type=int, default=None) parser.add_argument("--p0", type=int, default=0) parser.add_argument("-g,", "--group", type=int, default=1) parser.add_argument("--dedark", action="store_true") parser.add_argument("--demode", action="store_true") parser.add_argument("--decommon", action="store_true") parser.add_argument("-c", "--cont", action="store_true") args = parser.parse_args() filedb.init() comm_world = mpi.COMM_WORLD comm_group = comm_world.Split(comm_world.rank%args.nsub, comm_world.rank/args.nsub) comm_sub = comm_world.Split(comm_world.rank/args.nsub, comm_world.rank%args.nsub) ids = todinfo.get_tods(args.sel, filedb.scans) tol = args.tol*utils.arcmin daz = args.daz*utils.arcmin dtype = np.float32 if config.get("map_bits") == 32 else np.float64 tods_per_map = args.group utils.mkdir(args.odir) root = args.odir + "/" + (args.prefix + "_" if args.prefix else "") # Set up logging utils.mkdir(root + "log") logfile = root + "log/log%03d.txt" % comm_world.rank log_level = log.verbosity2level(config.get("verbosity")) L = log.init(level=log_level, file=logfile, rank=comm_world.rank, shared=False) # Run through all tods to determine the scanning patterns L.info("Detecting scanning patterns")
parser.add_argument("odir") parser.add_argument("--ncomp", type=int, default=3) parser.add_argument("--ndet", type=int, default=0) parser.add_argument("--minamp", type=float, default=100) parser.add_argument("-c", action="store_true") parser.add_argument("--oldformat", action="store_true") args = parser.parse_args() dtype = np.float32 if config.get("map_bits") == 32 else np.float64 comm = mpi.COMM_WORLD myid = comm.rank nproc = comm.size filedb.init() db = filedb.data filelist = todinfo.get_tods(args.filelist, filedb.scans) def compress_beam(sigma, phi): c,s=np.cos(phi),np.sin(phi) R = np.array([[c,-s],[s,c]]) C = np.diag(sigma**-2) 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:
parser.add_argument("odir") parser.add_argument("prefix", nargs="?") parser.add_argument("-d", "--dump", type=int, default=10) parser.add_argument("--ncomp", type=int, default=3) parser.add_argument("--ndet", type=int, default=0) args = parser.parse_args() precon = config.get("map_precon") dtype = np.float32 if config.get("map_bits") == 32 else np.float64 comm = mpi4py.MPI.COMM_WORLD myid = comm.rank nproc = comm.size nmax = config.get("map_cg_nmax") db = filedb.ACTFiles(config.get("filedb")) filelist = todinfo.get_tods(args.filelist, config.get("todinfo")) area = enmap.read_map(args.area) area = enmap.zeros((args.ncomp, ) + area.shape[-2:], area.wcs, dtype) utils.mkdir(args.odir) root = args.odir + "/" + (args.prefix + "_" if args.prefix else "") # Dump our settings if myid == 0: config.save(root + "config.txt") with open(root + "args.txt", "w") as f: f.write(" ".join([pipes.quote(a) for a in sys.argv[1:]]) + "\n") 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: