Random fields (glass.fields)#
The glass.fields module provides functionality for simulating random
fields on the sphere. This is done in the form of HEALPix maps.
Functions#
- glass.fields.gaussian_gls(cls, *, lmax=None, ncorr=None, nside=None)#
Compute Gaussian Cls for a Gaussian random field.
Depending on the given arguments, this truncates the angular power spectra to
lmax, removes all butncorrcorrelations between fields, and applies the HEALPix pixel window function of the givennside. If no arguments are given, no action is performed.
- glass.fields.lognormal_gls(cls, shift=1.0, *, lmax=None, ncorr=None, nside=None)#
Compute Gaussian Cls for a lognormal random field.
- glass.fields.generate_gaussian(gls, nside, *, ncorr=None, rng=None)#
Iteratively sample Gaussian random fields from Cls.
A generator that iteratively samples HEALPix maps of Gaussian random fields with the given angular power spectra
glsand resolution parameternside.The optional argument
ncorrcan be used to artificially limit now many realised fields are correlated. This saves memory, as only ncorr previous fields need to be kept.The
glsarray must contain the auto-correlation of each new field followed by the cross-correlations with all previous fields in reverse order:gls = [gl_00, gl_11, gl_10, gl_22, gl_21, gl_20, ...]
Missing entries can be set to
None.
- glass.fields.generate_lognormal(gls, nside, shift=1.0, *, ncorr=None, rng=None)#
Iterative sample lognormal random fields from Gaussian Cls.