Histograms

centers2edges

apav.core.histogram.centers2edges(data, bin_width)[source]

Convert the x values of a histogram from bin centers to edges. This increases the size of the domain by 1.

Parameters:
  • data (ndarray) – histogram centers

  • bin_width (Real) – width of the bins

Return type:

ndarray

histogram2d

apav.core.histogram.histogram2d(x, y, extents, bins)[source]

Calculate two-dimensional histograms by specifying the number of bins.

Parameters:
  • x (ndarray) – Array 1

  • y (ndarray) – Array 2

  • extents (Tuple[Tuple[Number, Number], Tuple[Number, Number]]) – (tuple, tuple) designating range to perform mass_histogram

  • bins (int) – Number of bins

Return type:

ndarray

histogram1d

apav.core.histogram.histogram1d(data, bin_width, rng)[source]

1d mass_histogram that returns array of counts and array of bin centers.

Parameters:
  • data (ndarray) – data to compute the histogram on

  • bin_width (Number) – bin width of the bins

  • rng (Tuple[Number, Number]) – boundaries of the histogram

Return type:

Tuple[ndarray, ndarray]

histogram2d_binwidth

apav.core.histogram.histogram2d_binwidth(x, y, extents, bin_width=0.1)[source]

Calculate two-dimensional histograms by bin width instead of number of bins.

Parameters:
  • x (ndarray) – Array 1

  • y (ndarray) – Array 2

  • extents (Tuple[Tuple[Number, Number], Tuple[Number, Number]]) – (tuple, tuple) designating range to perform mass_histogram

  • bin_width (Number) – Width of the bins in Daltons

Return type:

ndarray