Example #1
0
 def test_parse_file_negative_coord(self):
     targets = target_parser.parse_file(TARGETS_PATH)
     self.assertNotEqual(targets, [])
     t_zero, scan_zero, _, _ = targets[2]
     self.assertEqual(t_zero.label, "Alpha")
     self.assertEqual(scan_zero, "DownSkydip")
     self.assertEqual(t_zero.coord.lon.fmt(), "00:03:00.0000h")
     self.assertEqual(t_zero.coord.lat.fmt(), "-00:00:03.0000")
     t_zero, scan_zero, _, _ = targets[3]
     self.assertEqual(t_zero.coord.lon.fmt(), "00:00:02.0000h")
     self.assertEqual(t_zero.coord.lat.fmt(), "-00:03:00.0000")
Example #2
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))
Example #3
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[8]
     self.assertEqual(t_gamma.tsys, 2)
     self.assertEqual(t_gamma.repetitions, 4)
     t_offset, _, _, _ = targets[9]
     self.assertEqual(t_offset.offset_coord.lon, VAngle(-0.5))
Example #4
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)
Example #5
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)