-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
optika.sensors.IdealImagingSensor
class. (#23)
- Loading branch information
Showing
3 changed files
with
107 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import pytest | ||
import numpy as np | ||
import astropy.units as u | ||
import named_arrays as na | ||
import optika | ||
from optika._tests.test_surfaces import AbstractTestAbstractSurface | ||
|
||
|
||
class AbstractTestAbstractImagingSensor( | ||
AbstractTestAbstractSurface, | ||
): | ||
def test_num_pixel(self, a: optika.sensors.AbstractImagingSensor): | ||
result = a.num_pixel | ||
assert isinstance(result, na.AbstractCartesian2dVectorArray) | ||
assert np.issubdtype(na.get_dtype(result.x), int) | ||
assert np.issubdtype(na.get_dtype(result.y), int) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
argnames="a", | ||
argvalues=[ | ||
optika.sensors.IdealImagingSensor( | ||
name="test sensor", | ||
width_pixel=15 * u.um, | ||
num_pixel=na.Cartesian2dVectorArray(2048, 1024), | ||
) | ||
], | ||
) | ||
class TestIdealImagingSensor( | ||
AbstractTestAbstractImagingSensor, | ||
): | ||
pass |