fixed for lmfit 1.2

This commit is contained in:
2023-04-21 17:53:04 +02:00
parent f13e36ce6d
commit 99a3f51c57
2 changed files with 7 additions and 4 deletions

View File

@@ -204,7 +204,7 @@ def fit_2d_gaussian(image, roi: Optional[ROI] = None, plot=False):
z = im.ravel() # and this also as a 1D
model = lmfit.models.Gaussian2dModel()
params = model.guess(z, x, y)
params = model.guess(z.astype('float'), x.astype('float'), y.astype('float'))
result = model.fit(
z,
x=x,

View File

@@ -5,9 +5,6 @@ from cristallina.utils import ROI, print_run_info, heuristic_extract_pgroup, gau
def test_print(capsys):
# this currently works only if the heuristic p-group extraction works
# TODO: fix this shortcoming and use base_path throughout
print_run_info(185, base_path="tests/data/p20841/raw/")
captured = capsys.readouterr()
assert "17259343145" in captured.out
@@ -36,9 +33,15 @@ def test_find_nearest():
a = np.linspace(0,99,100)
assert find_nearest(a,10.1) == 10
<<<<<<< HEAD
# TODO: repair with newer xraydb 4.5.0 when available in conda-forge
# def test_xray_transmission():
# T = xray_transmission(9000, 100e-6, material = 'Si')
# assert T == 0.342385039732607
=======
def test_xray_transmission():
T = xray_transmission(9000, 100e-6, material = 'Si')
assert T == 0.342385039732607
>>>>>>> fd8f63b (fixed for lmfit 1.2)