synfast

This program can be used to create HEALPix maps (temperature only or temperature and polarisation) computed as realisations of random Gaussian fields on a sphere characterized by the user provided theoretical power spectra, or as constrained realisations of such fields characterised by the user provided $a_{\ell m}$ coefficients and/or power spectra. Total operation count scales as ${\cal {O}}(N_{\mathrm{pix}}^{1/2}\ell_{\mathrm{max}}^2 )$ where Npix is the total number of pixels and $\ell_{\mathrm{max}}$ is the limiting spherical harmonics order. The map resolution, Gaussian beam FWHM, and random seed for the simulation can be selected by the user. Spherical harmonics are either generated using the recurrence relations during the execution of spectral synthesis, or precomputed and read in before the synthesis is executed. The latter is no longer recommended since it provides no acceleration since the introduction of optimized algorithms in HEALPix v2.20.

Location in HEALPix directory tree: src/f90/synfast/synfast.f90 


FORMAT

% synfast [options] [parameter_file]


COMMAND LINE OPTIONS

-d
--double
double precision mode (see Notes on double/single precision modes )
-s
--single
single precision mode (default)


QUALIFIERS

infile =
Defines the input power spectrum file, (default= cl.fits). Note that infile is now optional : synfast can run even if only almsfile is provided.
outfile =
Defines the output (RING ordered) map file, (default= map.fits). Note that outfile is now optional: if it set to `' (empty string), mo map is synthesized but the $a_{\ell m}$ generated can be output.
outfile_alms =
Defines the FITS file in which to output $a_{\ell m}$ used for the simulation (default= `')
simul_type =
Defines the simulation type, 1=temperature only (1 field), 2=temperature+polarisation (3 fields), 3=temperature and its first spatial derivatives (3 fields), 4=temperature and its first and second spatial derivatives (6 fields), 5=temperature and polarisation, and their first derivatives (9 fields), 6=same as 5 plus the second derivatives of (T,Q,U) (18 fields). (default= 1).
nsmax =
Defines the resolution of the map. (default= 32)
nlmax =
Defines the maximum $\ell$ value to be used in the simulation. WARNING: $\ell_{\mathrm{max}}$ can not exceed the value $4\cdot$ nsmax, because the coefficients of the average Fourier pixel window functions are precomputed and provided up to this limit. (default= 64)
iseed =
Defines the random seed to be used for the generation of $a_{\ell m}$s from the power spectrum. (default= -1)
fwhm_arcmin =
Defines the FWHM size in arcminutes of the simulated Gaussian beam. (default= 420.0)
beam_file =
Defines the FITS file (see ”Beam window function files” in introduction) describing the Legendre window function of the circular beam to be used for the simulation. If set to an existing file name, it will override the fhwm_arcmin given above. (default=`')
almsfile =
Defines the input filename for a file containing $a_{\ell m}$s for constrained realisations. (default= `'). If apply_windows is false those $a_{\ell m}$s are used as they are, without being multiplied by the beam or pixel window function (with the assumption that they already have the correct window functions). If apply_windows is true, the beam and pixel window functions chosen above are applied to the constraining $a_{\ell m}$ (with the assumption that those are free of beam and pixel window function). The code does not check the validity of these asumptions; if none is true, use the alteralm facility to modify or remove the window functions contained in the constraining $a_{\ell m}$.
apply_windows =
Determines how the constraining $a_{\ell m}$ read from almsfile are treated with respect to window functions; see above for details. y, yes, t, true, .true. and 1 are considered as true, while n, no, f, false, .false. and 0 are considered as false, (default = .false.).
plmfile =
Defines the input filename for a file containing precomputed Legendre polynomials $P_{\ell m}$. (default= `')
windowfile =
Defines the input filename for the pixel smoothing windows (default= pixel_window_n????.fits, see below).
winfiledir =
Defines the directory in which windowfile is located (default: see Notes on default files and directories).


DESCRIPTION

Synfast reads the power spectrum from a file in ascii FITS format. This can contain either just the temperature power spectrum $C^T_{\ell}$s or temperature and polarisation power spectra: $C^T_{\ell}$, $C^E_{\ell}$, $C^B_{\ell}$ and $C^{T\times E}_{\ell}$ (see Note 1, below). If simul_type = 2 synfast generates Q and U maps as well as the temperature map. The output map(s) is (are) saved in a FITS file. The $C_{\ell}$s are used up to the specified $\ell_{\mathrm{max}}$, which can not exceed 4 x nsmax. If simul_type = 3 or 4 the first derivatives of the temperature field or the first and second derivatives respectively are output as well as the temperature itself: T(p), $\left({\partial T}/{\partial \theta}, {\partial T}/{\partial \phi}/\sin\theta \right)
$, $\left({\partial^2 T}/{\partial \theta^2}, {\partial^2 T}/{\partial
\theta\partial\phi}/\sin\theta,\right. $ $\left.{\partial^2 T}/{\partial \phi^2}/\sin^2\theta \right) $. If simul_type = 5 or 6 the first derivatives of the (T,Q,U) fields or the first and second derivatives respectively are output as well as the field themself: T(p), Q(p), U(p), $\left({\partial T}/{\partial \theta}, {\partial Q}/{\partial \theta}, {\partial
U}/{\partial \theta}; {\partial T}/{\partial \phi}/\sin\theta, \ldots \right)
$, $\left({\partial^2 T}/{\partial \theta^2},\ldots; {\partial^2 T}/{\partial
\theta\partial\phi}/\sin\theta,\ldots ;\right. $ $\left.{\partial^2 T}/{\partial \phi^2}/\sin^2\theta \ldots \right) $

The random sequence seed for generation of $a_{\ell m}$ from the power spectrum should be non-zero integer. If 0 is provided, a seed is generated randomly by the code, based on the current date and time. The map can be convolved with a gaussian beam for which a beamsize can be specified, or for an arbitrary circular beam for which the Legendre transform is provided. The map is automatically convolved with a pixel window function. These are stored in FITS files in the healpix/data directory. If synfast is not run in a directory which has these files, or from a directory which can reach these files by a `../data/' or `./data/' specification, the system variable HEALPIX is used to locate the main HEALPix directory and its data subdirectory is scanned. Failing this, the location of these files must be specified (using winfiledir). In the interactive mode this is requested only when necessary (see Notes on default directories ).

If some of the $a_{\ell m}$ in the simulations are constrained eg. from observations, a FITS file with these $a_{\ell m}$ can be read. This FITS file contains the $a_{\ell m}$ for certain $\ell$ and m values and also the standard deviation for these $a_{\ell m}$. The sky realisation which synfast produces will be statistically consistent with the constraining $a_{\ell m}$.

The code can also be used to generate a set of $a_{\ell m}$ matching the input power spectra, beam size and pixel size with or without actually synthesizing the map. Those $a_{\ell m}$ can be used as an input (constraining $a_{\ell m}$) to another synfast run.

Spherical harmonics values in the synthesis are obtained from a recurrence on associated Legendre polynomials $P_{\ell m}(\theta)$. This recurrence consumed most of the CPU time used by synfast up to version 2.15. We have therefore included an option to load precomputed values for the $P_{\ell m}(\theta)$ from a file generated by the HEALPix facility plmgen. Since the introduction of accelerated spherical harmonic transforms in HEALPix v2.20, this feature is obsolete and should no longer be used.

synfast will issue a warning if the input FITS file for the power spectrum does not contain the keyword POLNORM. This keyword indicates that the convention used for polarization is consistent with CMBFAST (and consistent with HEALPix 1.2). See the HEALPix Primer for details on the polarization convention and the interface with CMBFAST. If the keyword is not found, no attempt will be made to renormalize the power spectrum. If the keyword is present, it will be inherited by the simulated map.

Note 1: to allow the generation of maps (and $a_{\ell m}$) with $C^{T\times B}_{\ell} \ne 0$ and/or $C^{E\times B}_{\ell} \ne 0$, see the subroutine create_alm.


DATASETS

The following datasets are involved in the synfast processing.

Dataset Description
   
/data/pixel_window_nxxxx.fits Files containing pixel windows for various nsmax.
   
 


SUPPORT

This section lists those routines and facilities (including those external to the HEALPix distribution) which can assist in the utilisation of synfast.

generate_beam
This HEALPix Fortran subroutine generates or reads the $B(\ell)$ window function used in synfast
map2gif
This HEALPix Fortran facility can be used to visualise the output map of synfast.
mollview
This HEALPix IDL facility can be used to visualise the output map of synfast.
alteralm
This HEALPix Fortran facility can be used to implement the beam and pixel window functions on the constraining $a_{\ell m}$s (almsfile file).
anafast
This HEALPix Fortran facility can analyse a HEALPix map and save the $a_{\ell m}$ and $C_{\ell}$s to be read by synfast.
plmgen
This HEALPix Fortran facility can be used to generate precomputed Legendre polynomials.


EXAMPLE # 1:

synfast  
Synfast runs in interactive mode, self-explanatory.


EXAMPLE # 2:

synfast filename  
When 'filename' is present, synfast enters the non-interactive mode and parses its inputs from the file 'filename'. This has the following structure: the first entry is a qualifier which announces to the parser which input immediately follows. If this input is omitted in the input file, the parser assumes the default value. If the equality sign is omitted, then the parser ignores the entry. In this way comments may also be included in the file. In this example, the file contains the following qualifiers:
simul_type= 1
nsmax= 32
nlmax= 64
iseed= -1
fwhm_arcmin= 420.0
infile= cl.fits
outfile= map.fits

Synfast reads in the $C_{\ell}$ power spectrum in 'cl.fits' up to $\ell=64$, and produces the (RING ordered) map 'map.fits' which has Nside=32. The map is convolved with a beam of FWHM 420.0 arcminutes. The iseed=-1 sets the random seed for the realisation. A different iseed would have given a different realisation from the same power spectrum.

Since
outfile_alms
almsfile
apply_windows
plmfile
beam_file
windowfile
were omitted, they take their default values (empty strings). This means that no file for constrained realisation or precomputed Legendre polynomials are read, the $a_{\ell m}$ generated in the process are not output, and synfast attempts to find the pixel window files in the default directories (see Notes on default files and directories).


RELEASE NOTES

■ Initial release (HEALPix 0.90)
■ Optional non-interactive operation. Proper FITS file support. Improved reccurence algorithm for $P_{\ell m}(\theta)$ which can compute to higher $\ell$ values. Improved pixel windows averaged over actual HEALPix pixels. New functionality: constrained realisations, precomputed $P_{\ell m}$. (HEALPix 1.00)
■ New functionality: constrained realisations and pixel windows are now available for polarization as well. Arbitrary circular beams can be used. New parser (HEALPix 1.20)
■ New functionnality: the generated $a_{\ell m}$ can be output, and the map synthesis itself can be skipped. First and second derivatives of the temperature field can be produced on demand.
■ New functionnality: First and second derivatives of the Q and U Stokes field can be produced on demand.
■ Bug correction: corrected numerical errors on derivatives $\partial X/\partial\theta$, $\partial^2 X/(\partial\theta\partial\phi\sin\theta)$, $\partial^2 X/\partial \theta^2$, for X=Q,U. See this appendix for details. (HEALPix 2.14)


MESSAGES

This section describes error messages generated by synfast

Message Severity Text
     
can not allocate memory for array xxx Fatal You do not have sufficient system resources to run this facility at the map resolution you required. Try a lower map resolution.
     

this is not a binary table

  the fitsfile you have specified is not of the proper format
     
there are undefined values in the table!   the fitsfile you have specified is not of the proper format
     
the header in xxx is too long   the fitsfile you have specified is not of the proper format
     
XXX-keyword not found   the fitsfile you have specified is not of the proper format
     
found xxx in the file, expected:yyyy   the specified fitsfile does not contain the proper amount of data.
     

   

Version 3.83, 2024-11-13