Coverage for tests/test_location.py : 35%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# Gemini North self.latitude_truth = 19.82396 self.longitude_truth = -155.46984 self.height_truth = 4213.0 self.latitude_rad_truth = math.radians(self.latitude_truth) self.longitude_rad_truth = math.radians(self.longitude_truth)
location = ObservatoryLocation(self.latitude_rad_truth, self.longitude_rad_truth, self.height_truth) self.assertEqual(location.latitude, self.latitude_truth) self.assertEqual(location.longitude, self.longitude_truth) self.assertEqual(location.height, self.height_truth)
location = ObservatoryLocation() location.for_lsst() lsst = simsUtils.Site(name='LSST') self.assertAlmostEqual(location.latitude, lsst.latitude, places=4) self.assertEqual(location.longitude, lsst.longitude) self.assertEqual(location.height, lsst.height)
condfdict = { 'obs_site': { 'latitude': self.latitude_truth, 'longitude': self.longitude_truth, 'height': self.height_truth } } location = ObservatoryLocation() location.configure(condfdict) self.assertEqual(location.latitude_rad, self.latitude_rad_truth) self.assertEqual(location.longitude_rad, self.longitude_rad_truth) self.assertEqual(location.height, self.height_truth)
location = ObservatoryLocation() location.reconfigure(self.latitude_rad_truth, self.longitude_rad_truth, self.height_truth) self.assertEqual(location.latitude_rad, self.latitude_rad_truth) self.assertEqual(location.longitude_rad, self.longitude_rad_truth) self.assertEqual(location.height, self.height_truth)
cd = ObservatoryLocation.get_configure_dict() self.assertEqual(len(cd), 1) self.assertEqual(len(cd["obs_site"]), 3)
lsst.utils.tests.init()
lsst.utils.tests.init() unittest.main() |