Пример #1
0
        print('ncomps, npol =', ncomps, npol)

    # define ell mask
    mask_ell = args.rlmin - args.radial_fit_annulus
    del splits

    # smooth 2D power spectrum
    radial_pairs = [(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (0, 3),
                    (3, 0)] if not (args.no_prewhiten) else []
    if smooth:
        n2d_xflat_smoothed = noise.smooth_ps(
            n2d_xflat.copy(),
            dfact=dfact,
            radial_pairs=radial_pairs,
            plot_fname=pout +
            "_n2d_%sflat" % flatstring if args.debug else None,
            radial_fit_annulus=args.radial_fit_annulus,
            radial_fit_lmin=args.rlmin,
            fill_lmax=args.lmax,
            log=not (args.delta_ell is None),
            delta_ell=args.delta_ell,
            nsplits=nsplits)
    else:
        n2d_xflat_smoothed = n2d_xflat.copy()

    del n2d_xflat

    # output 1D spectrum for debug
    if args.debug:
        print('plotting 1D spectrum of n2d_xflat_smoothed')
        plots.plot_1dspec(n2d_xflat_smoothed,
                          modlmap,
Пример #2
0
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)
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)