def createCam(camType): """Create the camera object. Parameters ---------- camType : enum 'CamType' Camera type. Returns ------- LsstCam, LsstFamCam, or ComCam Camera object. Raises ------ ValueError The camera type does not match. """ if camType == CamType.LsstCam: return LsstCam() elif camType == CamType.LsstFamCam: return LsstFamCam() elif camType == CamType.ComCam: return ComCam() else: raise ValueError("The camera type does not match.")
class TestLsstFamCam(unittest.TestCase): """Test the LsstCam class.""" def setUp(self): self.cam = LsstFamCam() self.cam.setObsMetaData(0, 0, 0, mjd=59580.0) def testGetWfsCcdList(self): wfsList = self.cam.getWfsCcdList() self.assertEqual(len(wfsList), 189) def testGetWavefrontSensor(self): wfsData = self.cam.getWavefrontSensor() self.assertEqual(len(wfsData), 189)
def setUp(self): self.cam = LsstFamCam() self.cam.setObsMetaData(0, 0, 0, mjd=59580.0)