-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c283774
commit fdfbd38
Showing
4 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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,26 @@ | ||
|
||
from ..detector import MegaraDetector, ReadParams | ||
|
||
|
||
def create_detector(): | ||
DSHAPE = (2056 * 2, 2048 * 2) | ||
PSCAN = 50 | ||
OSCAN = 50 | ||
qe = 1.0 | ||
dcurrent = 3.0 / 3600 | ||
|
||
readpars1 = ReadParams(gain=1.0, ron=2.0, bias=1000.0) | ||
readpars2 = ReadParams(gain=1.0, ron=2.0, bias=1005.0) | ||
|
||
detector = MegaraDetector( | ||
'Detector', | ||
DSHAPE, OSCAN, PSCAN, qe=qe, dark=dcurrent, | ||
readpars1=readpars1, readpars2=readpars2, bins='11' | ||
) | ||
return detector | ||
|
||
|
||
def test_detector_shape(): | ||
det = create_detector() | ||
img = det.readout() | ||
assert img.shape == (4212, 4196) |
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,28 @@ | ||
import pytest | ||
|
||
from ..shutter import MegaraShutter | ||
|
||
@pytest.fixture | ||
def shutter_dev(): | ||
wheel = MegaraShutter() | ||
return wheel | ||
|
||
|
||
def test_shutter1(shutter_dev): | ||
curr = shutter_dev.current() | ||
assert shutter_dev.pos() == 1 | ||
assert curr.name == 'OPEN' | ||
|
||
|
||
def test_shutter_open(shutter_dev): | ||
shutter_dev.open() | ||
curr = shutter_dev.current() | ||
assert shutter_dev.pos() == 1 | ||
assert curr.name == 'OPEN' | ||
|
||
|
||
def test_shutter_stop(shutter_dev): | ||
shutter_dev.close() | ||
curr = shutter_dev.current() | ||
assert shutter_dev.pos() == 0 | ||
assert curr.name == 'STOP' |
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,23 @@ | ||
import pytest | ||
|
||
from ..wheel import VPHWheel | ||
|
||
|
||
class Vph(object): | ||
def __init__(self, name): | ||
self.name = name | ||
|
||
|
||
@pytest.fixture | ||
def wheel_dev(): | ||
wheel = VPHWheel(3) | ||
for idx in range(3): | ||
wheel.put_in_pos(Vph(idx), idx) | ||
return wheel | ||
|
||
|
||
def test_wheel(wheel_dev): | ||
curr = wheel_dev.current() | ||
assert isinstance(curr, Vph) | ||
assert curr.name == 0 | ||
assert wheel_dev.pos() == 0 |