This routine generates scalar (and tensor) alm for a temperature (and polarisation) power spectrum read from an input FITS file. The alm are gaussian distributed with a zero mean, and their amplitude is multiplied with the l-space window function of a gaussian beam characterized by its FWHM or an arbitrary circular beam and a pixel window read from an external file.

Location in HEALPix directory tree: src/f90/mod/alm_tools.F90 


call create_alm*( nsmax, nlmax, nmmax, polar, filename, rng_handle, fwhm_arcmin, alm_TGC, header[, windowfile, units, beam_file] )

Arguments appearing in italic are optional.


name & dimensionality kind in/out description
nsmax I4B IN ${N_{\rm side}}$ of the map to be synthetized from the alm created by this routine.
nlmax I4B IN maximum l value to be considered (MAX= $4{N_{\rm side}}$ if windowfile is provided).
nmmax I4B IN maximum m value for the alm.
polar I4B IN if set to 0, only Temperature (scalar) alm are generated using TT spectrum. If set to 1, 'conventional' polarization is added, based on EE, BB and TE spectra. If set to 2, and if the relevant information is in filename, polarization is generated assuming non-zero correlation of Curl (B) modes with Temperature (T) and Gradient (E) modes (TB and EB cross-spectra). Note that the synfast facility calls create_alm* with polar=0 or polar=1
filename(LEN=filenamelen) CHR IN name of FITS file containing power spectra in the order TT, [EE, BB, TE, [TB, EB]] (terms in brackets are optional, see polar)
rng_handle planck_rng INOUT structure containing information necessary to continue a random sequence initiated previously with the subroutine rand_init. Consecutive calls to create_alm* can be made after a single invocation to rand_init.
fwhm_arcmin SP/ DP IN FWHM size of the gaussian beam in arcminutes.
alm_TGC(1:p,0:nlmax,0:nmmax) SPC/ DPC OUT complex alm values generated from the power spectrum in the FITS file. The first index here runs form 1:1 for temperature only, and 1:3 for polarisation. In the latter case, 1=T, 2=E, 3=B.
name & dimensionality kind in/out description
header(LEN=80),dimension(60) CHR OUT part of header which will be included in the FITS-file containing the map synthesised from the alm which create_alm generates.
windowfile(LEN=filenamelen) CHR IN full filename specification of the FITS file with the pixel window function (defined for $l\le4 {N_{\rm side}}$)
units(LEN=80),dimension(1:) CHR OUT physical units of the created alm (square-root of the input power spectrum units).
beam_file(LEN=filenamelen) CHR IN name of the file containing the (non necessarily gaussian) window function Bl of a circular beam. If present, it will override the argument fwhm_arcmin.


use alm_tools, only: create_alm
use rngmod, only: rand_init, planck_rng
type(planck_rng) :: rng_handle

call rand_init(rng_handle, -1)
call create_alm(64, 128, 128, 1, 'cl.fits', rng_handle, 5.0, alm_TGC, &
& header, 'data/pixel_window_n0064.fits')
Creates scalar and tensor alm from the power spectrum given in the file `cl.fits'. The map to be created from these alm is assumed to have Nside=64. Cls from the power spectrum are used up to an l value of 128. Corresponding alm values up to l=128 and m=128 are created as gaussian distributed complex numbers. Their are drawn from a sequence of pseudo-random numbers initiated with a seed of -1. The produced alm are convolved with a gaussian beam of FWHM 5 arcminutes and a pixel window read from 'data/pixel_window_n0064.fits'. It is assumed that after the return from this routine, a map is generated from the created alm. For this purpose, header is updated with FITS format information describing the origin and history of these alm.


This section lists the modules and routines used by create_alm*.

module, containing:
routine to convert from power spectrum units to alm units
routine to generate beam window function
routine to read in pixel window function
module, containing:
routine that prints an error message if there is not enough space for allocation of variables.
module, containing:
routine to read a FITS file containing a power spectrum.
routine to read a FITS-binary file containing the pixel window functions.
module, containing:
routine to add a keyword to a FITS header.
routine to read a keyword value from FITS header.
routine to merge two FITS headers.
module, containing:
function which returns a gaussian distributed random number.


This section lists the routines related to create_alm*

subroutine to initiate a random number sequence.
executable using create_alm* to synthesize CMB maps from a given power spectrum.
Routine to transform a set of alm created by create_alm* to a HEALPix map.
alms2fits, dump_alms
Routines to save a set of alm in a FITS file.

Version 3.31, 2017-01-06