-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from matthewtownson/master
Tests and bug fixing
- Loading branch information
Showing
6 changed files
with
63 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from aotools import functions | ||
import numpy | ||
|
||
|
||
def test_gaussian2d(): | ||
gaussian = functions.gaussian2d(10, 3, 10.) | ||
assert gaussian.shape == (10, 10) | ||
|
||
|
||
def test_gaussian2d_2d(): | ||
gaussian = functions.gaussian2d((10, 8), (3, 2), 10., (4, 3)) | ||
print(gaussian.shape) | ||
assert gaussian.shape == (10, 8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from aotools import image_processing | ||
import numpy | ||
|
||
|
||
def test_r0fromSlopes(): | ||
slopes = numpy.random.random((2, 100, 2)) | ||
wavelength = 500e-9 | ||
subapDiam = 0.5 | ||
r0 = image_processing.r0fromSlopes(slopes, wavelength, subapDiam) | ||
print(type(r0)) | ||
|
||
|
||
def test_slopeVarfromR0(): | ||
r0 = 0.1 | ||
wavelength = 500e-9 | ||
subapDiam = 0.5 | ||
variance = image_processing.slopeVarfromR0(r0, wavelength, subapDiam) | ||
assert type(variance) == float | ||
|
||
|
||
def test_image_contrast(): | ||
image = numpy.random.random((20, 20)) | ||
contrast = image_processing.image_contrast(image) | ||
assert type(contrast) == float | ||
|
||
|
||
def test_rms_contrast(): | ||
image = numpy.random.random((20, 20)) | ||
contrast = image_processing.rms_contrast(image) | ||
assert type(contrast) == float |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters