sph_tools - a helper module for spherical harmonic transformation#
Routines for generalized map2alm and alm2map (healpix and CAR).
- pspy.sph_tools.alm2map(alms, template)#
alm2map transform (for healpix and CAR).
- Parameters:
alms (array) – a set of alms, the shape of alms should correspond to so_map.ncomp
template (
so_map) – the map template
- pspy.sph_tools.get_alms(so_map, window, niter, lmax, theta_range=None, dtype=<class 'numpy.complex128'>, alm_conv='HEALPIX')#
Get a map, multiply by a window and return alms This is basically map2alm but with application of the window functions.
- Parameters:
so_map (
so_map) – the data we wants alms fromwindow (so_map or tuple of so_map) – a so map with the window function, if the so map has 3 components (for spin0 and 2 fields) expect a tuple (window,window_pol)
range (theta) – for healpix pixellisation you can specify a range [theta_min,theta_max] in radian. All pixel outside this range will be assumed to be zero.
alm_conv (str) – default is HEALPIX, if IAU multiply U by -1
- pspy.sph_tools.get_pure_alms(so_map, window, niter, lmax)#
Compute pure alms from maps and window function
- Parameters:
so_map (
so_map) – the data we wants alms fromwindow (so_map or tuple of so_map) – a so map with the window function, if the so map has 3 components (for spin0 and 2 fields) expect a tuple (window,window_pol)
niter (integer) – the number of iteration performed while computing the alm not that for CAR niter=0 should be enough
lmax (integer) – the maximum multipole of the transform
- pspy.sph_tools.map2alm(map, niter, lmax, theta_range=None, dtype=<class 'numpy.complex128'>)#
Map2alm transform (for healpix or CAR).
- Parameters:
map (
so_map) – the map from which to compute the almniter (integer) – the number of iteration performed while computing the alm not that for CAR niter=0 should be enough
lmax (integer) – the maximum multipole of the transform
theta_range (list of 2 elements) – [theta_min,theta_max] in radian. for healpix pixellisation all pixel outside this range will be assumed to be zero.
- pspy.sph_tools.show_alm_triangle(alms, lmax, real=True, vmin=None, vmax=None, cmap='Oranges_r', xlims=None, ylims=None, title='Triangle')#
This routine is from the spt3g data release https://pole.uchicago.edu/public/data/quan26/index.html :param alms: a set of alms, the shape of alms should correspond to so_map.ncomp :type alms: array :param lmax: the maximum multipole of the transform :type lmax: int :param real: withtout to take the real part or not :type real: boolean :param vmin: range of the colorbar :type vmin: float :param vmax: range of the colorbar :type vmax: float :param cmap: name of the colormap :type cmap: string :param xlims: x is for the ell coordiante, y for the m coordinate :type xlims: int :param ylims: x is for the ell coordiante, y for the m coordinate :type ylims: int :param title: title, if multiple alm, will appended an integer number 0,1,2… :type title: str