fitlistreader.fitlist

Module Contents

Classes

Fitlist

Representation of a Fitlist as a Sequence of Peaks, grouped in Fits.

class fitlistreader.fitlist.Fitlist(path: str)[source]

Bases: collections.abc.Sequence

Representation of a Fitlist as a Sequence of Peaks, grouped in Fits.

Encompasses all neccessary information which is saved in a fitlist, most importantly the peak information. Those can be accessed as a flattened array via their consecutive indices. As a Sequence, Fitlists can be accessed backwards via negative-Indexing, just like standard python Lists. Calibrations and integrals are saved in separate structures and accessed through object methods.

- get_integral_by_peakID
- get_integral_list_by_type
- get_all_integrals
- closest
__len__()[source]
__getitem__(i)[source]
get_integral_by_peakID(peakID: int) fitlistreader.fitintegralcoll.FitIntegralCollection[source]

returns the FitIntegralCollection for a given peakID.

Each Fit contains a collection of integrals, regardless whether it was created because of a peakfit of an integration. With a peakfit it is needed for the background determination.

Parameters:

peakID (int) – ID of the peak (NOT the index in this Fitlist object, but the Peak.ID property)

get_integral_list_by_type(int_type: str, include_ids: bool = False) list[source]

Returns all FitIntegrals of a given type as a list.

Parameters:
  • int_type (str) – Selects which type of integrals to return. Possible Types: sub, bg, tot

  • include_ids (bool) – If True, populates list with tuples of (FitIntegral, integralID:int)

get_all_integrals() list[source]

Returns all FitIntegralCollection objects in a List, ordered by integralID.

closest(pos)[source]

Returns the peak with the best matching position to the argument pos

debug()[source]