survey_mask = so_map.read_map(d["survey_mask_%s_file_%s" %
                                            (exp, freq)])
            survey_mask.plot(file_name="%s/survey_mask_mask_%s_%s" %
                             (plot_dir, exp, freq))
            window.data[:] *= survey_mask.data[:]

        apo_radius_degree = (d["apo_radius_survey_%s" % exp])
        window = so_window.create_apodization(
            window,
            apo_type=d["apo_type_survey_%s" % exp],
            apo_radius_degree=apo_radius_degree)

        if d["pts_source_mask_%s" % exp] == True:
            hole_radius_arcmin = (d["source_mask_radius_%s" % exp])
            mask = so_map.simulate_source_mask(
                binary,
                n_holes=d["source_mask_nholes_%s" % exp],
                hole_radius_arcmin=hole_radius_arcmin)
            mask = so_window.create_apodization(
                mask,
                apo_type=d["apo_type_mask_%s" % exp],
                apo_radius_degree=d["apo_radius_mask_%s" % exp])
            window.data[:] *= mask.data[:]

        window.write_map("%s/window_%s_%s.fits" % (window_dir, exp, freq))
        window.plot(file_name="%s/window_%s_%s" % (plot_dir, exp, freq))

# We then compute the mode coupling matrices and binning matrices BBl for the different cross spectra
# that we will form, the code print the cross spectra to be considered in this computation.

print("Computing mode coupling matrices for the cross spectra:")
예제 #2
0
split = cmb.copy()

#let's add noise to it with rms 20 uk.arcmin in T ans sqrt(2)xthat in pol
noise = so_map.white_noise(split, rms_uKarcmin_T=rms_uKarcmin_T)
split.data += noise.data

split.plot(file_name="%s/noisy_cmb" % (test_dir), ticks_spacing_car=4)

print("Generate window function")

#we then apodize the survey mask
window = so_window.create_apodization(
    binary, apo_type="Rectangle", apo_radius_degree=apo_radius_degree_survey)
#we create a point source mask
mask = so_map.simulate_source_mask(binary,
                                   n_holes=source_mask_nholes,
                                   hole_radius_arcmin=source_mask_radius)
#... and we apodize it
mask = so_window.create_apodization(mask,
                                    apo_type="C1",
                                    apo_radius_degree=apo_radius_degree_mask)
#the window is given by the product of the survey window and the mask window
window.data *= mask.data

#let's look at it
window.plot(file_name="%s/window" % (test_dir), ticks_spacing_car=4)

#for spin0 and 2 the window need to be a tuple made of two objects
#the window used for spin0 and the one used for spin 2
window = (window, window)
예제 #3
0
        "data_type": "IQU",
        "id": name,
        "cal": None
    }]

print("generate window")
car_box, window = ps_tools.create_window(patch,
                                         maps_info_list,
                                         d["apo_radius_survey_degree"],
                                         d["res_arcmin"],
                                         compute_T_only=d["compute_T_only"])

#  multiply by an additional source mask

nholes_degsq = d["nholes_degsq"]
hole_radius_arcmin = d["hole_radius_arcmin"]
apo_radius_degree_pts_source = d["apo_radius_degree_pts_source"]

n_holes = int((ra1 - ra0) * (dec1 - dec0) * nholes_degsq)
print(n_holes)
ps_mask = window.copy()
ps_mask.data[:] = 1
ps_mask = so_map.simulate_source_mask(ps_mask, n_holes, hole_radius_arcmin)
ps_mask = so_window.create_apodization(
    ps_mask, apo_type="C1", apo_radius_degree=apo_radius_degree_pts_source)
window.data *= ps_mask.data

window.write_map("%s/window.fits" % (window_dir))
window.plot(file_name="%s/window" % (plot_dir))
np.savetxt("%s/car_box.dat" % (window_dir), car_box)