From 6e4d24ed15b50411a7b1541ea078756fc455f4ac Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 12 Jul 2016 11:07:06 +0200 Subject: Add some TANGO tests --- tests/roi.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/roi.py (limited to 'tests/roi.py') diff --git a/tests/roi.py b/tests/roi.py new file mode 100644 index 0000000..f429740 --- /dev/null +++ b/tests/roi.py @@ -0,0 +1,35 @@ +import argparse +import PyTango +import tifffile + + +def grab(camera, height=3840, offset=0): + if height < 3840: + camera.roi_y0 = offset + camera.roi_height = height + else: + camera.roi_height = height + camera.roi_y0 = offset + + try: + camera.Start() + except: + camera.Stop() + camera.Start() + + frame = camera.image + tifffile.imsave('frame-{}-{}.tif'.format(offset, height), frame) + camera.Stop() + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--device', '-d', type=str, help="TANGO device path") + + args = parser.parse_args() + + camera = PyTango.DeviceProxy(args.device) + + grab(camera) + grab(camera, height=3640) + grab(camera, height=3640, offset=200) -- cgit v1.2.3 From a5404f23789a73804dfa63721df995188b4bbb9d Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 12 Jul 2016 11:08:03 +0200 Subject: Require device string --- tests/roi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/roi.py') diff --git a/tests/roi.py b/tests/roi.py index f429740..0f614cd 100644 --- a/tests/roi.py +++ b/tests/roi.py @@ -24,7 +24,8 @@ def grab(camera, height=3840, offset=0): if __name__ == '__main__': parser = argparse.ArgumentParser() - parser.add_argument('--device', '-d', type=str, help="TANGO device path") + parser.add_argument('--device', '-d', type=str, required=True, + help="TANGO device path") args = parser.parse_args() -- cgit v1.2.3 From c09eaa3be331f1746744ef2562360528a8358dd1 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 12 Jul 2016 11:08:54 +0200 Subject: Use auto triggering in ROI test --- tests/roi.py | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/roi.py') diff --git a/tests/roi.py b/tests/roi.py index 0f614cd..fad0717 100644 --- a/tests/roi.py +++ b/tests/roi.py @@ -30,6 +30,7 @@ if __name__ == '__main__': args = parser.parse_args() camera = PyTango.DeviceProxy(args.device) + camera.trigger_source = 0 grab(camera) grab(camera, height=3640) -- cgit v1.2.3