Example #1
0
def bradley_hera_polarized_beams(cstfile):
    nside=32
    npix = hp.nside2npix(nside)

    data = np.loadtxt(cstfile+'_X.txt',skiprows=2)
    theta = np.radians(data[:,0])
    phi = np.radians(data[:,1])
    # Pixellize in linear space
    dbi = dbi2pknorm(data[:,2])
    dbi_t = dbi2pknorm(data[:,3])
    phase_t = np.radians(data[:,4])
    dbi_p = dbi2pknorm(data[:,5])
    phase_p = np.radians(data[:,6])
    
    xx = hpt.healpixellize(dbi,theta,phi,nside).real
    # These are the power beams for each basis vector
    xt = np.sqrt(hpt.healpixellize(dbi_t,theta,phi,nside))
    xt_phase = hpt.healpixellize(phase_t,theta,phi,nside)
    xp = np.sqrt(hpt.healpixellize(dbi_p,theta,phi,nside))
    xp_phase = hpt.healpixellize(phase_p,theta,phi,nside)
    xt = xt * np.exp(-1j*xt_phase)
    xp = xp * np.exp(-1j*xp_phase)

    data = np.loadtxt(cstfile+'_Y.txt',skiprows=2)
    theta = np.radians(data[:,0])
    phi = np.radians(data[:,1])
    # Pixellize in linear space
    dbi = dbi2pknorm(data[:,2])
    dbi_t = dbi2pknorm(data[:,3])
    phase_t = np.radians(data[:,4])
    dbi_p = dbi2pknorm(data[:,5])
    phase_p = np.radians(data[:,6])

    yy = hpt.healpixellize(dbi,theta,phi,nside).real
    # These are the power beams for each basis vector
    yt = np.sqrt(hpt.healpixellize(dbi_t,theta,phi,nside))
    yt_phase = hpt.healpixellize(phase_t,theta,phi,nside)
    yp = np.sqrt(hpt.healpixellize(dbi_p,theta,phi,nside))
    yp_phase = hpt.healpixellize(phase_p,theta,phi,nside)
    yt = yt * np.exp(-1j*yt_phase)
    yp = yp * np.exp(-1j*yp_phase)
    
    return {'xx':xx,'yy':yy,'xt':xt,'xp':xp,'yt':yt,'yp':yp}
Example #2
0
def bradley_paper_polarized_beams(cstfile):
    # This only works on files like /Users/jaguirre/Documents/PAPER/2010_beam/sdipole_05e_eg_ffx_150.txt
    data = np.loadtxt(cstfile,skiprows=2)
    theta = np.radians(data[:,0])
    phi = np.radians(data[:,1])
    # Pixellize in linear space
    dbi = dbi2pknorm(data[:,2])
    dbi_t = dbi2pknorm(data[:,3])
    dbi_p = dbi2pknorm(data[:,4])

    nside=32
    npix = hp.nside2npix(nside)

    xx = hpt.healpixellize(dbi,theta,phi,nside)
    # These are the power beams for each basis vector
    xt = np.sqrt(hpt.healpixellize(dbi_t,theta,phi,nside))
    xp = np.sqrt(hpt.healpixellize(dbi_p,theta,phi,nside))

    yy = hpt.rotate_healpix_map(xx.copy(),[90,0]) # This is a simple rotation, surely
    yt = hpt.rotate_healpix_map(xt.copy(),[90,0])
    yp = hpt.rotate_healpix_map(xp.copy(),[90,0])
    
    return {'xx':xx,'yy':yy,'xt':xt,'xp':xp,'yt':yt,'yp':yp}#'data':data}