sky_ng_sim

This program can be used to create temperature HEALPix maps computed as realisations of random Non-Gaussian fields on a sphere (either even power of a Gaussian distribution, or Simple Harmonics Oscillator PDF, see Description section for details).
It is directly adapted from the NGSIMS code described in Rocha et al, MNRAS, 357, 1 (2005)
The operation count is dominated by a term scaling as ${\cal {O}}(N_{\mathrm{pix}}^{1/2}\ell_{\mathrm{max}}^2 )$. The map angular power spectrum, resolution, Gaussian beam FWHM or arbitrary beam window and random seed for the simulation can be selected by the user.

Location in HEALPix directory tree: src/f90/ngsims_full_sky/sky_ng_sim.F90 


FORMAT

% sky_ng_sim [parameter_file]


QUALIFIERS

simul_type =
Defines the simulation type, 1=temperature map only, 3=temperature and its first spatial derivatives, 4=temperature and its first and second spatial derivatives. (default= 1).
infile =
Defines the input power spectrum file, (default= HEALPIX/test/cl.fits).
outfile_alms =
Defines the FITS file in which to output $a_{\ell m}$ used for the simulation (default= `')
outfile =
Defines the output map file, (default= test.fits).
nsmax =
Defines the resolution of the map. (default= 32)
nlmax =
Defines the maximum $\ell$ value to be used in the simulation. WARNING: $\ell_{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= 2*nsmax)
fwhm_arcmin =
Defines the FWHM size in arcminutes of the simulated Gaussian beam. (default= 0.0)
beam_file =
Defines the FITS file 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=`')
windowfile =
Defines the input filename for the pixel smoothing windows (default= pixel_window_n????.fits, see Notes on default files and directories)
winfiledir =
Defines the directory in which windowfile is located (default : see Notes on default files and directories)
iseed =
Defines the seed of the pseudo-random sequence to be used for the generation of the non-gaussian white noise (default= 1)
plot =
If sky_ng_sim was linked with the PGPLOT library during compilation, and if plot is set to (case unsensitive) .true., t, yes, y or 1, then the histogram of the simulated non-gaussian is produced, overplotted with the theoretical PDF; the histogram of the final map pixel values, overplotted with a PDF of a gaussian of same mean and variance is subsequently produced. (default=.false.)
pdf_choice=1
Choice of non-Gaussian PDF to use: 1= Simple Harmonics oscillator (see Eq 4 below)
sigma0=  RMS of oscillator ground state
na=  Integer in {0, 20}. Number of $\alpha$ coefficients to be given (default=3). Note: analytical calculation of the PDF moments can only be done for na$\le 3$.
alpha_1=, alpha_2=, ...  Real values of $\alpha_i$ coefficients for i in $[1, {\tt na}]$
pdf_choice=2
Choice of non-Gaussian PDF to use: 2=Power of a Gaussian (see Eq 5 below)
npower =  Positive integer in {1,4} (default=1). The gaussian will be set to the power 2*npower.


DESCRIPTION

A random non-Gaussian white noise map is generated, using either The resulting map is analyzed into its $a_{\ell m}$ coefficients, which are then multiplied by the beam, pixel and spectrum window
$\displaystyle a_{\ell m} \longrightarrow a_{\ell m} \left[C(l)\right]^{1/2} B(\ell) w_{\rm pix}(\ell)$      

The resulting $a_{\ell m}$ coefficients are turned back into a map, which is therefore non-gaussian, with an effective angular power spectrum $C(\ell) B(\ell)^2
w_{\mathrm{pix}}(\ell)^2$ (Rocha et al, 2005).
Notes: the code has been modified from the original NGSIMS package in several respects: the seed parameter is named iseed instead of idum, to be consistent with other HEALPix simulation codes; and the SHO generator has been dramatically sped up, without loss of accuracy. Moreover, just like in synfast facility, it is now possible to output the $a_{\ell m}$ coefficients being used (outfile_alms option), and the spatial derivatives of the final map can also be output (simul_type option).


DATASETS

The following datasets are involved in the sky_ng_sim 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 sky_ng_sim.

generate_beam
This HEALPix Fortran subroutine generates or reads the $B(\ell)$ window function used in sky_ng_sim
map2gif
This HEALPix Fortran facility can be used to visualise the output map.
mollview
This HEALPix IDL facility can be used to visualise the output map.
anafast
This HEALPix Fortran facility can analyse a HEALPix map and save the $a_{\ell m}$ and $C_\ell$s to be read by sky_ng_sim.


EXAMPLE # 1:

sky_ng_sim  
sky_ng_sim runs in interactive mode, self-explanatory.


EXAMPLE # 2:

sky_ng_sim filename  
When 'filename' is present, sky_ng_sim 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= 128
nlmax= 256
fwhm_arcmin= 30.0
infile= cl.fits
pdf_choice= 1
iseed= 1
na= 3
sigma0= 1.0
alpha_1= 0.0
alpha_2= 0.0
alpha_3= 0.2
outfile= !test_ngfs.fits
sky_ng_sim reads in the $C_\ell$ power spectrum in 'cl.fits' up to $\ell=256$, and produces the map 'map.fits' which has Nside=128. The non-gaussian white noise was generated assuming a SHO PDF (see Eq 4 above) with $\sigma_0=1$ and $\alpha_i = (0, 0, 0.2)$. The map is convolved with a beam of FWHM 30.0 arcminutes. The iseed=1 sets the random seed for the realisation. A different iseedwould have given a different realisation from the same power spectrum. And finally, since simul_type= 1 only the map (and not its spatial derivatives) will be output.

Since
beam_file
windowfile
outfile_alms
were omitted, they take their default values (empty strings). This means respectively that no beam were read, that sky_ng_sim attempts to find the pixel window files in the default directories (see page [*]), and that the $a_{\ell m}$ generated and used to produce the map were not output.


RELEASE NOTES

■ Initial release (HEALPix 2.10)


MESSAGES

This section describes error messages generated by sky_ng_sim

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.82, 2022-07-28