示例#1
0
    def _transfer_single(self, bl_index, f_index, lmax, lside):

        if self._nside != hputil.nside_for_lmax(lmax):
            self._init_trans(hputil.nside_for_lmax(lmax))

        # Fetch and conjugate the beam maps
        bmap = self._beam_map_single(bl_index, f_index).conj()

        btrans = np.zeros(
            (self._npol_sky_, lside + 1, 2 * lside + 1), dtype=np.complex128
        )

        if self.skip_pol:
            # Perform the SHTs of the beam maps, only process Stokes I
            btrans[0] = hputil.sphtrans_complex(
                bmap[0], lmax=lmax, lside=lside, centered=False
            ).conj()
        else:
            # Perform the SHTs of the beam maps, potentially skipping Stokes V
            npol = 3 if self.skip_V else 4

            # Copy over output, this works around the fact that older versions of cora
            # return a list of maps
            # TODO: switch to simple array assignment when cora has been fixed up
            t = hputil.sphtrans_complex_pol(
                bmap[:npol], centered=False, lmax=lmax, lside=lside
            )
            for pi in range(npol):
                btrans[pi] = t[pi].conj()

        return btrans
示例#2
0
    def _transfer_single(self, bl_index, f_index, lmax, lside):

        if self._nside != hputil.nside_for_lmax(lmax):
            self._init_trans(hputil.nside_for_lmax(lmax))

        bmap = self._beam_map_single(bl_index, f_index)

        btrans = [ pb.conj() for pb in hputil.sphtrans_complex_pol([bm.conj() for bm in bmap], centered = False, lmax = int(lmax), lside=lside) ]

        return btrans
示例#3
0
文件: telescope.py 项目: wufq/tlpipe
    def _transfer_single(self, bl_index, f_index, lmax, lside):

        if self._nside != hputil.nside_for_lmax(lmax):
            self._init_trans(hputil.nside_for_lmax(lmax))

        bmap = self._beam_map_single(bl_index, f_index)

        btrans = [ pb.conj() for pb in hputil.sphtrans_complex_pol([bm.conj() for bm in bmap], centered = False, lmax = int(lmax), lside=lside) ]

        return btrans
示例#4
0
            enu += n * fringe

enus = np.zeros_like(enu)
MPI.COMM_WORLD.Reduce(enu, enus, op=MPI.SUM, root=0)

if args.outfile is not None:
    outenus = 'enus_' + args.outfile
    outpalms = 'palms_' + args.out_file
else:
    if args.primary_beam:
        outenus = 'enus_%d_%.1f_%.1f_%.1f_%s_case%d_%s.hdf5' % (args.nside, args.freq, args.lat, args.lon, args.auto_corr, args.case, 'p')
        outpalms = 'palms_%d_%.1f_%.1f_%.1f_%s_case%d_%s.hdf5' % (args.nside, args.freq, args.lat, args.lon, args.auto_corr, args.case, 'p')
    else:
        outenus = 'enus_%d_%.1f_%.1f_%.1f_%s_case%d_%s.hdf5' % (args.nside, args.freq, args.lat, args.lon, args.auto_corr, args.case, args.mask_horizon)
        outpalms = 'palms_%d_%.1f_%.1f_%.1f_%s_case%d_%s.hdf5' % (args.nside, args.freq, args.lat, args.lon, args.auto_corr, args.case, args.mask_horizon)

# save enus (synthesized beam?)
if mpiutil.rank0:
    with h5py.File(outenus, 'w') as f:
        f.create_dataset('map', data=enus)

    # spherical harmonic transform
    if args.primary_beam:
        alm = hputil.sphtrans_complex_pol([enus[0], enus[1], enus[2], enus[3]], centered=True)
    else:
        alm = hputil.sphtrans_complex(enus, centered=True)

    # save data
    with h5py.File(outpalms, 'w') as f:
        f.create_dataset('alm', data=np.array(alm))