Source
import casatools
from casatasks.private.imagerhelpers.input_parameters import saveparams2last
from casatasks.private.imagerhelpers.msuvbinflag_algorithms import UVGridFlag
import time
multibackup=True) (
def msuvbinflag(
######## binned ms
binnedvis, #= 'thegridded_from_msuvbin.ms',
######## flagging algorithm option
method, #= 'radial','RegionalMean','Gradient'
sigma, #=5
sizeRegion, #=20
radius, #=1.0
doplot=False
) -> None:
flagger=UVGridFlag(binnedvis, doplot)
if method == 'radial_mean_annular':
tic = time.time()
flagger.flagViaBin_radial(sigma=sigma)
toc = time.time()
print("MSuvbinflag radial method Running time :", toc - tic)
elif method == 'radial_per_plane':
tic = time.time()
flagger.flag_radial_per_plane(sigma=sigma)
toc = time.time()
print("MSuvbinflag radial method Running time :", toc - tic)
elif method == 'regionalMean':
print("No bueno")
#tic = time.time()
#flagViaBin_regionalMean(binnedvis=binnedvis, sizeRegion=20, sigma=5,ignorPoint=True)
#toc = time.time()
#print("MSuvbinflag other method Running time:", toc - tic)
elif method == 'gradient':
print("No bueno")
#tic = time.time()
#flagViaBin_gradient(binnedvis=binnedvis, radius=1, sigma=0.3)
#toc = time.time()
#print("MSuvbinflag pead method Running time:", toc - tic)
elif method == 'median':
print("No bueno")
#tic = time.time()
#flagViaBin_median(binnedvis=binnedvis, sigma=5)
#toc = time.time()
#print("MSuvbinflag median method Running time:", toc - tic)
else:
print("No bueno")
return