Esempio n. 1
0
def write_settings(outdir):
    '''Store parameters for this run. '''

    if comm.Get_rank() == 0:
        config.save(opj(outdir, 'config.txt'))

        with open(opj(outdir, 'env.txt'), 'w') as f:
            for k, v in os.environ.items():
                f.write('{}: {}\n'.format(k, v))

        with open(opj(outdir, 'args.txt'), 'w') as f:
            argstring = " ".join([pipes.quote(a) for a in sys.argv[1:]])
            f.write(argstring + "\n")
Esempio n. 2
0
# 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))
    shutil.copyfile(filedb.cjoin(["root", "dataset", "filedb"]),
                    root + "filedb.txt")
    try:
        shutil.copyfile(filedb.cjoin(["root", "dataset", "todinfo"]),
Esempio n. 3
0
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:
		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"))
Esempio n. 4
0
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:
		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"))
Esempio n. 5
0
	return res

src_handling = parse_src_handling()

filedb.init()
db = filedb.data
filelist = todinfo.get_tods(args.filelist, filedb.scans)
if args.group_tods:
	filelist = scanutils.get_tod_groups(filelist)

utils.mkdir(args.odir)
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")