profiley.numeric
Stand-alone numerical implementations
Module Contents
Functions
|
Calcuate any profile with a reference point different |
|
- 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.offsetso it should be preferred.Parameters
- profilearray, shape ([M,…,]N)
the numerical value of the profile(s) to offset. Note that
profileis expected to be transposed with respect to the output ofprofiley. The returned profile, therefore, should be transposed back if working withprofiley- Rnp.ndarray, shape (N,)
radii at which
profilehas 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. SeeReturnsbelow- 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
weightsargument is specified: if not specified (default), thenshape: ([M,...,]P,N)
if
weightsis provided, then the first axis will be weight-averaged over so thatshape: ([M,...,]N)
- profiley.numeric.project(func, R, log_rmin: float = -10, log_rmax: float = 5, integral_samples: int = 1005)