modlmap > args.fill_min, modlmap < (args.fill_min + args.radial_fit_annulus))].mean() if args.fill_min is not None: n2d_xflat_smoothed[:, :, modlmap < args.fill_min] = fill_val n2d_xflat_smoothed[:, :, modlmap < 2] = 0 # lmax cut if args.lmax is not None: n2d_xflat_smoothed[:, :, modlmap > args.lmax] = 0 # remove off diagonals if args.no_off: n2d_xflat_smoothed = noise.null_off_diagonals(n2d_xflat_smoothed) # output 1D spectrum if args.debug: print('plotting 1D spectrum of n2d_xflat_smoothed with filled values') plots.plot_1dspec(n2d_xflat_smoothed, modlmap, pout + '_smoothed_filled', lmin=500) if args.do_only_filter_noise: ngen.save_filter_noise(n2d_xflat_smoothed, season=args.season, patch=args.patch, array=args.array, coadd=coadd,
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) del n2d_flat covsqrt = noise.get_covsqrt(n2d_flat_smoothed, args.covsqrt_kind) del n2d_flat_smoothed ngen.save_covsqrt(covsqrt, season=season, patch=patch, array=args.array, coadd=coadd, mask_patch=mask_patch) if nsims > 0: bin_edges = np.arange(40, 8000, 40) p1ds = [] for i in range(nsims):