Open adeleplunkett opened 6 years ago
This should also be the case in L1348, called when using tp2vispl:
# Loop over SPWs
# --------------
for ispw in spwlist:
# SPW info and set constraints to reduce data to load
ms.selectinit(reset=True) # all spws
Check near line L1000 also, when oper == 'beammatch':
# Sumup the weights of INT visibilities [/GHz/pnt/arcmin2]
# --------------------------------------------------------
sumw = 0.0
for ims in msINT:
ms.open(ims,nomodify=True) # open MS
ms.selectinit(reset=True) # all spws
spwinfo = ms.getspectralwindowinfo() # get spw info
spwlist = spwinfo.keys() # list of SPWs
iarray = guessarray(ims) # array name [e.g. ALMA12]
fwhm0 = t2v_arrays[iarray]['fwhm100'] # beam FHWM @100GHz[arcsec]
for ispw in spwlist: # loop over SPWs
ms.selectinit(reset=True) # all spws
spwid = spwinfo[ispw]['SpectralWindowId'] # spw #
In the development version there are numerous examples, they all highly splitting by SPW, partially because that's how we usually get the data. So Im not surprised these issues come up, we simply haven't been using it in this mode.
Do you have a good use case where you need to run it over spw's?
In the datasets I have, then each execution is assigned a different spectral window (and therefore the concat *.ms file has several SPWs). All should have the same frequency. But, the tp2vispl and tp2viswt will not work with more than 1 "SPW" in the .ms file, at least that's my experience. So, the option is either to take only the first SPW, or actually loop over all of them. Right?
In def wtstat, I believe that there needs to be a line ms.selectinit(reset=True) inside the loop over several spectral windows. Otherwise, anytime I have a dataset with several spectral windows, I get an error 2018-09-03 13:04:31 WARN ms::selectinit selectinit failed for datadescid 1