diff --git a/aotools/functions/zernike.py b/aotools/functions/zernike.py index 0eba058..719fafa 100644 --- a/aotools/functions/zernike.py +++ b/aotools/functions/zernike.py @@ -1,4 +1,5 @@ import numpy +import math from . import circle def phaseFromZernikes(zCoeffs, size, norm="noll", rot=0): @@ -88,10 +89,10 @@ def zernikeRadialFunc(n, m, r): for i in range(0, int((n - m) / 2) + 1): R += numpy.array(r**(n - 2 * i) * (((-1)**(i)) * - numpy.math.factorial(n - i)) / - (numpy.math.factorial(i) * - numpy.math.factorial(int(0.5 * (n + m) - i)) * - numpy.math.factorial(int(0.5 * (n - m) - i))), + math.factorial(n - i)) / + (math.factorial(i) * + math.factorial(int(0.5 * (n + m) - i)) * + math.factorial(int(0.5 * (n - m) - i))), dtype='float') return R diff --git a/test/test_centroiders.py b/test/test_centroiders.py index 8b066f6..a8fb3ab 100644 --- a/test/test_centroiders.py +++ b/test/test_centroiders.py @@ -1,5 +1,6 @@ from aotools import image_processing import numpy +# from nose.tools import raises def test_centre_of_gravity_single(): @@ -66,3 +67,13 @@ def test_correlation_many(): com = image_processing.correlation_centroid(im, ref, 0.3) assert (com.shape[0] == 2) assert(com.shape[1] == 5) + + +# @raises(ValueError) +# def test_correlation_error(): +# im = numpy.random.random((10)) +# ref = numpy.random.random((10, 10)) +# com = image_processing.correlation_centroid(im, ref, threshold=0.3) + + +