Пример #1
0
alm_mask_hp_mw = mm.lm_hp2lm(alm_mask_hp, L_hp)
alm_E_hp_mw = mm.lm_hp2lm(alm_E_hp, L_hp)
alm_B_hp_mw = mm.lm_hp2lm(alm_B_hp, L_hp)

mask_mw = ssht.inverse(alm_mask_hp_mw, L_hp, Reality=True)
kappa_E_map_hp_rec_mw = ssht.inverse(alm_E_hp_mw, L_hp, Reality=True)
kappa_B_map_hp_rec_mw = ssht.inverse(alm_B_hp_mw, L_hp, Reality=True)

mask_mw[mask_mw < 0.5] = np.nan

k_hp_mw = kappa_E_map_hp_rec_mw + 1j * kappa_B_map_hp_rec_mw

k_mw_north_real, mask_north_real, k_mw_south_real, mask_south_real, \
k_mw_north_imag, mask_north_imag, k_mw_south_imag, mask_south_imag \
  = ssht.polar_projection(k_hp_mw*mask_mw, L_hp, resolution=250, Method="MW", zoom_region=zoom_region,\
   rot=[np.radians(alpha),np.radians(beta),np.radians(g)], Projection="SP")

RA_lines_1, RA_lines_2, dec_lines_1, dec_lines_2 = sterio_grid_lines(
    resolution=250, zoom_region=zoom_region)

fig, ax = plt.subplots()
imgplot = ax.imshow(k_mw_south_real,
                    interpolation='nearest',
                    vmin=-0.015,
                    vmax=0.015,
                    cmap="cubehelix")
plt.colorbar(imgplot)
ax.imshow(mask_south_real,
          interpolation='nearest',
          cmap=cm.gray,
          vmin=-1.,
Пример #2
0
            # plt.colorbar(im)
            # plt.figure()
            # im = plt.imshow(kappa_plane.imag)
            # plt.colorbar(im)
            # plt.show()

    if do_half_sky_proj:

        for Projection, zoom_region in zip(Projection_array,
                                           zoom_region_array):
            print "Doing Projection  ", Projection

            # project gamma
            proj_north_real, mask_north_real, proj_south_real, mask_south_real,\
            proj_north_imag, mask_north_imag, proj_south_imag, mask_south_imag\
              = ssht.polar_projection(gamma, L, resolution=orth_resolution, Method=Method, rot=[0.0,np.pi/2,0.0], \
               Projection=Projection, Spin=2, zoom_region=zoom_region)

            gamma_plane_north = proj_north_real + 1j * proj_north_imag

            # Project original
            kappa_orig_north, mask_north, kappa_orig_south, mask_south \
             = ssht.polar_projection(k_mw, L, resolution=orth_resolution, Method=Method, rot=[0.0,np.pi/2,0.0], \
              Projection=Projection, zoom_region=zoom_region)

            # run planar KS
            kappa_plane_north = mm.gamma_to_kappa_plane(
                gamma_plane_north, 1.0, 1.0)

            for i in range(N_angle):
                if Projection == "OP":
                    indexes = np.nonzero((rho < np.sin(min(angle[i]+angle_step/2,np.pi/2))) &\
L = 64
el = 4
m = 2

# Generate spherical harmonics.
flm = np.zeros(L * L, dtype=complex)
ind = ssht.elm2ind(el, m)
flm[ind] = 1.0

# Compute function on the sphere.
f = ssht.inverse(flm, L)

# Plot function on sphere.
f_north_real, mask_north_real, f_south_real, mask_south_real, \
f_north_imag, mask_north_imag, f_south_imag, mask_south_imag \
  = ssht.polar_projection(f, L, resolution=200, Method="MW", Projection="OP", rot=[0.0,np.pi/2,0.0])

plt.figure(1)
plt.subplot(2, 2, 1)
plt.imshow(f_north_real, interpolation='nearest')
plt.imshow(mask_north_real,
           interpolation='nearest',
           cmap=cm.gray,
           vmin=-1.,
           vmax=1.)
plt.axis("off")
plt.title("f East Real")

plt.subplot(2, 2, 2)
plt.imshow(f_north_imag, interpolation='nearest')
plt.imshow(mask_north_imag,
Пример #4
0
	plt.ylabel(r"$\theta$")
	if save_figs:
		plt.savefig("fig/low_res_gamma_Cylindrical_real.pdf")

	if show_figs:
		plt.show()

plt.close("all")

for Projection in Polar_Projection_array:
	print "Doing Projection  ", Projection 

	# project gamma
	proj_north_real, mask_north_real, proj_south_real, mask_south_real,\
	proj_north_imag, mask_north_imag, proj_south_imag, mask_south_imag\
		 = ssht.polar_projection(shear, L, resolution=orth_resolution, Method=Method, rot=[0.0,np.pi/2,0.0], Projection=Projection, Spin=2)
	
	shear_plane_north = proj_north_real + 1j*proj_north_imag
	shear_plane_south = proj_south_real - 1j*proj_south_imag

	# Project original
	kappa_orig_north, mask_north, kappa_orig_south, mask_south \
		= ssht.polar_projection(k_mw, L, resolution=orth_resolution, Method=Method, rot=[0.0,np.pi/2,0.0], Projection=Projection)

	if print_iteration_results:
		print "getting info on planar inversion"
		start_plane = time.clock()
		kappa_plane_north, count_plane  = mm.reduced_shear_to_kappa_plane(shear_plane_north, 1.0,1.0, tol_error=tol_error, Iterate=Iterate, return_count=True)
		elapsed_plane = (time.clock() - start_plane)
	
		error_plane = np.sqrt(np.nanmean((kappa_orig_north-kappa_plane_north.real)**2))