## Codes

In the course of our research we have written a number of scientific codes and software packages. In the spirit of reproducible research we make these codes publicly available.

To obtain a copy of any code please click on the download icon.

If you use any of the codes in work that results in publication, we kindly request that you reference the appropriate code webpage and papers. Thanks!

### AniCosmo: Bayesian analysis of anisotropic cosmologies

The AniCosmo code provides functionality to perform a Bayesian analysis of anisotropic cosmologies. It was used to study Bianchi models of universal rotation it our papers: Bayesian analysis of anisotropic cosmologies: Bianchi VII_h and WMAP; Planck 2013 results: Background geometry and topology of the Universe. AniCosmo is under intensive ongoing development. It is not yet publicly available but will be made available in future.

### BIANCHI: Bianchi VIIh simulations

The BIANCHI code provides functionality to support the simulation of Bianchi Type VIIh induced temperature fluctuations in CMB maps of a universe with shear and rotation. The implementation is based on the solutions to the Bianchi models derived by Barrow et al. (1985), which do not incorporate any dark energy component. Functionality is provided to compute the induced fluctuations on the sphere directly in either real or harmonic space. For a description of the equations implemented to perform the Bianchi simulations see the Appendix of our paper: Non-Gaussianity detections in the Bianchi VIIh corrected WMAP 1-year data made with directional spherical wavelets. Functionality to support functions defined on the sphere is provided by the S2 library.

### BIANCHI2: Dark Bianchi VIIh simulations

The BIANCHI2 code provides functionality to support the simulation of Bianchi Type VIIh induced temperature fluctuations in CMB maps of a universe with shear and rotation. The implementation is based on the solutions to the Bianchi models derived by Anthony Lasenby (not yet published) that incorporate a cosmological constant. Functionality is provided to compute the induced fluctuations on the sphere directly in either real or harmonic space. Functionality to support functions defined on the sphere is provided by the S2 library.

### COMB: Compact embedded object simulations

The COMB code provides functionality to support the simulation on the sphere of compact objects embedded in a stochastic background process of specified power spectrum. Support is provided to add additional white noise and convolve with beam functions. Functionality to support functions defined on the sphere is provided by the S2 code. Please see our related papers for more information: Optimal filters on the sphere; Optimal filters for detecting cosmic bubble collisions.

### FastCSWT: Fast directional continuous spherical wavelet transform

The FastCSWT code provides functionality to perform a directional continuous wavelet transform on the sphere. The transform is based on the construction of the continuous spherical wavelet transform (CSWT) developed by Antoine and Vandergheynst (1999). A fast implementation of the CSWT (based on the fast spherical convolution developed by Wandelt and Gorski 2001) is also provided. The fast algorithm in the context of the CSWT, and as implemented in this package, is described in our paper: Fast directional continuous spherical wavelet transform algorithms. Functionality to support functions defined on the sphere is provided by the S2 code.

### FLAG: Exact Fourier-Laguerre transform on the ball

The FLAG code provides a fast implementation of the Fourier-Laguerre transform, a novel 3D transform exploiting an exact quadrature rule on the ball to construct an exact harmonic transform in 3D spherical coordinates. The angular part of the Fourier-Laguerre transform uses the MW sampling theorem and the exact spherical harmonic transform implemented in the SSHT code. The radial sampling scheme arises from an exact quadrature on the radial half-line using damped Laguerre polynomials. The radial transform can in fact be used to compute the spherical Bessel transform exactly, and the Fourier-Laguerre transform is thus closely related to the Fourier-Bessel transform. For further information please see our related paper: Exact wavelets on the ball.

### FLAGLET: Exact wavelets on the ball

The FLAGLET code provides high-performance routines for fast wavelet analysis of signals on the ball. It exploits the S2LET, FLAG and SSHT codes. The flaglet transform is theoretically exact, i.e. the original signal can be synthesises from its wavelet coefficients exactly since the wavelet coefficients capture all the information of band-limited signals. For further information please see our related paper: Exact wavelets on the ball.

### GLaSS: Spherical Bessel, tomographic and generalised lensing spectra

The Generalised Lensing and Shear Spectra (GLaSS) code provides functionality to compute spherical Bessel, tomographic and generalised lensing spectra. It is a module for Cosmosis. For further information please see our related paper: Testing the cosmic shear spatially-flat universe approximation with GLaSS.

### massmappy: Mapping dark matter on the celestial sphere

The massmappy code provides functionality to recover convergence mass maps on the celestial sphere from weak lensing cosmic shear observations. At present the spherical Kaiser-Squires estimator is implemented. Additional estimators will be added in future. massmappy relies on the SSHT (built on the MW sampling theorem) and HEALPIX codes to handle sampled data on the sphere. Further detail can be found in our related paper: Mapping dark matter on the celestial sphere with weak gravitational lensing.

### NSHT: Novel optimal sampling spherical harmonic transforms

The NSHT code implements a novel sampling scheme to accurately sample a signal band-limited at L in L^2 samples. Whereas sampling theorems on the sphere require at best 2*L^2 samples (see SSHT), NSHT sampling achieves the optimal sampling rate specified by the dimensionality of band-limited signals in harmonic space. Furthermore, NSHT provides functionality to compute fast spherical harmonic transforms for signals sampled according to the optimal sampling scheme developed. For further information please see our related paper: An optimal-dimensionality sampling scheme on the sphere with fast spherical harmonic transforms.

### PURIFY: Next generation radio interferometric imaging

The PURIFY code provides functionality to perform radio interferometric imaging, i.e. to recover images from the incomplete Fourier measurements taken by radio interferometric telescopes. PURIFY leverages recent developments in the field of compressive sensing and convex optimisation and uses our sparse optimisation code SOPT.

### RequiSim: Variance weighted overlap measure of the lensing bias

The RequiSim code computes the variance weighted overlap, which is a measure of the bias on the lensing signal from power spectrum modelling bias. For further information please see our related paper: Preparing for the cosmic shear data flood: optimal data extraction and simulation requirements for stage IV dark energy experiments.

### S2: Functions on the sphere

The S2 code provides 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. Currently 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.

### S2DW: Steerable scale discretised wavelets on the sphere

The S2DW code provides functionality to perform the scale discretised wavelet transform on the sphere. 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. Please see our related papers for further details: Exact reconstruction with directional wavelets on the sphere; On the computation of directional scale-discretized wavelet transforms on the sphere. Functionality to support functions defined on the sphere is provided by the S2 code.

### S2FIL: Optimal filtering on the sphere

The S2FIL code provides functionality to support optimal filtering on the sphere. Optimal directional matched (MF) and scale adaptive (SAF) filters may be constructed from a template and stochastic background process. Functionality is also incorporated to filter a sky data map with an optimal filter. Moreover, a simple object detection algorithm is implemented in this package to extract embedded object parameters from the filtered field. Functionality to support functions defined on the sphere is provided by the S2 code; template objects are defined in the COMB code; and functionality to perform fast directional filtering on the sphere is provided by the FastCSWT code. Please see our related paper for more information: Optimal filters on the sphere; Optimal filters for detecting cosmic bubble collisions.

### S2LET: Fast wavelets on the sphere

The S2LET code provides high performance routines for fast wavelet analysis of signals on the sphere. It is primarily intended to work with the SSHT code built on the MW sampling theorem to perform exact spherical harmonic transforms on the sphere. The resulting wavelet transform is also theoretically exact, i.e. the original signal can be synthesises from its wavelet coefficients exactly since the wavelet coefficients capture all the information of band-limited signals. S2LET also supports the HEALPIX sampling scheme, in which case the transforms are not theoretically exact but achieve good numerical accuracy. Further detail can be found in our related paper: S2LET: A code to perform fast wavelet analysis on the sphere.

### SIC: Sparse inpainting code

The SIC code provides functionality to sparsely inpaint masked CMB maps. The statistical properties of inpainted Gaussian CMB maps are studied in our paper: Sparse inpainting and isotropy. This code is provided for validation purposes and to study the properties of sparse inpainting; it is not intended for the production inpainting of CMB maps.

### SO3: Fast Wigner transforms on the rotation group

The SO3 code provides functionality to perform fast and exact Wigner transforms based on the sampling theorem on the rotation group derived in our paper: A novel sampling theorem on the rotation group.

### SOPT: Sparse optimisation

The SOPT code provides functionality to perform sparse optimisation using state-of-the-art convex optimisation algorithms. Furthermore, SOPT implements the SARA algorithm, where the average sparsity of images over a set of dictionaries is exploited. Note that the SOPT code provides the core optimisation algorithms used in our radio interferometric imaging package PURIFY.

### SSHT: Spin spherical harmonic transforms

The SSHT code provides functionality to perform fast and exact spin spherical harmonic transforms based on the sampling theorem on the sphere derived in our paper: A novel sampling theorem on the sphere. In some applications, adjoint forward and inverse spherical harmonic transforms are also required (for example, when solving convex optimisation problems). We provide functionality to perform fast and exact adjoint transforms, based on the fast algorithms derived in our paper: Sparse image reconstruction on the sphere: implications of a new sampling theorem.

### SZIP: Data compression on the sphere

The SZIP code provides functionality to compress data defined on the sphere. A Haar wavelet transform on the sphere is used as an energy compression stage to reduce the entropy of the data, followed by Huffman and run-length encoding stages. Lossless and lossy compression algorithms are included. For further details on our algorithms and their performance please see our paper: Data compression on the sphere.