1 from __future__
import absolute_import, division, print_function
2 from future.utils
import with_metaclass
32 Tests that the butler returns a useable Camera. 34 In the subclasses's setUp(): 35 * Call setUp_camera() to fill in required parameters. 41 first_detector_name=None
44 Set up the necessary variables for camera tests. 52 number of detectors in this camera 53 first_detector_name : `str` 54 name of the first detector in this camera 56 fields = [
'camera_name',
60 CameraData = collections.namedtuple(
"CameraData", fields)
62 n_detectors=n_detectors,
63 first_detector_name=first_detector_name
67 """Simplest camera test: can we get a Camera instance, and does iterating return Detectors?""" 68 camera = self.butler.get(
'camera', immediate=
True)
69 self.assertIsInstance(camera, lsst.afw.cameraGeom.Camera)
70 for detector
in camera:
71 msg =
"Failed for detector={}".format(detector)
72 self.assertIsInstance(detector, lsst.afw.cameraGeom.Detector, msg=msg)
75 """Check that the butler returns the right type of camera.""" 76 camera = self.butler.get(
'camera', immediate=
True)
77 self.assertEqual(camera.getName(), self.
camera_data.camera_name)
78 self.assertEqual(len(camera), self.
camera_data.n_detectors)
79 self.assertEqual(next(iter(camera)).getName(), self.
camera_data.first_detector_name)
def test_camera_butler(self)
def setUp_camera(self, camera_name=None, n_detectors=None, first_detector_name=None)