Class Binning#

Class Documentation#

class Binning#

Isotropic coordinate binning.

This sets up isotropic wavenumber or separation bins in configuration or Fourier space.

Public Functions

Binning(std::string space, std::string scheme)#

Construct binnng from bin specification.

Parameters
  • space – Coordinate space, one of {“fourier”, “config”}.

  • schemeBinning scheme, one of {“lin”, “log”, “linpad”, “logpad”}.

Binning(trv::ParameterSet &params)#

Construct binning from a parameter set.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

params – Paramater set.

void set_bins(double coord_min, double coord_max, int nbin)#

Set bins.

Note

If scheme is “lin” or “log”, the bin edges are set linearly or log-linearly (i.e. exponentially) in the bin range. If scheme is “linpad”, “logpad”, 5 linear bins are set from zero (leftmost edge) with width 1.e-3 (“fourier”) or 10. (“config”) with the remaining bin range divided linearly or log-linearly.

Parameters
  • coord_min – Minimum coordinate in bin range.

  • coord_max – Maximum coordinate in bin range.

  • nbin – Number of bins.

Throws
void set_bins()#

Set bins.

The bin properties are inferred from trv::ParameterSet when initialised with trv::Binning::Binning(trv::ParameterSet&).

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void set_bins(double boxsize_max, int ngrid_min)#

Construct binning from a mesh grid.

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 boxsize in configuration space or the Nyquist wavenumber in Fourier space.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Attention

trv::Binning::scheme is reset to “lin”.

Parameters
  • boxsize_max – (Maximum) box size.

  • ngrid_min – (Minimum) grid number.

void set_bins(std::vector<double> bin_edges)#

Set bins from custom bin edges.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

bin_edges – Custom bin edges (in ascending order).

Public Members

std::string space#

coordinate space

std::string scheme#

binning scheme

double bin_min#

lowest bin edge

double bin_max#

highest bin edge

int num_bins#

number of bins

std::vector<double> bin_edges#

bin edges

std::vector<double> bin_centres#

bin centres

std::vector<double> bin_widths#

bin widths