23 lines
458 B
Python
23 lines
458 B
Python
import pytest
|
|
import numpy as np
|
|
|
|
import cristallina.analysis
|
|
|
|
__author__ = "Alexander Steppke"
|
|
|
|
|
|
def test_2d_gaussian():
|
|
|
|
image = np.array([[0,0,0,0,0],
|
|
[0,0,0,0,0],
|
|
[0,0,1,0,0],
|
|
[0,0,0,0,0],
|
|
[0,0,0,0,0],
|
|
])
|
|
|
|
center_x, center_y, result = cristallina.analysis.fit_2d_gaussian(image)
|
|
assert np.allclose(center_x, 2.0, rtol=1e-04)
|
|
assert np.allclose(center_y, 2.0, rtol=1e-04)
|
|
|
|
|