yaw.config.ScalesConfig#
- class yaw.config.ScalesConfig(rmin: list[float] | float, rmax: list[float] | float, rweight: float | None = None, rbin_num: int = 50)[source]#
Bases:
BaseConfigConfiguration of scales used for correlation measurements.
Correlation functions are measured on one or many intervals \(r_{\rm min} \leq r < r_{\rm max}\) angular diameter distance in kpc. When measuring correlations, this scale is coverted to angles at the current redshift.
Additionally, pairs can be weighted by their separation \(r^\alpha\) if a power-law exponent is provided through
rweight. The weighting is applied logarithmically spaced bins of separation (based on the logarithmic bin centers). This is an approximation to actually weighting each pair individually and the resolution of this approximation can be controlled by setting the number of bins.- Parameters:
rmin (
float,list[float]) – Single or multiple lower scale limits in kpc (angular diameter distance).rmax (
float,list[float]) – Single or multiple upper scale limits in kpc (angular diameter distance).rweight (
float, optional) – Power-law exponent used to weight pairs by their separation.rbin_num (
int, optional) – Number of radial logarithmic bin used to approximate the weighting by separation.
Methods
__init__(rmin, rmax[, rweight, rbin_num])as_array()Obtain the scales cuts as array of shape (2, N)
create(**kwargs)Create a new configuration object.
Get the scale cuts formatted as a list of strings.
from_dict(the_dict, **kwargs)Create a class instance from a dictionary representation of the minimally required data.
modify([rmin, rmax, rweight, rbin_num])Create a copy of the current configuration with updated parameter values.
to_dict()Serialise the class instance to a dictionary containing a minimal set of required data.
Attributes
Number of radial logarithmic bin used to approximate the weighting by separation.
Power-law exponent used to weight pairs by their separation.
Lower scale limit(s) in kpc (angular diameter distance).
Upper scale limit(s) in kpc (angular diameter distance).
- classmethod create(**kwargs: Any) T#
Create a new configuration object.
By default this is an alias for
__init__(). Configuration classes that are hierarchical (i.e. contain configuration objects as attributes) implement this method to provide a single constructer for its own and its subclasses parameters.
- dict_keys() list[str][source]#
Get the scale cuts formatted as a list of strings.
Format is
kpc[rmin]t[rmax], used as keys to pack outputs of correlation measurements in a dictionary when measuring with multiple scales cuts.Deprecated since version 2.3.1: Use instead
>>> [str(scale) for scale in ScalesConfig] ...
- classmethod from_dict(the_dict: dict[str, Any], **kwargs: dict[str, Any]) T#
Create a class instance from a dictionary representation of the minimally required data.
- Parameters:
the_dict (
dict) – Dictionary containing the data.**kwargs – Additional data needed to construct the class instance.
- modify(rmin: list[float] | float = NotSet, rmax: list[float] | float = NotSet, rweight: float | None = NotSet, rbin_num: int = NotSet) ScalesConfig[source]#
Create a copy of the current configuration with updated parameter values.
The method arguments are identical to
create(). Values that should not be modified are by default represented by the special valueNotSet.
- rbin_num: int = 50#
Number of radial logarithmic bin used to approximate the weighting by separation.
- rmax: list[float] | float#
Upper scale limit(s) in kpc (angular diameter distance).
- rmin: list[float] | float#
Lower scale limit(s) in kpc (angular diameter distance).
- rweight: float | None = None#
Power-law exponent used to weight pairs by their separation.
- to_dict() dict[str, Any]#
Serialise the class instance to a dictionary containing a minimal set of required data.
- Returns:
dict