lensit.ffs_covs.ell_mat¶
-
class
lensit.ffs_covs.ell_mat.
ell_mat
(lib_dir, shape, lsides, cache=1)[source]¶ Library helping with flat-sky patch discretization and harmonic mode structure.
This handles Fourier mode structure on the flat sky, at the given resolution and size of specified rectangular box.
Parameters: - lib_dir – various things might be cached there (unlens cache is set to 0, in which case only a hashdict is put there at instantiation)
- shape (2-tuple) – pair of int defining the number of pixels on each side of the box
- lsides (2-tuple) – physical size (in radians) of the box sides
- cache (optional) – if non-zero, a bunch of matrices might be cached to speed up some calculations.
-
alm2rfftmap
(alm, filt_func=<function ell_mat.<lambda>>)[source]¶ Returns a ffs_alm array from a rfftmap.
Pseudo-inverse to fftmap2alm
-
bin_inell
(rfftmap)[source]¶ Bin in a rfftmap according to multipole \(\ell\)
Input must have the same shape then self.rshape
-
degrade
(LDshape, lib_dir=None)[source]¶ Returns an ell_mat instance on the same physical flat-sky patch but a degraded sampling resolution
-
get_ellmat
(ellmax=None)[source]¶ Returns the matrix containing the multipole ell assigned to 2d-frequency \(k = (k_x,k_y)\)
-
get_phasemat
(ellmax=None)[source]¶ Returns the rfft array containing the phase \(\phi\) where 2d-frequencies are \(k = |k| e^{i \phi}\)
-
get_pixwinmat
()[source]¶ Pixel window function rfft array \(\sin(k_x l_{\rm cell, x} / 2) \sin (k_y l_{\rm cell, y} / 2 )\)
-
get_unique_ells
(return_index=False, return_inverse=False, return_counts=False)[source]¶ Returns list of multipoles \(\ell\) present in the flat-sky patch
-
static
k2ell
(k)[source]¶ Mapping of 2d-frequency \(k\) to multipole \(\ell\)
\(\ell = \rm{int}\left(|k| - \frac 12 \right)\)
-
class
lensit.ffs_covs.ell_mat.
ffs_alm
(ellmat, filt_func=<function ffs_alm.<lambda>>, kxfilt_func=None, kyfilt_func=None)[source]¶ Library to facilitate operations on flat-sky alms in the ffs scheme.
Methods includes alm2map and map2alm, among other things. The instance contains info on the sky patch size and discretization.
Parameters: - ellmat – lensit.ffs_covs.ell_mat.ell_mat instance carrying flat-sky patch definitions
- filt_func (callable, optional) – mutlipole filtering. Set this to discard multipoles in map2alm Defaults to lambda ell : ell > 0
- kxfilt_func (callable, optional) – filtering on x-component of the 2d-frequencies
- kyfilt_func (callable, optional) – filtering on y-component of the 2d-frequencies
-
alm2Pk_minimal
(alm)[source]¶ Power spectrum estimation on the grid, with minimal binning (only exact same frequencies).
Many bins will have only number count 4 or something.
Returns: list with integer array of squared frequencies, integer array number counts, and Pk estimates. (only non zero counts frequencies)
-
almxfl
(alm, fl, inplace=False)[source]¶ Multiply :flat-sky math:a_{ell lm} array with isotropic function \(f_\ell\)
-
bicubic_prefilter
(alm)[source]¶ Refilter the map for use in bicubic spline prefiltering.
Mostly useful for lensing of maps.
-
bin_realpart_inell
(alm, ellmax=None)[source]¶ Bin real part of a rfftmap according to multipole \(\ell\)
Input must have the same shape then self.rshape