Source
525
525
with factors or obtained from the Jy/K Web API are given as the 'parameter'
526
526
argument.
527
527
528
528
Details are as follows.
529
529
https://open-jira.nrao.edu/browse/CAS-12236
530
530
"""
531
531
test_tmp_dir = 'tmp_test_gencal'
532
532
533
533
ms_key = 'uid___A002_X85c183_X36f.ms'
534
534
vis = os.path.join(test_tmp_dir, ms_key)
535
-
test_data_path = ctsys.resolve('measurementset/almasd')
536
-
test_data_path = 'test_data' # should move test data collection
537
535
538
536
caltable = os.path.join(test_tmp_dir, 'generated_caltable_by_gencal.cal')
539
537
540
538
def setUp(self):
541
539
self._delete_dir(self.caltable)
542
540
543
541
def tearDown(self):
544
542
self._delete_dir(self.caltable)
545
543
546
544
@classmethod
547
545
def setUpClass(cls):
548
546
if os.path.exists(cls.test_tmp_dir):
549
547
shutil.rmtree(cls.test_tmp_dir)
550
548
551
549
os.mkdir(cls.test_tmp_dir)
552
550
553
-
original_vis = os.path.join(cls.test_data_path, '.'.join([cls.ms_key, 'sel']))
551
+
ms_datapath = ctsys.resolve('measurementset/almasd')
552
+
original_vis = os.path.join(ms_datapath, '.'.join([cls.ms_key, 'sel']))
554
553
shutil.copytree(original_vis, cls.vis, symlinks=False)
555
554
556
555
@classmethod
557
556
def tearDownClass(cls):
558
557
shutil.rmtree(cls.test_tmp_dir)
559
558
560
559
def _delete_dir(self, path):
561
560
if os.path.exists(path):
562
561
shutil.rmtree(path)
563
562
564
563
def _copy_file(self, file_name):
565
-
original = os.path.join(self.test_data_path, file_name)
564
+
original = os.path.join(datapath, file_name)
566
565
destination = os.path.join(self.test_tmp_dir, file_name)
567
566
shutil.copyfile(original, destination)
568
567
return destination
569
568
570
569
def _copy_dir(self, file_name):
571
-
original = os.path.join(self.test_data_path, file_name)
570
+
original = os.path.join(datapath, file_name)
572
571
destination = os.path.join(self.test_tmp_dir, dist_file_name)
573
572
shutil.copytree(original, destination, symlinks=False)
574
573
return destination
575
574
576
575
def test_jyperk_gencal_for_factor_file(self):
577
576
"""Test to check that the factors in the csv file are applied to the caltable.
578
577
579
578
The following arguments are required for this test.
580
579
* caltype='jyperk'
581
580
* infile