multifit: simultaneous fitting to multiple data sets.

Copyright (C) 2026 Johannes Sørby Heines

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

class multifit.data.Data(counts: ArrayLike, bin_edges: ArrayLike, key: str)

Bases: object

Base class for input data.

classmethod equal_bins(*, counts: ArrayLike, bin_width: float, minimum: float = 0, key: str) → Self

Construct an instance of cls with equal width bins.

class multifit.data.Spectrum(*, counts: ArrayLike, bin_edges: ArrayLike, key: str)

Bases: Data

truncate(lower_bin_edge, upper_bin_edge, inplace=False)

Select a range of the spectrum.

Keyword Arguments:
  • lower_bin_edge – first bin edge to include.

  • upper_bin_edge – last bin edge to include.

  • inplace (bool) – if True, modify the current Spectrum and return None, if False create and return a new Spectrum.

class multifit.data.CoincidenceMatrix(*, counts: ArrayLike, bin_edges: ArrayLike, key: str)

Bases: Data

gate(lower: float, upper: float) → Spectrum

Return a Spectrum by gating on the coincidence matrix.

Parameters:
  • lower – lower value of the gate

  • upper – upper value of the gate

  • axis – axis on which to apply the gate.