예제 #1
0
fntool = casac.functional
imdtool = casac.imagemetadata

utilstool = casac.utils
cu = casac.cu = utilstool()
vftask = casac.vlafillertask()
vlafiller = vftask.fill
at = casac.atmosphere()
ca = casac.calanalysis()
mttool = casac.mstransformer
mt = mttool()
sdmstool = casac.singledishms
sdms = sdmstool()

from simple_cluster import simple_cluster
clustermanager = simple_cluster()

# Log initialization ###################################################################################################

# IMPORTANT: The following steps must be follow the described order,
#            otherwise a seg fault occurs when setting the log file.
# 1st Create casalog object, it will be used by tasks when importing taskinit
casalog = casac.logsink()
# 2nd Set log file accessing CASA dictionary of calling context via stack inspection
__taskinit_setlogfile(casalog)
# 3rd Set logger as global
casalog.setglobal(True)

# Set processor origin (normally "casa" but in the MPI case we use the hostname and rank involved)
from mpi4casa.MPIEnvironment import MPIEnvironment
processor_origin = MPIEnvironment.processor_origin
예제 #2
0
파일: taskinit.py 프로젝트: schiebel/casa
fntool = casac.functional
imdtool = casac.imagemetadata

utilstool = casac.utils
cu = casac.cu = utilstool()
vftask = casac.vlafillertask()
vlafiller=vftask.fill
at = casac.atmosphere()
ca = casac.calanalysis()
mttool = casac.mstransformer
mt = mttool()
sdmstool = casac.singledishms
sdms = sdmstool()

from simple_cluster import simple_cluster
clustermanager = simple_cluster()

# Log initialization ###################################################################################################

# IMPORTANT: The following steps must be follow the described order, 
#            otherwise a seg fault occurs when setting the log file.
# 1st Create casalog object, it will be used by tasks when importing taskinit
casalog = casac.logsink()
# 2nd Set log file accessing CASA dictionary of calling context via stack inspection
__taskinit_setlogfile(casalog)
# 3rd Set logger as global
casalog.setglobal(True)

# Set processor origin (normally "casa" but in the MPI case we use the hostname and rank involved)
from mpi4casa.MPIEnvironment import MPIEnvironment
processor_origin = MPIEnvironment.processor_origin
예제 #3
0
            if(fieldoo==''):
                fieldoo='0'
            phasecenter=int(ms.msseltoindex(vis,field=fieldoo)['field'][0])
        else:
            tmppc=phasecenter
            try:
                if(len(ms.msseltoindex(vis, field=phasecenter)['field']) > 0):
                    tmppc = int(ms.msseltoindex(vis,
                                                field=phasecenter)['field'][0])
                    ##succesful must be string like '0' or 'NGC*'
            except Exception, instance:
                    ##failed must be a string 'J2000 18h00m00 10d00m00'
                tmppc = phasecenter
            phasecenter = tmppc           
    if((clusterdef != '') and os.path.exists(clusterdef)):
        cl=simpl.simple_cluster()
        if(cl.get_status()==None):
            cl.init_cluster(clusterdef)
####checking done
    #I'll assume this machine is representative in memory
    arch=os.uname()[0].lower()
    totmem=8.0e9
    if(arch=='linux'):
        totmem=string.atof(commands.getoutput('cat /proc/meminfo | grep -i memtotal').split()[1])*1024.0
    elif(arch=='darwin'):
        totmem=string.atof(commands.getoutput('sysctl hw.memsize').split()[1])

    sc=simpl.simple_cluster.getCluster()
    ###################
    #sc.stop_cluster()
    #sc.start_cluster()
예제 #4
0
            if (fieldoo == ''):
                fieldoo = '0'
            phasecenter = int(ms.msseltoindex(vis, field=fieldoo)['field'][0])
        else:
            tmppc = phasecenter
            try:
                if (len(ms.msseltoindex(vis, field=phasecenter)['field']) > 0):
                    tmppc = int(
                        ms.msseltoindex(vis, field=phasecenter)['field'][0])
                    ##succesful must be string like '0' or 'NGC*'
            except Exception, instance:
                ##failed must be a string 'J2000 18h00m00 10d00m00'
                tmppc = phasecenter
            phasecenter = tmppc
    if ((clusterdef != '') and os.path.exists(clusterdef)):
        cl = simpl.simple_cluster()
        if (cl.get_status() == None):
            cl.init_cluster(clusterdef)
####checking done
#I'll assume this machine is representative in memory
    arch = os.uname()[0].lower()
    totmem = 8.0e9
    if (arch == 'linux'):
        totmem = string.atof(
            commands.getoutput('cat /proc/meminfo | grep -i memtotal').split()
            [1]) * 1024.0
    elif (arch == 'darwin'):
        totmem = string.atof(
            commands.getoutput('sysctl hw.memsize').split()[1])

    sc = simpl.simple_cluster.getCluster()