Exemplo n.º 1
0
 def __init__(self, ellmat, bfilt_func):
     try:
         from lensit.ffs_covs.ell_mat import ffs_alm_pyFFTW as ffs_alm
     except ImportError:
         from lensit.ffs_covs.ell_mat import ffs_alm as ffs_alm
     lib_blm = ffs_alm(ellmat, filt_func=lambda ell: (bfilt_func(ell) & (ell > 0)))
     self.conv = ffs_converter(lib_blm)
     self.nmodes = self.conv.rlms_size
     self.lib_alm = lib_blm
Exemplo n.º 2
0
 def __init__(self, ellmat, lmin):
     try:
         from lensit.ffs_covs.ell_mat import ffs_alm_pyFFTW as ffs_alm
     except ImportError:
         from lensit.ffs_covs.ell_mat import ffs_alm as ffs_alm
     self.lmin = lmin
     lib_alm = ffs_alm(ellmat, filt_func=lambda ell: (ell <= lmin))
     self.conv = ffs_converter(lib_alm)
     self.nmodes = self.conv.rlms_size
     self.lib_alm = lib_alm
Exemplo n.º 3
0
    def __init__(self, cov, fwd_op, TEBlen, cache_fname=None):
        self.cov = cov
        lmax = self.cov.lib_skyalm.ellmax
        self.converter = ffs_converter(cov.lib_skyalm)
        self.fwd_op = fwd_op
        self.TEBlen = TEBlen

        if (cache_fname != None) and (os.path.exists(cache_fname)):
            assert cache_fname[-3:] == '.pk'
            [cache_lmax, cache_hashdict] = pk.load(open(cache_fname, 'r'))
            self.minv = np.load(cache_fname[:-3] + '.npy')

            if ((lmax != cache_lmax) or (self.hashdict() != cache_hashdict)):
                print "WARNING: PRE_OP_DENSE CACHE: hashcheck failed. recomputing."
                os.remove(cache_fname)
                self.compute_minv(cache_fname=cache_fname)
        else:
            self.compute_minv(cache_fname=cache_fname)