casalog.post('The cube for major cycles has '+str(len(freqlist))+' channels. For wideband continuum imaging, it may be possible to reduce the number of channels to (say) one per spectral window to preserve frequency dependent intensity and weight information but also minimize the number of channels in the image cubes. MFS imaging will be performed within each channel. This will reduce the sizes of the image cubes as well as the compute time used for feathering each plane separately. Note that a minimum of nterms=' + str(pars['nterms']) + ' channels is required for an accurate polynomial fit, but where possible at least 5 to 10 channels that span the frequency range are prefered in order to properly encode frequency dependent intensity and weights.', "WARN", "task_sdintimaging")
from __future__ import absolute_import
from scipy import fftpack
from casatasks.private.casa_transition import is_CASA6
from casatools import quanta, table, image, regionmanager, imager
from casatasks import casalog, imsubimage, feather
def getFreqAxisIndex(self):
mysummary = _ia.summary(list=False)
freqaxis_index = list(mysummary['axisnames']).index('Frequency')
casalog.post('The image '+_ia.name()+' has no frequency axis. Try adding one with ia.adddegaxis() .', 'SEVERE')
def getFreqList(self,imname=''):
freqaxis_index = self.getFreqAxisIndex()
if(csys.axiscoordinatetypes()[freqaxis_index] == 'Spectral'):
restfreq = csys.referencevalue()['numeric'][freqaxis_index]
freqincrement = csys.increment()['numeric'][freqaxis_index]
for chan in range(0,shp[freqaxis_index]):
freqlist.append(restfreq + chan * freqincrement);
elif(csys.axiscoordinatetypes()[freqaxis_index] == 'Tabular'):
freqlist = (csys.torecord()['tabular2']['worldvalues'])
casalog.post('Unknown frequency axis. Exiting.','SEVERE');
def copy_restoringbeam(self,fromthis='',tothis=''):
freqlist = self.getFreqList(fromthis)
for i in range(len(freqlist)):
beam = _ia.restoringbeam(channel = i);
_ia.setrestoringbeam(beam = beam, channel = i, polarization = 0);
def feather_int_sd(self, sdcube='', intcube='', jointcube='',sdgain=1.0, dishdia=-1, usedata='sdint', chanwt=''):
Run the feather task to combine the SD and INT Cubes.
There's a bug in feather for cubes. Hence, do each channel separately.
FIX feather and then change this. CAS-5883 is the JIRA ticket that contains a fix for this issue....
TODO : Add the effdishdia usage to get freq-indep feathering.