Exemplo n.º 1
0
 def test_parse_file(self):
     targets = target_parser.parse_file(TARGETS_PATH)
     self.assertNotEqual(targets, [])
     t_zero, scan_zero, _, _ = targets[0]
     self.assertEqual(t_zero.label, "Alpha")
     self.assertEqual(scan_zero, "EqCross1_3")
     self.assertEqual(t_zero.coord.lon.fmt(), "12:00:00.0000h")
     t_gamma, _, _, _= targets[6]
     self.assertEqual(t_gamma.tsys, 2)
     self.assertEqual(t_gamma.repetitions, 4)
     t_offset, _, _, _ = targets[7]
     self.assertEqual(t_offset.offset_coord.lon, VAngle(-0.5))
Exemplo n.º 2
0
 def setUp(self):
     shutil.rmtree(BASE_PATH, True) #ignores errors
     os.makedirs(BASE_PATH)
     self.conf = validate_configuration("src/user_templates/configuration.txt")
     targetsFile = os.path.join("src/user_templates", self.conf.pop('targetsFile'))
     parsed_targets = target_parser.parse_file(targetsFile)
     backends = self.conf.pop("backends")
     scantypes = self.conf.pop("scantypes")
     self.sched = schedule.Schedule(**self.conf)
     self.sched.backends = backends
     self.sched.scantypes = scantypes
     for _target, _scanmode, _backend, _  in parsed_targets:
         self.sched.add_scan(_target, _scanmode, _backend)
     self.sched.set_base_dir(BASE_PATH)