Data Objects (dataobjs
)#
Define data objects.
Binning. |
- class triumvirate.dataobjs.Binning#
Bases:
object
Binning.
- Parameters
space ({‘config’, ‘fourier’}) – Coordinate space.
scheme ({‘lin’, ‘log’, ‘linpad’, ‘logpad’}) – Binning scheme. See the note below for more details.
bin_min, bin_max (float, optional) – Minimum and maximum of the bin range (defaults are None).
num_bins (int, optional) – Number of bins (default is None).
- Variables
space ({'config', 'fourier'}) – Coordinate space.
scheme ({'lin', 'log', 'linpad', 'logpad'}) – Binning scheme. See the note below for more details.
bin_min (float or None) – Minimum of the bin range.
bin_max (float or None) – Maximum of the bin range.
num_bins (int or None) – Number of bins.
bin_edges (list of float) – Bin edges of length (
num_bins
+ 1).bin_centres (list of float) – Bin centres of length
num_bins
.bin_widths (list of float) – Bin widths of length
num_bins
.
Binning scheme
The bin setting method supports linear (‘lin’) and log-linear/exponential (‘log’) binning, with possible linear padding from zero for the first 5 bins (‘linpad’ or ‘logpad’). The padding is either 1.e-3 (‘fourier’ space) and 10. (‘config’ space), or determined by the mesh grid resolution if set using mesh grid sizes.
- bin_centres#
‘vector[double]’
- Type
bin_centres
- bin_edges#
‘vector[double]’
- Type
bin_edges
- bin_max#
‘double’
- Type
bin_max
- bin_min#
‘double’
- Type
bin_min
- bin_widths#
‘vector[double]’
- Type
bin_widths
- classmethod from_parameter_set(cls, paramset)#
Create binning from a parameter set.
- Parameters
paramset (
ParameterSet
) – Parameter set.- Raises
ValueError – When the ‘space’ parameter is unset or unrecognised in paramset. See the note below for more details.
Attention
If paramset has been initialised without an appropriate ‘statistic_type’ parameter value, the derived ‘space’ parameter is unset and must be specified to be the either of {‘fourier’, ‘config’} before paramset is to this method. See also
ParameterSet
.
- num_bins#
‘int’
- Type
num_bins
- scheme#
unicode
- Type
scheme
- set_bins(self, bin_min, bin_max, num_bins)#
Set binning based on the bin range and number using the current binning scheme.
Bin edges, centres and widths are recalculated.
- Parameters
bin_min, bin_max (float) – Minimum and maximum of the bin range.
num_bins (int) – Number of bins.
- set_custom_bins(self, bin_edges)#
Set customised binning using bin edges.
The binning
scheme
is set to ‘custom’.bin_centres
andbin_widths
are automatically calculated.- Parameters
bin_edges (1-d array of float) – Bin edges of length (
num_bins
+ 1).
- set_grid_based_bins(self, boxsize, ngrid)#
Set linear binning based on a mesh grid.
The binning
scheme
is overriden to ‘lin’. The bin width is given by the grid resolution in configuration space or the fundamental wavenumber in Fourier space. The bin minimum is zero and the bin maximum is half the box size in configuration space or the Nyquist wavenumber in Fourier space.- Parameters
boxsize (float or sequence of [float, float, float]) – Mesh box size (maximum).
ngrid (int or sequence of [int, int, int]) – Mesh grid number (minimum).
- space#
unicode
- Type
space
- triumvirate.dataobjs.__reduce_cython__(self)#
- triumvirate.dataobjs.__setstate_cython__(self, __pyx_state)#