00001
00002
00003
00004
00005
00006
00007
00008
00009 from sys import version_info
00010 if version_info >= (2,6,0):
00011 def swig_import_helper():
00012 from os.path import dirname
00013 import imp
00014 fp = None
00015 try:
00016 fp, pathname, description = imp.find_module('_flagger', [dirname(__file__)])
00017 except ImportError:
00018 import _flagger
00019 return _flagger
00020 if fp is not None:
00021 try:
00022 _mod = imp.load_module('_flagger', fp, pathname, description)
00023 finally:
00024 fp.close()
00025 return _mod
00026 _flagger = swig_import_helper()
00027 del swig_import_helper
00028 else:
00029 import _flagger
00030 del version_info
00031 try:
00032 _swig_property = property
00033 except NameError:
00034 pass
00035 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
00036 if (name == "thisown"): return self.this.own(value)
00037 if (name == "this"):
00038 if type(value).__name__ == 'SwigPyObject':
00039 self.__dict__[name] = value
00040 return
00041 method = class_type.__swig_setmethods__.get(name,None)
00042 if method: return method(self,value)
00043 if (not static):
00044 self.__dict__[name] = value
00045 else:
00046 raise AttributeError("You cannot add attributes to %s" % self)
00047
00048 def _swig_setattr(self,class_type,name,value):
00049 return _swig_setattr_nondynamic(self,class_type,name,value,0)
00050
00051 def _swig_getattr(self,class_type,name):
00052 if (name == "thisown"): return self.this.own()
00053 method = class_type.__swig_getmethods__.get(name,None)
00054 if method: return method(self)
00055 raise AttributeError(name)
00056
00057 def _swig_repr(self):
00058 try: strthis = "proxy of " + self.this.__repr__()
00059 except: strthis = ""
00060 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
00061
00062 try:
00063 _object = object
00064 _newclass = 1
00065 except AttributeError:
00066 class _object : pass
00067 _newclass = 0
00068
00069
00070 class flagger(_object):
00071 """Proxy of C++ casac::flagger class"""
00072 __swig_setmethods__ = {}
00073 __setattr__ = lambda self, name, value: _swig_setattr(self, flagger, name, value)
00074 __swig_getmethods__ = {}
00075 __getattr__ = lambda self, name: _swig_getattr(self, flagger, name)
00076 __repr__ = _swig_repr
00077 def __init__(self):
00078 """__init__(self) -> flagger"""
00079 this = _flagger.new_flagger()
00080 try: self.this.append(this)
00081 except: self.this = this
00082 __swig_destroy__ = _flagger.delete_flagger
00083 __del__ = lambda self : None;
00084 def open(self, *args, **kwargs):
00085 """
00086 open(self, msname=string("")) -> bool
00087
00088 Summary
00089 Attaches tool to a measurement set.
00090
00091 Input Parameters:
00092 msname Measurement set to be processed
00093
00094 --------------------------------------------------------------------------------
00095
00096 """
00097 return _flagger.flagger_open(self, *args, **kwargs)
00098
00099 def setdata(self, *args, **kwargs):
00100 """
00101 setdata(self, field=string(""), spw=string(""), array=string(""), feed=string(""), scan=string(""),
00102 baseline=string(""), uvrange=string(""), time=string(""), correlation=string(""),
00103 intent=string(""), observation=string("")) -> bool
00104
00105 Summary
00106 Set the data selection parameters to define a
00107 subset of the data on which to perform any further selections/operations.
00108 For unspecified parameters, the full data range is assumed.
00109 All data selection parameters follow the ms-selection syntax.
00110
00111
00112 Input Parameters:
00113 field Field indices or source names : example : '2,3C48'
00114 spw Spectral Window Indices or names : example : '1,2'
00115 array Array Indices or names : example : 'VLAA'
00116 feed Feed index or name : example : '1,2'
00117 scan Scan number : example : '1,2,3'
00118 baseline Baseline number : example : '2-3,4-5,132 ????'
00119 uvrange UV-distance range, with a unit : example : '2.0-3000.0 m'
00120 time Time range, as MJDs or date strings : example : 'xx.x.x.x.x~yy.y.y.y.y'
00121 correlation Correlations/polarizations : example : 'RR,LL,RL,LR,XX,YY,XY,YX'
00122 intent Observing intent : example : '*CAL*, *BAND*'
00123 observation Observation Id : example : '2~4'
00124
00125 --------------------------------------------------------------------------------
00126
00127 """
00128 return _flagger.flagger_setdata(self, *args, **kwargs)
00129
00130 def setmanualflags(self, *args, **kwargs):
00131 """
00132 setmanualflags(self, field=string(""), spw=string(""), array=string(""), feed=string(""), scan=string(""),
00133 baseline=string(""), uvrange=string(""), time=string(""), correlation=string(""),
00134 intent=string(""), observation=string(""), autocorrelation=False,
00135 unflag=False, clipexpr=string(""), cliprange=initialize_vector(2,(double)0, (double)0),
00136 clipcolumn=string("DATA"), outside=True, channelavg=False,
00137 quackinterval=0.0, quackmode=string("beg"), quackincrement=False) -> bool
00138
00139 Summary
00140 This function will select specific data, for manual flagging.
00141
00142
00143 Input Parameters:
00144 field Field indices or source names : example : '2,3C48'
00145 spw Spectral Window Indices or names : example : '1,2'
00146 array Array Indices or names : example : 'VLAA'
00147 feed Feed index or name : example : '1,2'
00148 scan Scan number : example : '1,2,3'
00149 baseline Baseline number : example : '2-3,4-5,132 ????'
00150 uvrange UV-distance range, with a unit : example : '2.0-3000.0 m'
00151 time Time range, as MJDs or date strings : example : 'xx.x.x.x.x~yy.y.y.y.y'
00152 correlation Correlations/polarizations : example : 'RR,LL,RL,LR,XX,YY,XY,YX'
00153 intent Observing intent : example : '*CAL*, *BAND*'
00154 observation Observation Id : example : '2~4'
00155 autocorrelation Flag autocorrelations too ? [ True / False ] false
00156 unflag Unflag the specified data ? [ True / False ] false
00157 clipexpr Data expression for value to clip on : example : 'abs I'
00158 cliprange Clip Range of the value defined by clipExpr [min,max] : example : [100.0,200.0] 0 0
00159 clipcolumn Data column to use for clipping : example : 'DATA' DATA
00160 outside Clip points outside this range ? [ True / False ] true
00161 channelavg Average data over channels before clipping ? [ True / False ] false
00162 quackinterval Quack Length in seconds : example : 30.0 0.0
00163 quackmode Quack mode beg
00164 quackincrement Quack incrementally? false
00165
00166 --------------------------------------------------------------------------------
00167
00168 """
00169 return _flagger.flagger_setmanualflags(self, *args, **kwargs)
00170
00171 def printflagselection(self):
00172 """
00173 printflagselection(self) -> bool
00174
00175 Summary
00176 Print out a list of current manual and auto flag selections.
00177
00178 --------------------------------------------------------------------------------
00179
00180 """
00181 return _flagger.flagger_printflagselection(self)
00182
00183 def clearflagselection(self, index=0):
00184 """
00185 clearflagselection(self, index=0) -> bool
00186
00187 Summary
00188 Clear current manual and auto flag selections.
00189
00190
00191 Input Parameters:
00192 index Flag selection index to clear. Set index to -1 in order to clear all selections. 0
00193
00194 --------------------------------------------------------------------------------
00195
00196 """
00197 return _flagger.flagger_clearflagselection(self, index)
00198
00199 def getautoflagparams(self, *args, **kwargs):
00200 """
00201 getautoflagparams(self, algorithm=string("none")) -> record *
00202
00203 Summary
00204 Retrieve the current set of input parameters for a specified algorithm.
00205 n This returns a python dictionary of parameters and their values.
00206
00207
00208 Input Parameters:
00209 algorithm Autoflag Algorithm name timemed freqmed none
00210
00211 --------------------------------------------------------------------------------
00212
00213 """
00214 return _flagger.flagger_getautoflagparams(self, *args, **kwargs)
00215
00216 def setautoflag(self, *args, **kwargs):
00217 """
00218 setautoflag(self, algorithm=string("none"), parameters=initialize_record("")) -> bool
00219
00220 Summary
00221 Setup an autoflag algorithm.
00222
00223
00224 Input Parameters:
00225 algorithm Autoflag Algorithm name timemedian freqmedian spectralreject uvbin none
00226 parameters Parameters for each autoflag algorithm.
00227 The following is a description of currently supported autoflag algorithms.
00228 (1) Time median filtering
00229 (2) Frequency median filtering
00230 (3) Spectral rejection
00231 (4) Uv-binning
00232
00233 --------------------------------------------------------------------------------
00234
00235 """
00236 return _flagger.flagger_setautoflag(self, *args, **kwargs)
00237
00238 def setshadowflags(self, *args, **kwargs):
00239 """
00240 setshadowflags(self, field=string(""), spw=string(""), array=string(""), feed=string(""), scan=string(""),
00241 baseline=string(""), uvrange=string(""), time=string(""), correlation=string(""),
00242 intent=string(""), observation=string(""), diameter=-1.0) -> bool
00243
00244 Summary
00245 Setup data selection parameters for flagging of
00246 shadowed antennas
00247
00248
00249 Input Parameters:
00250 field Field indices or source names : example : '2,3C48'
00251 spw Spectral Window Indices or names : example : '1,2'
00252 array Array Indices or names : example : 'VLAA'
00253 feed Feed index or name : example : '1,2'
00254 scan Scan number : example : '1,2,3'
00255 baseline Baseline number : example : '2-3,4-5,132 ????'
00256 uvrange UV-distance range, with a unit : example : '2.0-3000.0 m'
00257 time Time range, as MJDs or date strings : example : 'xx.x.x.x.x~yy.y.y.y.y'
00258 correlation Correlations/polarizations : example : 'RR,LL,RL,LR,XX,YY,XY,YX'
00259 intent Observing intent : example : '*CAL*, *BAND*'
00260 observation Observation Id : example : '2~4'
00261 diameter Antenna diameter to use. If negative, the default dish sizes stored in the MS are used : example : diameter = '30' -1.0
00262
00263 --------------------------------------------------------------------------------
00264
00265 """
00266 return _flagger.flagger_setshadowflags(self, *args, **kwargs)
00267
00268 def setelevationflags(self, *args, **kwargs):
00269 """
00270 setelevationflags(self, field=string(""), spw=string(""), array=string(""), feed=string(""), scan=string(""),
00271 baseline=string(""), uvrange=string(""), time=string(""), correlation=string(""),
00272 intent=string(""), observation=string(""), lowerlimit=0.0, upperlimit=90.0) -> bool
00273
00274 Summary
00275 Setup data selection parameters for flagging of
00276 antennas pointing at a low elevation
00277
00278
00279 Input Parameters:
00280 field Field indices or source names : example : '2,3C48'
00281 spw Spectral Window Indices or names : example : '1,2'
00282 array Array Indices or names : example : 'VLAA'
00283 feed Feed index or name : example : '1,2'
00284 scan Scan number : example : '1,2,3'
00285 baseline Baseline number : example : '2-3,4-5,132 ????'
00286 uvrange UV-distance range, with a unit : example : '2.0-3000.0 m'
00287 time Time range, as MJDs or date strings : example : 'xx.x.x.x.x~yy.y.y.y.y'
00288 correlation Correlations/polarizations : example : 'RR,LL,RL,LR,XX,YY,XY,YX'
00289 intent Observing intent : example : '*CAL*, *BAND*'
00290 observation Observation Id : example : '2~4'
00291 lowerlimit The limiting elevation in degrees. Data obtained at lower antenna elevations will get flagged. : example : limit = '15' 0.0
00292 upperlimit The limiting elevation in degrees. Data obtained at higher antenna elevations will get flagged. : example : limit = '85' 90.0
00293
00294 --------------------------------------------------------------------------------
00295
00296 """
00297 return _flagger.flagger_setelevationflags(self, *args, **kwargs)
00298
00299 def setflagsummary(self, *args, **kwargs):
00300 """
00301 setflagsummary(self, field=string(""), spw=string(""), array=string(""), feed=string(""), scan=string(""),
00302 baseline=string(""), uvrange=string(""), time=string(""), correlation=string(""),
00303 intent=string(""), observation=string("")) -> bool
00304
00305 Summary
00306 This function produces a summary of the flags. Statistics include
00307 percentage of flagged data.
00308
00309
00310 Input Parameters:
00311 field Field indices or source names : example : '2,3C48'
00312 spw Spectral Window Indices or names : example : '1,2'
00313 array Array Indices or names : example : 'VLAA'
00314 feed Feed index or name : example : '1,2'
00315 scan Scan number : example : '1,2,3'
00316 baseline Baseline number : example : '2-3,4-5,132 ????'
00317 uvrange UV-distance range, with a unit : example : '2.0-3000.0 m'
00318 time Time range, as MJDs or date strings : example : 'xx.x.x.x.x~yy.y.y.y.y'
00319 correlation Correlations/polarizations : example : 'RR,LL,RL,LR,XX,YY,XY,YX'
00320 intent Observing intent : example : '*CAL*, *BAND*'
00321 observation Observation Id : example : '2~4'
00322
00323 --------------------------------------------------------------------------------
00324
00325 """
00326 return _flagger.flagger_setflagsummary(self, *args, **kwargs)
00327
00328 def setqueryflag(self, *args, **kwargs):
00329 """
00330 setqueryflag(self, field=string(""), spw=string(""), array=string(""), feed=string(""), scan=string(""),
00331 baseline=string(""), uvrange=string(""), time=string(""), correlation=string(""),
00332 intent=string(""), observation=string(""), what=string("fieldid"),
00333 fractionthreshold=0.0, nflagsthreshold=0, morethan=True) -> bool
00334
00335 Summary
00336
00337 List out a data description corresponding to the result of a flag query.
00338 For example, to print out the list of channels with more than 70% of its data flagged.
00339
00340
00341 Input Parameters:
00342 field Field indices or source names : example : '2,3C48'
00343 spw Spectral Window Indices or names : example : '1,2'
00344 array Array Indices or names : example : 'VLAA'
00345 feed Feed index or name : example : '1,2'
00346 scan Scan number : example : '1,2,3'
00347 baseline Baseline number : example : '2-3,4-5,132 ????'
00348 uvrange UV-distance range, with a unit : example : '2.0-3000.0 m'
00349 time Time range, as MJDs or date strings : example : 'xx.x.x.x.x~yy.y.y.y.y'
00350 correlation Correlations/polarizations : example : 'RR,LL,RL,LR,XX,YY,XY,YX'
00351 intent Observing intent : example : '*CAL*, *BAND*'
00352 observation Observation Id : example : '2~4'
00353 what Summary type, corresponding to a data axis.
00354 what = 'antenna' will list the percentage of flagged data per antenna antenna channel spwid baseline correlation fieldid
00355 fractionthreshold Threshold on the fraction of flagged data. [0-1]
00356 example : what='antenna', fractionthreshold=0.7 0.0
00357 nflagsthreshold Threshold on the absolute number of flagged points.
00358 example : what='antenna', nflagsthreshold=1500 0
00359 morethan List values corresponding to more-than or less-than the specified threshold fraction. true
00360
00361 --------------------------------------------------------------------------------
00362
00363 """
00364 return _flagger.flagger_setqueryflag(self, *args, **kwargs)
00365
00366 def setextendflag(self, *args, **kwargs):
00367 """
00368 setextendflag(self, field=string(""), spw=string(""), array=string(""), feed=string(""), scan=string(""),
00369 baseline=string(""), uvrange=string(""), time=string(""), correlation=string(""),
00370 intent=string(""), observation=string(""), along=string("allbaselines"),
00371 width=0) -> bool
00372
00373 Summary
00374
00375 Extend existing flags along a specific direction.
00376
00377
00378 Input Parameters:
00379 field Field indices or source names : example : '2,3C48'
00380 spw Spectral Window Indices or names : example : '1,2'
00381 array Array Indices or names : example : 'VLAA'
00382 feed Feed index or name : example : '1,2'
00383 scan Scan number : example : '1,2,3'
00384 baseline Baseline number : example : '2-3,4-5,132 ????'
00385 uvrange UV-distance range, with a unit : example : '2.0-3000.0 m'
00386 time Time range, as MJDs or date strings : example : 'xx.x.x.x.x~yy.y.y.y.y'
00387 correlation Correlations/polarizations : example : 'RR,LL,RL,LR,XX,YY,XY,YX'
00388 intent Observing intent : example : '*CAL*, *BAND*'
00389 observation Observation Id : example : '2~4'
00390 along Extend flags along this axis.
00391 along='channel' : extends flags across channels, if any channel has a flag. (need 'width')
00392 along='correlation' : extends flags across polarizations. (need some way to specify which pol)
00393 along='time' : extend flags across timestamps. (need 'width'). Similarly for hourangle.
00394 along='antenna1' : For one timestamp, flag all baselines with the same antenna1.
00395 along='antenna2' : For one timestamp, flag all baselines with the same antenna2.
00396 along='bothantennas' : For one timestamp, flag all baselines with either antenna1 or antenna2.
00397 along='allbaselines' : For one timestamp, extend to all baselines. (Note that this is different from using rowflags. channel correlation time (hourangle) antenna1 antenna2 bothantennas allbaselines
00398 width The limit to which flags should be extended on either side.
00399 width=4 : Extend flags to 4 data points on either side.
00400 width=0 : Extend to all values along the specified axis. 0
00401
00402 --------------------------------------------------------------------------------
00403
00404 """
00405 return _flagger.flagger_setextendflag(self, *args, **kwargs)
00406
00407 def run(self, trial=False, reset=False):
00408 """
00409 run(self, trial=False, reset=False) -> record *
00410
00411 Summary
00412 Executes a flagging run
00413
00414 Input Parameters:
00415 trial Do a trial run only false
00416 reset Reset Flags before flagging false
00417
00418 --------------------------------------------------------------------------------
00419
00420 """
00421 return _flagger.flagger_run(self, trial, reset)
00422
00423 def writeflagstodisk(self):
00424 """
00425 writeflagstodisk(self) -> bool
00426
00427 Summary
00428 Applies flags from trial autoflag runs, to the data.
00429 --------------------------------------------------------------------------------
00430
00431 """
00432 return _flagger.flagger_writeflagstodisk(self)
00433
00434 def help(self, *args, **kwargs):
00435 """
00436 help(self, names=string("")) -> bool
00437
00438 Summary
00439 Prints help on available flagging methods
00440
00441 Input Parameters:
00442 names Names of methods (all methods, if omitted)
00443
00444 --------------------------------------------------------------------------------
00445
00446 """
00447 return _flagger.flagger_help(self, *args, **kwargs)
00448
00449 def done(self):
00450 """
00451 done(self) -> bool
00452
00453 Summary
00454 Destroys the flag tool
00455 --------------------------------------------------------------------------------
00456
00457 """
00458 return _flagger.flagger_done(self)
00459
00460 def saveflagversion(self, *args, **kwargs):
00461 """
00462 saveflagversion(self, versionname=string(""), comment=string(""), merge=string("")) -> bool
00463
00464 Summary
00465 *** n Save current flags with a version name.***
00466
00467
00468 Input Parameters:
00469 versionname Version name
00470 comment Comment for this flag table
00471 merge merge type
00472
00473 --------------------------------------------------------------------------------
00474
00475 """
00476 return _flagger.flagger_saveflagversion(self, *args, **kwargs)
00477
00478 def restoreflagversion(self, *args, **kwargs):
00479 """
00480 restoreflagversion(self, versionname=std::vector< string >(1, ""), merge=string("")) -> bool
00481
00482 Summary
00483 *** n Restore flags from a saved flag_version.
00484 n versionname : name of flag version to restore to main table
00485 n merge : Type of operation to perform during restoration.
00486 n merge = replace : replaces the main table flags.
00487 n merge = and : logical AND with main table flags
00488 n merge = or : logical OR with main table flags
00489 n Default : replace.
00490 n ***
00491
00492 Input Parameters:
00493 versionname Version name
00494 merge merge type
00495
00496 --------------------------------------------------------------------------------
00497
00498 """
00499 return _flagger.flagger_restoreflagversion(self, *args, **kwargs)
00500
00501 def deleteflagversion(self, *args, **kwargs):
00502 """
00503 deleteflagversion(self, versionname=std::vector< string >(1, "")) -> bool
00504
00505 Summary
00506 *** n Delete a saved flag_version.
00507 ***
00508
00509 Input Parameters:
00510 versionname Version name
00511
00512 --------------------------------------------------------------------------------
00513
00514 """
00515 return _flagger.flagger_deleteflagversion(self, *args, **kwargs)
00516
00517 def getflagversionlist(self, printflags=True):
00518 """
00519 getflagversionlist(self, printflags=True) -> std::vector< std::string >
00520
00521 Summary
00522 *** n Print out a list of saved flag_versions.
00523 ***
00524
00525 Input Parameters:
00526 printflags Print flagversions in logger? true
00527
00528 --------------------------------------------------------------------------------
00529
00530 """
00531 return _flagger.flagger_getflagversionlist(self, printflags)
00532
00533 flagger_swigregister = _flagger.flagger_swigregister
00534 flagger_swigregister(flagger)
00535
00536
00537
00538