Source
from __future__ import absolute_import
from __future__ import print_function
import os
import numpy as np
from casatasks.private.casa_transition import *
if is_CASA6:
from casatasks import casalog
from .imagerhelpers.imager_base import PySynthesisImager
from .imagerhelpers.input_parameters import ImagerParameters
else:
from taskinit import casalog
from imagerhelpers.imager_base import PySynthesisImager
from imagerhelpers.input_parameters import ImagerParameters
def apparentsens(vis=None,
field=None,spw=None,intent=None,
selectdata=None,timerange=None,uvrange=None,antenna=None,scan=None,
observation=None, # msselect=None,
imsize=None,cell=None,
stokes=None,specmode=None,
weighting=None,
robust=None,npixels=None,uvtaper=None):
#Python script
casalog.origin('apparentsens')
try:
# insist on continuum calculation only (for now)
if specmode!='mfs':
casalog.post( "The apparentsens task only supports specmoe='mfs' at this time", "WARN", "task_apparentsens" )
imname=vis+'.apparentsens'
# remove the image files that imager makes below
os.system('rm -Rf '+imname+'.*')
# fill the relevant parameters
paramList = ImagerParameters(
msname=vis,
field=field,
spw=spw,
timestr=timerange,
uvdist=uvrange,
antenna=antenna,
scan=scan,
obs=observation,
state=intent,
imagename=imname,
imsize=imsize,
cell=cell,
stokes=stokes,
specmode=specmode,
nchan=-1,
weighting=weighting,
robust=robust,
npixels=npixels,
uvtaper=uvtaper
)
imager = PySynthesisImager(params=paramList)