yaw.core.abc.BinnedQuantity#
- class yaw.core.abc.BinnedQuantity[source]#
Bases:
ABCBase class for an object that has data organised in redshift bins.
Methods
__init__()concatenate_bins(*data)Concatenate pair count data containers with equal patches.
Get the underlying, exact redshift bin intervals.
is_compatible(other[, require])Check whether this instance is compatible with another instance.
Attributes
An
Indexerattribute that supports iteration over the bins or selecting a subset of the bins.Specifies on which side the redshift bin intervals are closed, can be:
left,right,both,neither.Get the width of the redshift bins as array.
Get the edges of the redshift bins as flat array.
Get the centers of the redshift bins as array.
Get the number of redshift bins.
- abstract property bins: Indexer#
An
Indexerattribute that supports iteration over the bins or selecting a subset of the bins.The indexer always returns new container instances with the indexed data subset or the current item when iterating.
Warning
Indexing rules for a one-dimensional numpy array apply, however if the resulting binning is not contiguous or contains repeated bins, some operations on the returned container may fail.
- Returns:
yaw.core.containers.Indexer
- property closed: str#
Specifies on which side the redshift bin intervals are closed, can be:
left,right,both,neither.
- abstract concatenate_bins(*data: _Tbinned) _Tbinned[source]#
Concatenate pair count data containers with equal patches.
The data is merged by appending the data along the redshift binning axis.
Note
Necessary condition for merging is that the patch numbers are identical and that the merged binning is contiguous and non-overlapping. Cannot merge cross- with autocorrelation containers.
- Parameters:
*data – Containers of same type that are appended to the patch dimension of this container.
- Returns:
New instance of this container with combined data.
- property dz: ndarray[Any, dtype[float64]]#
Get the width of the redshift bins as array.
- property edges: ndarray[Any, dtype[float64]]#
Get the edges of the redshift bins as flat array.
- abstract get_binning() IntervalIndex[source]#
Get the underlying, exact redshift bin intervals.
- Returns:
pandas.IntervalIndex
- is_compatible(other: _Tbinned, require: bool = False) bool[source]#
Check whether this instance is compatible with another instance.
Ensures that both objects are instances of the same class and that the redshift binning is identical.
- Parameters:
other (
BinnedQuantity) – Object instance to compare to.require (
bool, optional) – Raise a ValueError if any of the checks fail.
- Returns:
bool
- property mids: ndarray[Any, dtype[float64]]#
Get the centers of the redshift bins as array.
- property n_bins: int#
Get the number of redshift bins.