nectarchain.makers.component.spe.spe_algorithm.ContextFit#

class ContextFit(_class, minuitParameters_array: ndarray, charge: ndarray, counts: ndarray)[source]#

Bases: object

Context manager for setting up and tearing down global variables used by multiprocessing processes during SPE fitting.

On enter, it initializes global arrays (charge, counts, minuit parameters) and the chi2 cost function via init_processes. On exit, it cleans up the globals to free memory.

Initialise the fit context manager.

Parameters:
_classtype

The SPE algorithm class to use for the chi2 function.

minuitParameters_arraynp.ndarray

Array of Minuit parameter objects for each pixel.

chargenp.ndarray

Charge histogram bin centres (masked array).

countsnp.ndarray

Charge histogram bin counts (masked array).

Methods