:py:mod:`profiley.numeric` ========================== .. py:module:: profiley.numeric .. autoapi-nested-parse:: Stand-alone numerical implementations Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: profiley.numeric.offset profiley.numeric.project .. py:function:: 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 ---------- profile : array, 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`` R : np.ndarray, shape (N,) radii at which ``profile`` has been calculated. The same radii will be used to calculate the offset profile Roff : np.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_samples : int number of samples for the angular integral from 0 to :math:`2\pi` weights : array of floats, shape (P,) Returns ------- offset : np.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) .. py:function:: project(func, R, log_rmin: float = -10, log_rmax: float = 5, integral_samples: int = 1005)