Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.mrao.cam.ac.uk/~bn204/alma/casata/first-try-scripts.html
Дата изменения: Mon Apr 4 13:47:51 2016
Дата индексирования: Sun Apr 10 10:13:45 2016
Кодировка: ISO8859-5

Поисковые слова: п п р п р п р п р п р п р п р п р п
Some first attempts at casata scripts — Bojan Nikolic web pages (r. 329)

Some first attempts at casata scriptsТЖ

Translation of M. Zwaan’s script to image NGC3256 Band 6 test observationТЖ

# Bojan Nikolic <b.nikolic@mrao.cam.ac.uk>
#
# This script is a translation of M. Zwaan's script at
# http://wikis.alma.cl/twiki/pub/AIV/MakeMapsWithCasa/mapN3256B6new.py.txt
#
# Still a long way to go to tidying up everything, but a quick
# illustration of where casata should be heading in.

import sys, shutil

sys.path.append("/home/bnikolic/n/casata/main/")

import casata
from casata.tools import vtasks, calibration, files, imaging

def copySB():
    """
    This is just a fail-safe copying of the measurement set so any
    problems do not corrupt the original data!
    """
    shutil.copytree("/home/bnikolic/data/almagen/SBs/uid___X02_X56142_X1.ms",
                    "/home/bnikolic/data/almagen/SBs/test.ms") 
    shutil.copytree("/home/bnikolic/data/almagen/SBs/uid___X02_X563fc_X1.ms",
                    "/home/bnikolic/data/almagen/SBs/test2.ms") 

def calibrate(ms,
              delayl,
              calfield):
    """
    Simple calibration routine
    
    :param delayl: List of delays to apply to antenna 0 in form
    (spwid, delay in nanoseconds)

    :param calfield: Name of the phase calibration field 
    """
    vtasks.clearcal(ms)
    callist=[calibration.mkDelaySpW(ms, 
                                    delayl,
                                    0)]
    for spw in [0,1]:
        calspw=list(callist)
        calspw.append(calibration.mkBandpassChn(ms,
                                                calfield,
                                                spw,
                                                callist))
        calspw.append(calibration.mkGainT(ms, 
                                          calfield, 
                                          spw, 
                                          precal=calspw))
        vtasks.applycal(ms, 
                        gaintable=calspw, 
                        spw=str(spw))


def analyse():
    """
    Analyse the NGC3256 Band 6 test observations.
    """
    m1="/home/bnikolic/data/almagen/SBs/test.ms"
    m2="/home/bnikolic/data/almagen/SBs/test2.ms"
    for m in [m1, m2]:
        calibrate(m,
                  delayl=( (0, 0.0),
                           (1,-8.0)),
                  calfield="J1037-295")

    mcomb="/home/bnikolic/data/almagen/SBs/cc.ms"
    files.assembleSPWs([m1,
                        m2],
                       ["0,1",
                        "0,1"],
                       mcomb)

    # Make an image of the calibrator
    imaging.simpleClean(mcomb,
                        "J1037-295",
                        spw="0:10~110,1:10~110", 
                        psfmode="hogbom",
                        niter=1000,  
                        gain=0.15,
                        threshold="0.0mJy",
                        nchan=-1, 
                        start=0, 
                        width=1, 
                        imsize=[600, 600], 
                        cell=['0.2arcsec','0.2arcsec'],  
                        mask=[298,298,302,302],)
    

#imstat(imagename="ccJ1037-295.image")["max"][0]/imstat(imagename="ccJ1037-295.image",region="",box="100,100,240,500")["rms"][0]

Table Of Contents

Previous topic

Contributing to casata

Next topic

Accessing measurement set data