# Path: killMS/Other/ModColor.py
# HEADER = '\033[95m'
# OKBLUE = '\033[94m'
# OKGREEN = '\033[92m'
# WARNING = '\033[93m'
# FAIL = '\033[91m'
# ENDC = '\033[0m'
#     HEADER = ''
#     OKBLUE = ''
#     OKGREEN = ''
#     WARNING = ''
#     FAIL = ''
#     ENDC = ''
# def Str(strin0,col="red",Bold=True):
# def Sep(strin=None,D=1):
# def Title(strin,Big=False):
# def disable():
# 
# Path: killMS/Other/reformat.py
# def reformat(ssin,slash=True,LastSlash=True):
#     ss=ssin.split("/")
#     ss=filter (lambda a: a != "", ss)
#     ss="/".join(ss)+"/"
#     if ssin[0]=="/": ss="/"+ss
#     if not(slash):
#         ss=ss[1:-1]
#     if not(LastSlash):
#         if ss[-1]=="/": ss=ss[0:-1]
#     return ss


import numpy as np
import os
from DDFacet.Other import logger
from killMS.Other import ModColor
from killMS.Other import reformat
SKA South Africa, Rhodes University

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
log=logger.getLogger("ClassReCluster")

class ClassReCluster():
    def __init__(self,GD):
        self.GD=GD

    def ReClusterSkyModel(self,SM,MSName):
        SolRefFile=self.GD["PreApply"]["PreApplySols"][0]

        if (SolRefFile!="")&(not(".npz" in SolRefFile)):
            Method=SolRefFile

# Path: killMS/Other/ModColor.py
# HEADER = '\033[95m'
# OKBLUE = '\033[94m'
# OKGREEN = '\033[92m'
# WARNING = '\033[93m'
# FAIL = '\033[91m'
# ENDC = '\033[0m'
#     HEADER = ''
#     OKBLUE = ''
#     OKGREEN = ''
#     WARNING = ''
#     FAIL = ''
#     ENDC = ''
# def Str(strin0,col="red",Bold=True):
# def Sep(strin=None,D=1):
# def Title(strin,Big=False):
# def disable():
# 
# Path: killMS/Other/reformat.py
# def reformat(ssin,slash=True,LastSlash=True):
#     ss=ssin.split("/")
#     ss=filter (lambda a: a != "", ss)
#     ss="/".join(ss)+"/"
#     if ssin[0]=="/": ss="/"+ss
#     if not(slash):
#         ss=ss[1:-1]
#     if not(LastSlash):
#         if ss[-1]=="/": ss=ss[0:-1]
#     return ss


# Path: killMS/Data/ClassReCluster.py
import numpy as np
import os
from DDFacet.Other import logger
from killMS.Other import ModColor
from killMS.Other import reformat

SKA South Africa, Rhodes University

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
log=logger.getLogger("ClassReCluster")

class ClassReCluster():
    def __init__(self,GD):
        self.GD=GD

    def ReClusterSkyModel(self,SM,MSName):
        SolRefFile=self.GD["PreApply"]["PreApplySols"][0]

        if (SolRefFile!="")&(not(".npz" in SolRefFile)):
            Method=SolRefFile

            ThisMSName=reformat.reformat(os.path.abspath(MSName),LastSlash=False)