spatula.util

Overview

get_num_threads()

Get the number of threads used when computing PGOP.

set_num_threads(num_threads)

Set the number of threads to use when computing PGOP.

sph_to_cart(theta, phi)

Convert spherical to Cartesian coordinates on the unit sphere.

Details

General utility functions for the package and users.

spatula.util.get_num_threads()[source]

Get the number of threads used when computing PGOP.

Returns:

num_threads – The number of threads.

Return type:

int

spatula.util.set_num_threads(num_threads)[source]

Set the number of threads to use when computing PGOP.

Parameters:

num_threads (int) – The number of threads.

spatula.util.sph_to_cart(theta, phi)[source]

Convert spherical to Cartesian coordinates on the unit sphere.

Parameters:
  • theta ((N,)(N,) numpy.ndarray of float) – The longitudinal (polar) angle from [0,π][0, \pi].

  • phi ((N,)(N,) numpy.ndarray of float) – The latitudinal (azimuthal) angle from [0,2π][0, 2 \pi].

Returns:

coords – The Cartesian coordinates of the points.

Return type:

(N,3)(N, 3) numpy.ndarray of float