Added fitting with lmfit (#128)

- added stand alone fitting using:
https://jugit.fz-juelich.de/mlz/lmfit.git
- fit_gaus, fit_pol1 with and without errors
- multi threaded fitting

---------

Co-authored-by: JulianHeymes <julian.heymes@psi.ch>
This commit is contained in:
Erik Fröjdh
2025-02-12 16:35:48 +01:00
committed by GitHub
parent c0c5e07ad8
commit 7309cff47c
18 changed files with 893 additions and 160 deletions
+7 -1
View File
@@ -10,8 +10,14 @@ from ._aare import hitmap
from ._aare import ClusterFinderMT, ClusterCollector, ClusterFileSink, ClusterVector_i
from ._aare import fit_gaus, fit_pol1
from .CtbRawFile import CtbRawFile
from .RawFile import RawFile
from .ScanParameters import ScanParameters
from .utils import random_pixels, random_pixel
from .utils import random_pixels, random_pixel, flat_list
#make functions available in the top level API
from .func import *
+1
View File
@@ -0,0 +1 @@
from ._aare import gaus, pol1
+5 -1
View File
@@ -20,4 +20,8 @@ def random_pixel(xmin=0, xmax=512, ymin=0, ymax=1024):
Returns:
tuple: (row, col)
"""
return random_pixels(1, xmin, xmax, ymin, ymax)[0]
return random_pixels(1, xmin, xmax, ymin, ymax)[0]
def flat_list(xss):
"""Flatten a list of lists."""
return [x for xs in xss for x in xs]