The S2DW code provides functionality to perform the scale discretised
wavelet transform on the sphere developed in our paper:
*Exact reconstruction with directional
wavelets on the sphere* (ArXiv|DOI). Routines are provided to compute wavelet
and scaling coefficients from the spherical harmonic coefficients of a
signal on the sphere and to synthesise the spherical harmonic
coefficients of the original signal from its wavelet and scaling
coefficients. The reconstruction of the spherical harmonic
coefficients of the original signal is exact to numerical precision.
Typically, maximum reconstruction errors are of the order 10^(-12) or
smaller. Please see our paper for further details of the wavelet
transform and a discussion of typical reconstruction errors and
execution times of this implementation.

It is considerably more accurate and efficient to perform our wavelet
transform on the sphere in harmonic space, hence this is the approach
adopted in the S2DW code. The S2DW *library* itself considers only
the spherical harmonic representation of data defined on the sphere
and not real space representations. Many different pixelisations
schemes for the sphere exist, with corresponding algorithms to perform
forward and inverse spherical harmonic transforms. These algorithms
are not always exact, hence the core functionality of the S2DW code
operates on the spherical harmonic coefficients of signals only.
Users are then free to use any pixelisation of the sphere and the
computation of spherical harmonic coefficients is the users' concern.

A number of optional utility programs are also provided in the S2DW code. These enable users to perform the scale discretised wavelet transform on data defined on the sphere in real space. The HEALPix pixelisation of the sphere is adopted for this purpose. The spherical harmonic transform on a HEALPix pixelisation is not exact, hence the reconstruction accuracy of our S2DW code for real space data is limited by the accuracy of the forward and inverse spherical harmonic transforms provided by HEALPix.

For further details see the README.txt file.

The S2DW *library* requires only the FFTW and CFITSIO
packages. If one wishes to also use the utility programs then the HEALPix and S2 packages
are also required. Please note that all S2DW code is written in
Fortran 90 and a suitable Fortran compiler will be required.

```
```` >> make lib`

For details on how to use the S2DW library code see the documentation
below.
```
````>> make test`

The test may then be performed by running:
```
````>> make runtest`

If you see the message '` ``>> ./bin/s2dw_test xx`

where xx is the band limit of the test.
The utility programs require the HEALPix and S2 packages to handle real space representations of data on the sphere (these are not required for the S2DW library). Before attempting to compile the utility programs please ensure that these libraries are linked correctly in the makefile. Once these libraries are linked you may compile the S2DW utility programs by running:

```
````>> make prog`

For details on how to use the S2DW utility programs see the documentation
below.
By default, the S2DW 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`

```
````>> make clean`

To remove all documentation, except the front page (i.e. this file),
run:
```
````>> make cleandocs`

`s2dw_core_mod`

:
Provides core functionality to perform a scale discretised wavelet
transform on the sphere.

`s2dw_dl_mod`

:
Functionality to compute specified plane of the Wigner dl matrix.

`s2dw_stat_mod`

:
Functionality to compute statistics of wavelet coefficients.

`s2dw_error_mod`

:
Functionality to handle errors that may occur in the S2DW
library. Public S2DW error codes are defined, with corresponding
private error comments and default halt execution status.

`s2dw_fileio_mod`

:
Functionality to read and write S2DW formatted fits files containing
wavelet and scaling coefficients.

`s2dw_types_mod`

:
Definition of intrinsic types and constants used in the S2DW library.

`s2dw_analysis`

:
Computes the S2DW wavelet and scaling coefficients of a Healpix sky map.

`s2dw_synthesis`

:
Reconstructs a Healpix sky map from S2DW wavelet and scaling coefficients.

`s2dw_test`

:
Performs S2DW transform analysis and synthesis and check that the
original signal is reconstructed exactly (to numerical precision).
Note that this utility program does not deal with real space
representations of data on the sphere and hence does not require the
HEALPix or S2 packages.

`s2dw_wav2sky`

:
Converts wavelet coefficients read from a S2DW formatted fits/matlab file
to a sky Healpix fits file.

`s2dw_wavplot`

:
Computes a Healpix sky map of wavelet for a given j for subsequent plotting.

`s2dw_fits2mat`

:
Converts a fits S2DW file containing wavelet and scaling coefficients to
a matlab S2DW file.

`s2dw_mat2fits`

:
Converts a matlab S2DW file containing wavelet and scaling coefficients
to a fits S2DW file.

`s2dw_matlab_wav_write.m`

:
Write S2DW data manipulated in Matlab to a S2DW m file that can be read
by Matlab and the S2DW Fortran code.

`jason.mcewen AT ucl.ac.uk`

).
**Authors:** J. D. McEwen & Y. Wiaux

**Version:** 1.1 - August 2013

- Version 1.1

Parallelised code and implemented some optimisations.

- Version 1.0

Initial public release of S2DW code. Development functionality removed from library and obselete matlab interface functions removed.

- Version 0.3

Dynamic memory allocation of wavelet coefficients added to reduce memory requirements. Functionality to read/write matlab files added. Some further test/development functions removed.

- Version 0.2

Synthesis reordered to provide memory and execution time performance improvements. Dynamic temporary memory allocation added to reduce memory requirements. Some test/development functions removed.

- Version 0.1

Original S2DW version.

S2DW package to compute the scale discretised wavelet transform on the sphere

Copyright (C) 2008 Yves Wiaux & Jason McEwenThis 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.

We thank Gilles Puy very much for testing the S2DW code.

The code to compute Wigner dl functions was provided by Daniel Mortlock.

This documentation has been generated largely by f90doc, with some minor modifications.

Last modified: December 2008