def draw_pol(map_q,map_u,nside, ampl=1): """Draw polarization field on current map. Parameters ---------- map_q : map of the Q Stokes parameter map_u : map of the U Stokes parameter nside : nside of the displayed map ampl : mutliplicative factor for the length of the polarization line drawn on the map """ f = pl.gca() if isinstance(f, PA.HpxMollweideAxes) == False : raise NotImplementedError('The function draw_pol can only be used with mollview()') nb_pixels= 12* (nside**2) factor = ampl*1/(np.sqrt(12)*nside) map_q_grade = pixelfunc.ud_grade(map_q, nside) map_u_grade = pixelfunc.ud_grade(map_u, nside) for i in range(nb_pixels): x_pix,y_pix,z_pix = P.pix2vec(nside,i) points = pol_points(x_pix,y_pix,z_pix,map_q_grade[i],map_u_grade[i],factor) theta = [] phi = [] for point in points: t,p = P.vec2ang(point) theta.append(t[0]) phi.append(p[0]) PA.projplot(theta, phi)
def plot_local_meridian(nside, ipix): theta0, phi0 = P.pix2ang(nside, ipix) theta = theta0+np.linspace(-0.1,0.1,100) phi = phi0+np.zeros(100) PA.projplot(theta,phi)