The GLSpace class – Gauss-Legendre pixelization of the sphere

class nifty.GLSpace[source]

Bases: nifty.spaces.space.space.Space

NIFTY subclass for Gauss-Legendre pixelizations [1] of the two-sphere.

Parameters:

nlat : int

Number of latitudinal bins (or rings) that are used for this pixelization.

nlon : int, optional

Number of longditudinal bins that are used for this pixelization.

Raises:

ValueError

If input nlat or nlon is invalid.

ImportError

If the pyHealpix module is not available

See also

hp_space
A class for the HEALPix discretization of the sphere [2].
lm_space
A class for spherical harmonic components.

References

[1]M. Reinecke and D. Sverre Seljebotn, 2013, “Libsharp - spherical harmonic transforms revisited”; arXiv:1303.4945
[2]K.M. Gorski et al., 2005, “HEALPix: A Framework for High-Resolution Discretization and Fast Analysis of Data Distributed on the Sphere”, ApJ 622..759G.

Attributes

dim Returns the number of pixel-dimensions the object has.
harmonic Returns True if this space is a harmonic space.
nlat Number of latitudinal bins (or rings) that are used for this pixelization.
nlon Number of longditudinal bins that are used for this pixelization.
total_volume Returns the total volume of the space.
shape The domain-object’s shape contribution to the underlying array.

Methods

copy() Returns a copy of this Space instance.
get_distance_array(distribution_strategy) The distances of the pixel to zero.
get_fft_smoothing_kernel_function(sigma) This method returns a smoothing kernel function.
weight(x[, power, axes, inplace]) Weights the field on this domain with the space’s volume-weights.
copy()[source]

Returns a copy of this Space instance.

Returns:

Space

A copy of this instance.

get_distance_array(distribution_strategy)[source]

The distances of the pixel to zero.

This returns an array that gives for each pixel its distance to the center of the manifolds grid.

Parameters:

distribution_strategy : str

The distribution_strategy which shall be used the returned distributed_data_object.

Returns:

distributed_data_object

A d2o containing the distances

Raises:

NotImplementedError

If called for this abstract class.

get_fft_smoothing_kernel_function(sigma)[source]

This method returns a smoothing kernel function.

This method, which is only implemented for harmonic spaces, helps smoothing fields that live in a position space that has this space as its harmonic space. The returned function multiplies field values of a field with a zero centered Gaussian which corresponds to a convolution with a Gaussian kernel and sigma standard deviation in position space.

Parameters:

sigma : float

A real number representing a physical scale on which the smoothing takes place. The smoothing is defined with respect to the real physical field and points that are closer together than one sigma are blurred together. Mathematically sigma is the standard deviation of a convolution with a normalized, zero-centered Gaussian that takes place in position space.

Returns:

function (array-like -> array-like)

A smoothing operation that multiplies values with a Gaussian kernel.

Raises:

NotImplementedError :

If called for this abstract class.

weight(x, power=1, axes=None, inplace=False)[source]

Weights the field on this domain with the space’s volume-weights.

Weights hereby refer to integration weights, as they appear in discretized integrals. Per default, this function mutliplies each bin of the field x by its volume, which lets it behave like a density (top form). However, different powers of the volume can be applied with the power parameter. The axes parameter specifies which of the field array’s indices correspond to this domain.

Parameters:

x : distributed_data_object

The fields data array.

power : int, optional

The power to which the volume-weight is raised (default: 1).

axes : {int, tuple}, optional

Specifies the axes of x which represent this domain (default: None). If axes==None:

weighting is applied with respect to all axes

inplace : bool, optional

If this is True, the weighting is done on the values of x, if it is False, x is not modified and this method returns a weighted copy of x (default: False).

Returns:

distributed_data_object

A weighted version of x, with volume-weights raised to the given power.

Raises:

NotImplementedError

If called for this abstract class.

dim

Returns the number of pixel-dimensions the object has.

Returns:

int

An Integer representing the number of pixels the discretized manifold has.

Raises:

NotImplementedError

If called for this abstract class.

harmonic

Returns True if this space is a harmonic space.

Raises:

NotImplementedError

If called for this abstract class.

nlat

Number of latitudinal bins (or rings) that are used for this pixelization.

nlon

Number of longditudinal bins that are used for this pixelization.

shape

The domain-object’s shape contribution to the underlying array.

Returns:

tuple of ints

The shape of the underlying array-like object.

Raises:

NotImplementedError

If called for this abstract class.

total_volume

Returns the total volume of the space.

Returns:

float

A real number representing the sum of all pixel volumes.

Raises:

NotImplementedError

If called for this abstract class.