profiley.numeric

Stand-alone numerical implementations

Module Contents

Functions

offset(profile, R, Roff[, weights, theta_samples])

Calcuate any profile with a reference point different

project(func, R[, log_rmin, log_rmax, integral_samples])

profiley.numeric.offset(profile, R, Roff, weights=None, *, theta_samples=360)

Calcuate any profile with a reference point different from its center

This is useful, for instance, when large-scale structure profiles beyond the one-halo profiles implemented directly in profiley, need to be calculated around offset positions.

This implementation is significantly faster than Profile.offset so it should be preferred.

Parameters

profilearray, shape ([M,…,]N)

the numerical value of the profile(s) to offset. Note that profile is expected to be transposed with respect to the output of profiley. The returned profile, therefore, should be transposed back if working with profiley

Rnp.ndarray, shape (N,)

radii at which profile has been calculated. The same radii will be used to calculate the offset profile

Roffnp.ndarray, shape (P,)

offsets with respect to the profile center

Optional parameters

weights to apply to each profile corresponding to every value of Roff. See Returns below

theta_samplesint

number of samples for the angular integral from 0 to \(2\pi\)

weights : array of floats, shape (P,)

Returns

offsetnp.ndarray,

offset profile. The shape of the array depends on whether the weights argument is specified: if not specified (default), then

shape: ([M,...,]P,N)

if weights is provided, then the first axis will be weight-averaged over so that

shape: ([M,...,]N)
profiley.numeric.project(func, R, log_rmin: float = -10, log_rmax: float = 5, integral_samples: int = 1005)