# Scans through the indicated tods and computes the ratio # between the power at mid and high frequency to determine # how white the white noise floor it. Cuts detectors that # aren't white enough. Also cuts detectors that have suspiciously # low white noise floors. import numpy as np, argparse, h5py, os, sys, shutil from enlib import fft, utils, enmap, errors, config, mpi, todfilter from enact import filedb, actdata, filters config.default( "gfilter_jon_nhwp", 200, "The number of hwp modes to fit/subtract in Jon's polynomial ground filter." ) parser = config.ArgumentParser(os.environ["HOME"] + "/.enkirc") parser.add_argument("sel") parser.add_argument("odir") parser.add_argument("-f", type=str, default="10:1,100:1") parser.add_argument("-R", type=str, default="0.5:3") parser.add_argument( "--max-sens", type=float, default=20, help= "Reject detectors more than this times more sensitive than the median at any of the indicated frequencies. Set to 0 to disable." ) parser.add_argument("--full-stats", action="store_true") args = parser.parse_args() comm = mpi.COMM_WORLD srate = 400.
config.default( "verbosity", 1, "Verbosity for output. Higher means more verbose. 0 outputs only errors etc. 1 outputs INFO-level and 2 outputs DEBUG-level messages." ) config.default("tod_window", 5.0, "Number of samples to window the tod by on each end") config.default( "eig_limit", 0.1, "Pixel condition number below which polarization is dropped to make total intensity more stable. Should be a high value for single-tod maps to avoid thin stripes with really high noise" ) config.default( "map_sys", "equ", "The coordinate system of the maps. Can be eg. 'hor', 'equ' or 'gal'.") config.default("map_dist", False, "Whether to use distributed maps") parser = config.ArgumentParser() parser.add_argument("sel", help="TOD selction query") parser.add_argument("area", help="Geometry to map") parser.add_argument("odir", help="Output directory") parser.add_argument("prefix", nargs="?", help="Output file name prefix") parser.add_argument("--dets", type=str, default=0, help="Detector slice") args = parser.parse_args() utils.mkdir(args.odir) comm = mpi.COMM_WORLD dtype = np.float32 if config.get("map_bits") == 32 else np.float64 ncomp = 3 tsize = 720 root = args.odir + "/" + (args.prefix + "_" if args.prefix else "") down = config.get("downsample") # Set up logging