Source
casalog.post(" %s %s %s %s %s %s" % (str_split(spwIdList[i], '_')[1].ljust(4), str(nChanList[i]).ljust(4), str(refFreqList[i]/1e6).ljust(8), str(np.array(chanWidthList[i])/1e3).ljust(8), str(np.array(chanWidthList[i])*nChanList[i]/1e6).ljust(8), basebandList[i].ljust(8)))
########################################################################
# Task to retrieve observing information from SDM XML files
#
# v1.0: 2010.12.07, M. Krauss
# v1.1: 2011.02.23, M. Krauss: added functionality for ALMA data
#
# Original code based on readscans.py, courtesy S. Meyers
from __future__ import absolute_import
import numpy as np
try:
from xml.dom import minidom
except ImportError as exc:
raise ImportError("task listsdm requires minidom but there was an import error: {}".
format(exc))
from casatasks.private.casa_transition import is_CASA6
if is_CASA6:
from casatools import quanta, measures
from casatasks import casalog
_qa = quanta( )
_me = measures( )
str_split = str.split
else:
from taskinit import *
# not local tools
_qa = qa
_me = me
str_split = string.split
def listsdm(sdm=None):
# read Scan.xml
xmlscans = minidom.parse(sdm+'/Scan.xml')
scandict = {}
startTimeShort = []
endTimeShort = []
rowlist = xmlscans.getElementsByTagName("row")
for rownode in rowlist:
rowfid = rownode.getElementsByTagName("scanNumber")
fid = int(rowfid[0].childNodes[0].nodeValue)
scandict[fid] = {}
# number of subscans
rowsubs = rownode.getElementsByTagName("numSubscan")
if len(rowsubs) == 0:
# EVLA and old ALMA data
rowsubs = rownode.getElementsByTagName("numSubScan")
nsubs = int(rowsubs[0].childNodes[0].nodeValue)
# intents
rownint = rownode.getElementsByTagName("numIntent")
nint = int(rownint[0].childNodes[0].nodeValue)
rowintents = rownode.getElementsByTagName("scanIntent")
sint = str(rowintents[0].childNodes[0].nodeValue)
sints = sint.split()
rint = ''
for r in range(nint):
intent = sints[2+r]
if rint=='':
rint = intent