Source
mst_local.sort('mms_sorted.ms',['OBSERVATION_ID','ARRAY_ID','SCAN_NUMBER','FIELD_ID','DATA_DESC_ID','ANTENNA1','ANTENNA2','TIME'])
##########################################################################
# test_task_partition.py
# Copyright (C) 2018
# Associated Universities, Inc. Washington DC, USA.
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
# License for more details.
#
#
# Based on the requirements listed in casadocs found here:
# https://casadocs.readthedocs.io/en/stable/api/tt/casatasks.manipulation.partition.html
#
##########################################################################
import os
import shutil
import time
import unittest
from casatasks import listobs, listpartition, flagdata, flagmanager, partition, setjy, split
from casatools import ctsys, msmetadata, ms, agentflagger, table
from casatasks.private import partitionhelper as ph ##### <----<<< this dependency should be removed
from casatestutils import testhelper as th
msmdt_local = msmetadata()
msmdt_local2 = msmetadata()
mst_local = ms()
aft_local = agentflagger()
tbt_local = table()
datapath = ctsys.resolve('unittest/partition/')
''' Unit Tests for task partition'''
# jagonzal (CAS-4287): Add a cluster-less mode to by-pass parallel processing for MMSs as requested
if 'BYPASS_PARALLEL_PROCESSING' in os.environ:
ParallelTaskHelper.bypassParallelProcessing(1)
class test_base(unittest.TestCase):
def setUp_ngc4826(self):
# Input MS contain 4 obsID, 11 scans and 4 spws
self.prefix = 'ngc4826'
self.msfile = self.prefix + '.ms'
# Output files
self.mmsfile = self.prefix + '.mms'
fpath = os.path.join(datapath,self.msfile)
# if os.path.lexists(fpath):
# shutil.copytree(fpath, self.msfile, symlinks=True)
# else:
# self.fail('Data does not exist -> '+fpath)
if not os.path.exists(self.msfile):
shutil.copytree(fpath, self.msfile, symlinks=True)
else: