from functools import wraps
__bypass_parallel_processing = 0
logging.debug("Importing CASAtools")
logging.debug("Importing CASAtasks")
from casatasks import casalog
logging.debug("Import casa6 errors. Trying CASA5...")
from __main__ import default
from taskinit import tbtool, mstool, iatool
from casa_stack_manip import stack_find, find_casa
from mpi4casa.MPIEnvironment import MPIEnvironment
if not MPIEnvironment.is_mpi_enabled:
__bypass_parallel_processing = 1
print("MPIEnvironment not Enabled")
if casa.has_key('state') and casa['state'].has_key('init_version') and casa['state']['init_version'] > 0:
casac = stack_find("casac")
casalog = stack_find("casalog")
"agentflagger", "atcafiller", "atmosphere", "calanalysis", "calibrater", "coercetype", "componentlist", "config", "constants", "coordsys", "ctuser", "functional", "image",
"imagemetadata", "imagepol", "imager", "iterbotsink", "logsink", "measures", "miriadfiller", "ms", "msmetadata", "mstransformer", "platform", "quanta", "regionmanager", "sakura",
"sdm", "simulator", "singledishms", "spectralline", "synthesisdeconvolver", "synthesisimager", "synthesisimstore", "synthesisnormalizer", "synthesisutils", "table", "typecheck", "utils",
"vlafiller", "vpmanager"])
"accor", "accum", "applycal", "asdmsummary", "bandpass", "blcal", "calstat", "clearcal", "clearstat", "concat", "conjugatevis", "cvel", "cvel2",
"delmod", "exportasdm", "exportfits", "exportuvfits", "feather", "fixplanets", "fixvis", "flagcmd", "flagdata", "flagmanager", "fluxscale", "ft", "gaincal",
"gencal", "hanningsmooth", "imcollapse", "imcontsub", "imdev", "imfit", "imhead", "imhistory", "immath", "immoments", "impbcor", "importasap", "importasdm",
"importatca", "importfits", "importfitsidi", "importgmrt", "importmiriad", "importnro", "importuvfits", "importvla", "impv", "imrebin", "imreframe",
"imregrid", "imsmooth", "imstat", "imsubimage", "imtrans", "imval", "initweights", "listcal", "listfits", "listhistory", "listobs", "listpartition",
"listsdm", "listvis", "makemask", "mstransform", "partition", "polcal", "predictcomp", "rerefant", "rmfit", "rmtables", "sdbaseline", "sdcal",
"sdfit", "sdfixscan", "sdgaincal", "sdimaging", "sdsmooth", "setjy", "simalma", "simanalyze", "simobserve", "slsearch", "smoothcal", "specfit",
"specflux", "specsmooth", "splattotable", "split", "spxfit", "statwt", "tclean", "uvcontsub", "uvmodelfit", "uvsub", "virtualconcat", "vishead", "visstat", "widebandpbcor"])
miscellaneous_tasks = set(['wvrgcal','plotms'])
logging.basicConfig(level=logging.INFO,format='%(message)s')