The s2 library contains functionality to support functions defined on the sky and was developed primarily for astrophysical applications. More generally, however, any arbitrary function defined on the sphere may be represented. Both real space map and harmonic space spherical harmonic representations are supported.
Basic sky representations have been extended to simulate full sky noise distributions and Gaussian cosmic microwave background realisations. Support for the representation and convolution of beams is also provided.
The library design is based on object-oriented principles and is implemented in Fortran 90. Generally one must instantiate a class object using the corresponding init routines. The instatiated object should be freed once it is no longer required with the corresponding free routine (this deallocates all memory associated with the object).
A HEALPix spherical pixelisation scheme is adopted, although this may be extended in the future to support other spherical pixelisations. The spherical harmonic transforms applied are all based on the routines provided by HEALPix.
For further details see the README.txt file.
The s2 package requires the HEALPix and CFITSIO packages. Please note that all s2 code is written in Fortran 90 and a suitable Fortran compiler will be required.
For details on how to use the s2 library code see the documentation below.
>> make lib
The s2 utility programs may be compiled by running:
For details on how to use the s2 utility programs see the documentation below.
>> make prog
By default, the s2 code ships with only this single documentation page. The remainder of the documentation is automatically generated from the source code using f90doc. Please ensure that you have f90doc installed in order to generate this documentation. Once f90doc is installed the documentation may be generated by running:
>> make docs
To remove all documentation, except the front page (i.e. this file), run:
>> make clean
>> make cleandocs
Provides functionality to support and manipulate a function defined
on the sky(/sphere). Support is provided to representing the sky in
both real (map) space and in harmonic (alm) space, and also to convert
between the two representations. One may also scale, dilate, rotate,
downsample and add functions defined on the sky. The sky pixelisation
used is currently based on HEALPix.
Provides functionality to compute spherical harmonic functions.
Functionality to compute specified plane of the Wigner dl functions.
(Provided by D. J. Mortlock.)
Provides functionality to support and manipulate a pl power spectrum.
Provides functionality to create a Gaussian simuated CMB map. The map
is realised from Gaussain alms that satisfy the specified CMB power
Provides functionality to support white noise realisations on the
sky. Noise may either be constructed from a uniform standard
devaition constant over the sky or from a standard deviation map that
varies over the sky depending on the number of observations at a
particular position on the sky.
Functionality to sample from uniform and Gaussian distributions.
Provide functionality to support and rotate vectors in R^3,
represented in either cartesian or spherical coordinates.
Definition of intrinsic types and constants used in the s2 library.
Functionality to handle errors that may occur in the s2
library. Public s2 error codes are defined, with corresponding
private error comments and default halt execution status.
s2_alm2map: Read a HEALPix
alm fits file, compute map and then write the map to a HEALPix map
s2_alm2sky: Read a HEALPix
alm fits file and write the read map to a full s2_sky fits
file. Compute map if requested.
Read a fits cl file and write out an ascii file (spectrum may be
scaled to dls depending on dl_status flag).
Write out Wigner d function values for theta=pi/2.
Generate a Gaussian CMB realisation from an input power spectrum.
co-added Gaussian CMB and noise realisations. Realisations are
simulated for each WMAP channel by convolving with the approriate beam
function and adding appropriate noise for the specific receiver. The
signals from each receiver are combined to give a coadded map, using
the processing pipeline specified by Komatsu et al. (2003).
Simulate two Gaussian random fields (GRFs) on the sky that satisfy
individual and cross power spectra. -- NOT TESTED
s2_map2alm: Read a HEALPix
map fits file and write the read map to a HEALPix fits alm file.
Read a HEALPix map fits file and write the read map to a full s2_sky
Generate noisy masks and computed harmonic space noise covariance matrix
(not yet outputted) from a binary mask.
Count the number of non-zero values in a map. Two techniques are
used. One assumes the map is binary and sums the values. The other
counts the number of values above a threshold. The results are
printed to the screen.
Read a fit pl file and plot the values to and output postscript
s2_sky2alm: Read a HEALPix
map fits file and write the read map to a full s2_sky fits file.
Read a map from a fits file, compute the alms of the map and then the
cl spectrum. Write the computed cl spectrum values to the standard
Read a HEALPix pixelised sky file (map or sky format) and extra an ecp
(equispaced) sampled theta-phi array over the sphere for the grid used
for the Fast Spherical Harmonic Transform.
Read a full s2_sky file and write the map to a HEALPix fits file.
Read a full fits s2_sky file and compute and plot the cl spectrum
(dilate sky also if required).
Add or subtract two maps of the sky.
Downsample a sky.
Compute error between two sky maps.
Apply a mask (containing only ones and zeros) to a sky. The output
map is the product of the mask and sky maps. If the display status is
set then masked pixels of the output map are overwritten with a magic
number that appears grey when plotted. Output maps producted with the
display option set should only be used for display purposes, and not
for any subsequent analysis.
Multiply sky by constant scale.
Add a constant offset to a sky.
Change the pixelisation ordering scheme of a sky.
Take the product of two maps of the sky.
Compute RMS value of sky map.
Rotate a sky.
Up-sample a sky.
Compute spherical harmonic function on full sky.
J. D. McEwen, M. P. Hobson, D. J. Mortlock, and A. N. Lasenby. Fast directional continuous spherical wavelet transform algorithms, IEEE Trans. Sig. Proc., 55(2):520-529, 2007.
Author: J. D. McEwen
s2 package to provide object oriented functionality for functions on the sphere
Copyright (C) 2008 Jason McEwen
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details (LICENSE.txt).
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
JDM would like to thank Daniel Mortlock for useful discussions on the design of the library and also for providing the routines that compute dl matrices.
This documentation has been generated largely by f90doc, with some minor modifications.
Last modified: 1 July 2008