exoiris.binning.Binning#
- class exoiris.binning.Binning(xmin: float, xmax: float, nb: float | None = None, bw: float | None = None, r: float | None = None)[source]#
Class representing a homogeneous binning within a given range.
The
Binningis defined by its minimum and maximum values (xminandxmax), and either the number of bins (nb), bin width (bw), or resolving power (r). If theBinningis initialized giving the number of bins, the range will be divided intonbequally wide bins. If theBinningis initialized giving the bin width, the range will be divided into bins that are as close asbwas possible. Finally, if theBinningis initialized with the resolving power, the bin widths aim to follow the x/xv relation.- Parameters:
xmin – The minimum value of the range of values to be binned.
xmax – The maximum value of the range of values to be binned.
nb – The number of bins to be used for binning the range of values.
bw – The bin width to be used for binning the range of values.
r – The resolving power to be used for binning the range of values.
- Raises:
ValueError – When none or more than one of
nb,bw, andrare provided.
- xmin#
The minimum value of the range of values to be binned.
- xmax#
The maximum value of the range of values to be binned.
- nb#
The number of bins.
- bw#
The bin width.
- r#
The resolving power.
- bins#
An array of left and right bin edge values.
- __init__(xmin: float, xmax: float, nb: float | None = None, bw: float | None = None, r: float | None = None) None[source]#
Methods
__init__(xmin, xmax[, nb, bw, r])Attributes
A (nb, 2) array of left and right bin edge values.