# Get arrays from array splits = dm.get_splits(season=season, patch=patch, arrays=dm.array_freqs[args.array], srcfree=True) ivars = dm.get_splits_ivar(season=season, patch=patch, arrays=dm.array_freqs[args.array]) noise.plot(pout + "_splits", splits) noise.plot(pout + "_ivars", ivars) modlmap = splits.modlmap() n2d_flat = noise.get_n2d_data(splits, ivars, mask, coadd_estimator=coadd, flattened=True, plot_fname=pout + "_n2d_flat") del splits radial_pairs = [(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (0, 3), (3, 0)] if smooth: n2d_flat_smoothed = noise.smooth_ps( n2d_flat.copy(), dfact=dfact, radial_pairs=radial_pairs, plot_fname=pout + "_n2d_flat_smoothed", radial_fit_annulus=args.radial_fit_annulus) else: n2d_flat_smoothed = n2d_flat.copy() if args.no_off: n2d_flat_smoothed = noise.null_off_diagonals(n2d_flat_smoothed)
splits = enmap.enmap([dm.get_splits(q) for q in qid]) nsplits = dm.ainfo(args.qid, 'nsplits') # Get inverse variance map ivars = enmap.enmap([dm.get_ivars(q) for q in qid]) modlmap = splits.modlmap() if calc_covsqrt: flatstring = "un" if args.do_only_filter_noise else "" n2d_xflat = noise.get_n2d_data( splits, ivars, mask, coadd_estimator=coadd, flattened=not (args.do_only_filter_noise), plot_fname=pout + "_n2d_%sflat" % flatstring if args.debug else None, dtype=dm.dtype) # output 1D spectrum if args.debug: print('plotting 1D spectrum of n2d_xflat') plots.plot_1dspec(n2d_xflat, modlmap, pout, lmin=500) ncomps = n2d_xflat.shape[0] if ncomps == 1: npol = 1 else: npol = 3 if args.verbose:
mask = sints.get_act_mr3_crosslinked_mask(region) dm = sints.models['act_mr3'](region=mask, calibrated=True) splits = dm.get_splits(season=season, patch=patch, arrays=dm.array_freqs[array], srcfree=True) ivars = dm.get_splits_ivar(season=season, patch=patch, arrays=dm.array_freqs[array]) npower = noise.get_n2d_data(splits, ivars, mask, coadd_estimator=True, flattened=False, plot_fname=None, dtype=dm.dtype) ndown, nfitted, nparams = covtools.noise_average(npower[0, 0], dfact=(16, 16), lmin=300, lmax=8000, wnoise_annulus=500, bin_annulus=20, lknee_guess=3000, alpha_guess=-4, method="fft", radial_fit=True)