rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
flagdata2(vis=self.vis, selectdata=True, autoflag=True, algorithm='freqmed') auto = flagdata2(vis=self.vis, summary=True) print auto['antenna']["2"] self.assertEqual(auto['antenna']["2"]['flagged'], 1262) flagdata2(vis=self.vis, unflag=True) reset = flagdata2(vis=self.vis, summary=True) for a in ["2", "3", "5", "6"]:... | def test_manual_auto(self): '''Manualflag and autoflag modes''' # It will run flagdata then compare with flagdata2 flagdata(vis=self.vis, scan='3') flagdata(vis=self.vis, scan='3', mode='autoflag', algorithm='timemed', window=3) res1 = flagdata(vis=self.vis, mode='summary') flagdata2(vis=self.vis, unflag=True) flagdat... | |
flagdata2(vis=self.vis, selectdata=True, antenna='1~20', manualflag=True, mf_antenna='3~8') test_eq(flagdata2(vis=self.vis, summary=True, antenna='5'), 196434, 196434) test_eq(flagdata2(vis=self.vis, summary=True, antenna='9'), 196434, 45360) | flagdata2(vis=self.vis, manualflag=True, mf_antenna='3~8') test_eq(flagdata2(vis=self.vis, summary=True, selectdata=True, antenna='5'), 203994, 196434) test_eq(flagdata2(vis=self.vis, summary=True, selectdata=True, antenna='9'), 203994, 45360) | def test_mfantenna(self): flagdata2(vis=self.vis, selectdata=True, antenna='1~20', manualflag=True, mf_antenna='3~8') test_eq(flagdata2(vis=self.vis, summary=True, antenna='5'), 196434, 196434) test_eq(flagdata2(vis=self.vis, summary=True, antenna='9'), 196434, 45360) # compare with original flagdata flagdata2(vis=sel... |
test_eq(flagdata2(vis=self.vis, summary=True, antenna='2'), 196434, 34298) def test_correlation(self): flagdata2(vis=self.vis, selectdata=True, correlation='LL', manualflag=True, mf_correlation='') test_eq(flagdata2(vis=self.vis, summary=True, selectdata=True, antenna='2'), 196434, 98217) flagdata2(vis=self.vis, selec... | test_eq(flagdata2(vis=self.vis, summary=True), 2854278, 271836) | def test_channel(self): # should flag only channels 10~15 flagdata2(vis=self.vis, selectdata=True, spw='0:10~20', manualflag=True, mf_spw='0:5~15') test_eq(flagdata2(vis=self.vis, summary=True, antenna='2'), 196434, 34298) |
flagdata2(vis=self.vis, selectdata=True, uvrange='200~400m', manualflag=True) test_eq(flagdata2(vis=self.vis, summary=True, selectdata=True, antenna='2'), 196434, 55944) | flagdata2(vis=self.vis, selectdata=True, field='0',manualflag=True, mf_uvrange='200~400m') test_eq(flagdata2(vis=self.vis, summary=True, selectdata=True, field='0'), 568134, 156744) res1 = flagdata2(vis=self.vis, summary=True, selectdata=True, field='0') flagdata2(vis='ngc5921.ms', unflag=True) flagdata(vis='ngc5921.... | def test_uvrange(self): flagdata2(vis=self.vis, selectdata=True, uvrange='200~400m', manualflag=True) test_eq(flagdata2(vis=self.vis, summary=True, selectdata=True, antenna='2'), 196434, 55944) |
flagdata2(vis=self.vis, selectdata=True, timerange='09:50:00~10:20:00', manualflag=True, mf_timerange='09:20:00~10:20:00') test_eq(flagdata2(vis=self.vis, summary=True, antenna='2'), 196434, 6552) | flagdata2(vis=self.vis, selectdata=True, timerange='09:50:00~10:23:00', manualflag=True, mf_timerange='09:33:00~10:43:00') test_eq(flagdata2(vis=self.vis, summary=True, selectdata=True, field='2'), 1619352, 0) test_eq(flagdata2(vis=self.vis, summary=True, selectdata=True, field='1'), 666792, 238140) | def test_timerange(self): flagdata2(vis=self.vis, selectdata=True, timerange='09:50:00~10:20:00', manualflag=True, mf_timerange='09:20:00~10:20:00') test_eq(flagdata2(vis=self.vis, summary=True, antenna='2'), 196434, 6552) |
test_eq(flagdata2(vis=self.vis, summary=True, selectdata=True, antenna='2'), 196434, 196434) | test_eq(flagdata2(vis=self.vis, summary=True), 2854278, 2854278) | def test_array(self): flagdata2(vis=self.vis, selectdata=True, array='0', manualflag=True) test_eq(flagdata2(vis=self.vis, summary=True, selectdata=True, antenna='2'), 196434, 196434) |
test_selections, | def suite(): return [ | |
test_vector, test_vector_ngc5921, test_flagmanager, test_rfi, test_shadow, | def suite(): return [ | |
test_autoflag, test_multimodes, test_mfselections, | def suite(): return [ | |
if kfld > nfld: kfld=0 | if kfld > nfld-1: kfld=0 | def simdata2( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refd... |
for i in range(len(self.vis)): if type(field)!=list: field=[field] try: self.im.selectvis(vis=self.vis[i],field=field) | nvis=len(self.vis) for i in range(nvis): try: selparam=self._selectlistinputs(nvis,i,self.paramlist) self.im.selectvis(vis=self.vis[i],field=selparam['field'],spw=selparam['spw']) | def definemultiimages(self, rootname, imsizes, cell, stokes, mode, spw, nchan, start, width, restfreq, field, phasecenters, names=[], facets=1, outframe='', veltype='radio', makepbim=False, checkpsf=False): #pdb.set_trace() #will do loop in reverse assuming first image is main field if not hasattr(imsizes, '__len__'): ... |
given in list param should be string or list of strings. | given in list of strings. | def _selectlistinputs(self,nvis,indx,params): """ A little private function to do selection and checking for a parameter given in list param should be string or list of strings. It checks nelement in each param either match with nvis or nelement=1 (or a string) otherwise exception is thrown. """ outparams={} if type(pa... |
self.assertTrue((got == expected).all()) | maxdiff = numpy.abs(numpy.max(got - expected)) maxdiffrel = numpy.abs(numpy.max(diff/got)) if (maxdiff > 0): print "maxdiff " + str(maxdiff) print "maxdiffrel " + str(maxdiffrel) self.assertTrue((diff == 0).all()) | def _comp(self, imagename, mode, outfile, expected, epsilon, polithresh=''): immath(imagename=imagename, outfile=outfile, mode=mode, polithresh=polithresh) self.assertTrue(os.path.exists(outfile)) ia.open(outfile) got = ia.getchunk() ia.done() diff = expected - got if (epsilon == 0): self.assertTrue((got == expected).a... |
pdb.set_trace() | def pcont(msname=None, imagename=None, imsize=[1000, 1000], pixsize=['1arcsec', '1arcsec'], phasecenter='', field='', spw='*', ftmachine='ft', wprojplanes=128, facets=1, hostnames='', numcpuperhost=1, majorcycles=1, niter=1000, alg='clark', contclean=False, visinmem=False, painc=360., pblimit=0.1, dopbcorr=True, applyo... | |
c.odo('a.cfcache='+'"'+str(cfcachelist[k])+'"',k); | def pcont(msname=None, imagename=None, imsize=[1000, 1000], pixsize=['1arcsec', '1arcsec'], phasecenter='', field='', spw='*', ftmachine='ft', wprojplanes=128, facets=1, hostnames='', numcpuperhost=1, majorcycles=1, niter=1000, alg='clark', contclean=False, visinmem=False, painc=360., pblimit=0.1, dopbcorr=True, applyo... | |
actualchan=actualchan-1 | def findchanselcont(msname='', spwids=[], numpartition=1, beginfreq=0.0, endfreq=1e12): numproc=numpartition spwsel=[] startsel=[] nchansel=[] for k in range(numproc): spwsel.append([]) startsel.append([]) nchansel.append({}) tb.open(msname+"/SPECTRAL_WINDOW") channum=tb.getcol('NUM_CHAN') nspw=tb.nrows() if(len(spwid... | |
if image or analyze: | if (image or analyze) and os.path.exists(project+'.ms'): | def simdata( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refda... |
if telescopename not in knowntelescopes: msg("thermal noise only works properly for ALMA/ACA or EVLA",origin="noise",priority="warn") | def simdata( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refda... | |
eta_p, eta_s, eta_b, eta_t, eta_q, t_rx = util.noisetemp(telescope=telescopename,freq=model_center) eta_a = eta_p * eta_s * eta_b * eta_t if verbose: msg('antenna efficiency = ' + str(eta_a),origin="noise") msg('spillover efficiency = ' + str(eta_s),origin="noise") msg('correlator efficiency = ' + str(eta_q),orig... | noisymsroot = msroot+".noisy" | def simdata( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refda... |
noisymsroot = msroot+".noisy" | def simdata( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refda... | |
datapath = os.environ.get('CASAPATH').split()[0]+'/data/regression/g192redux/reference/' | datapath = os.environ.get('CASAPATH').split()[0]+'/data/regression/imsmooth/' | def setUp(self): if(os.path.exists(targetres_im)): os.system('rm -rf ' +targetres_im) datapath = os.environ.get('CASAPATH').split()[0]+'/data/regression/g192redux/reference/' os.system('cp -r ' +datapath + targetres_im +' ' + targetres_im) |
ra,dec = in_ia.toworld(model_refpix)['numeric'][0:2] ra=qa.quantity(str(ra)+"rad") dec=qa.quantity(str(dec)+"rad") | ra = in_ia.toworld(model_refpix,'q')['quantity']['*'+str(axmap[0]+1)] dec = in_ia.toworld(model_refpix,'q')['quantity']['*'+str(axmap[1]+1)] | def modifymodel(self, inimage, outimage, modifymodel,inbright, direction,incell,incenter,inwidth,innchan, flatimage=False): # if nonzero, create mom -1 image |
if predict_uv and kfld==nfld: | if predict_uv and docalibrator and kfld==nfld: | def simdata2( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refd... |
expected_new_estimates | expected_new_estimates, stokes_image | def data(): # The data is in <casa data regression dir>/ngc5921redux/reference/ngc5921_regresion #src_file='/export/chipmunk1/CASA_TEST/TESTDATA/images/ALPHA/ngc5921.im' return [ noisy_image, expected_model, expected_residual, convolved_model, estimates_convolved, two_gaussians_image, two_gaussians_estimates, expected... |
return [0, 0, 0, 0, 0, 0, 0, 0] | return [0, 0, 0, 0, 0, 0, 0, 0, 0] | def doCopy(): return [0, 0, 0, 0, 0, 0, 0, 0] |
model_start=qa.sub(model_center,qa.mul(model_width,0.5*model_nchan)) | model_start=qa.sub(model_center,qa.mul(model_width,0.5*(model_nchan-1))) | def simdata( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refda... |
stoptime=qa.quantity(endtime, "s")); | stoptime=qa.quantity(endtime, "s"),project=project); | def simdata( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refda... |
sm.observemany(sourcenames=srces,spwname=fband,starttimes=starttimes,stoptimes=stoptimes) | sm.observemany(sourcenames=srces,spwname=fband,starttimes=starttimes,stoptimes=stoptimes,project=project) | def simdata( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refda... |
",pground='650mbar',altitude='5000m',waterheight='2km',relhum=20,pwv="+str(user_pwv)+"mm)"); | ",pground='560mbar',altitude='5000m',waterheight='200m',relhum=20,pwv="+str(user_pwv)+"mm)"); | def simdata( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refda... |
mode="tsys-atm") | mode="tsys-atm",table=noisymsroot) | def simdata( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refda... |
ia.imagecalc(absconv, "abs('%s')" % convolved) | ia.imagecalc(absconv, "abs('%s')" % convolved, overwrite=T) | def simdata( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refda... |
gridmode, wprojplanes, facats, painc, epjtablename, palimit, dopbcorr, applyoffsets, cfcache, | def pclean(vis, imagename, imsize, cell, phasecenter, mask, field, spw, ftmachine, alg, majorcycles, niter, threshold, weighting, scales, mode, start, nchan, step, imagetilevol, chanchunk, iteractive, contclean, visinmem, gridmode, wprojplanes, facats, painc, epjtablename, palimit, dopbcorr, applyoffsets, cfcache, host... | |
b.comment("Also, you should use -fno-omit-frame-pointer in order to debug on 64-bit Linux.") | b.comment("Also, you should use -fno-omit-frame-pointer for better debugging support on 64-bit Linux.") | def build_casa(b, url, revision, type, ops, architecture): builddirs = {'Linux' : {'i386' : 'linux_gnu', 'x86_64' : 'linux_64b'}, 'Darwin' : {'10.5' : 'darwin', '10.6': 'darwin'}} if not ops in builddirs.keys() or \ not architecture in builddirs[ops].keys(): raise Exception, ("Unknown OS and architecture " + str(ops) ... |
print '***WARNING: The algorithm is being tested. Software implementation is known to sometimes crash casapy. Work is in progress of fixing the software.' | print '***WARNING: The algorithm is being tested. Software implementation is known to sometimes crash casapy. Work is in progress for fixing the software.' | def clean(vis, imagename,outlierfile, field, spw, selectdata, timerange, uvrange, antenna, scan, mode, gridmode, wprojplanes, facets, cfcache, painc, epjtable, interpolation, niter, gain, threshold, psfmode, imagermode, ftmachine, mosweight, scaletype, multiscale, negcomponent, smallscalebias, interactive, mask, nchan,... |
['UVW', 557, [-172.89959178, -80.72977289, 63.39287425], 1E-4], | ['UVW', 557, [-172.89959178, -80.72977289, 63.39287425], 1E-7], | def analyseASDM(basename, caltablename0): # Reduction of NGC3256 Band 6 # M. Zwaan, May 2010 # D. Petry, May 2010 # We ignore flux calibration for now. # The script does bandpass, gain calibration (gaincal), WVR correction and a delay corrections. # Calibration tables are applied with applycal and images of the calibr... |
if (len(maskflag) == 0): raise Exception, 'maskflag is undefined' masks = s.create_mask(maskflag) | def sdflag(sdfile, antenna, scanlist, field, iflist, pollist, maskflag, flagrow, clip, clipminmax, clipoutside, flagmode, outfile, outform, overwrite, plotlevel): casalog.origin('sdflag') ### ### Now the actual task code ### try: myp=None if sdfile=='': raise Exception, 'sdfile is undefined' filename = os.path.expan... | |
oldmskarr = array(s._getmask(row)) if (len(flagrow) > 0): | if s._getflagrow(row): oldmskarr = array([False]*(s.nchan())) else: oldmskarr = array(s._getmask(row)) if clip: if (uthres != None) and (dthres != None) and (uthres > dthres): masks = array(s._getclipmask(row, uthres, dthres, clipoutside, unflag)) else: masks = [False]*(s.nchan()) elif (len(flagrow) > 0): | def sdflag(sdfile, antenna, scanlist, field, iflist, pollist, maskflag, flagrow, clip, clipminmax, clipoutside, flagmode, outfile, outform, overwrite, plotlevel): casalog.origin('sdflag') ### ### Now the actual task code ### try: myp=None if sdfile=='': raise Exception, 'sdfile is undefined' filename = os.path.expan... |
mslocal.writehistory(message='mode = "' + str(mode) + '"', origin='flagdata2') | def flagdata2(vis = None, flagbackup = None, selectdata = None, spw = None, field = None, antenna = None, uvrange = None, timerange = None, correlation = None, scan = None, feed = None, array = None, manualflag = None, mf_spw = None, mf_field = None, mf_antenna = None, mf_uvrange = None, mf_timerange = None, mf_correla... | |
mslocal.open(vis,nomodify=False) mslocal.writehistory(message='taskname = flagdata2', origin='flagdata2') mslocal.writehistory(message='vis = "' + str(vis) + '"', origin='flagdata2') mslocal.writehistory(message='mode = "' + str(mode) + '"', origin='flagdata2') | def flagdata2(vis = None, flagbackup = None, selectdata = None, spw = None, field = None, antenna = None, uvrange = None, timerange = None, correlation = None, scan = None, feed = None, array = None, manualflag = None, mf_spw = None, mf_field = None, mf_antenna = None, mf_uvrange = None, mf_timerange = None, mf_correla... | |
return 'a.imagechan_new(msname='+'"'+msname+'", start='+str(startsel[ccounter])+', numchan='+str(nchansel[ccounter])+', field="'+str(field)+'", spw='+str(spwsel[chancounter])+', cubeim='+imnam+', imroot='+imnam+',imchan='+str(chancounter)+',chanchunk='+str(chanchunk)+',niter='+str(niter)+',alg="'+alg+'", scales='+str(s... | return 'a.imagechan_new(msname='+'"'+msname+'", start='+str(startsel[ccounter])+', numchan='+str(nchansel[ccounter])+', field="'+str(field)+'", spw='+str(spwsel[ccounter])+', cubeim='+imnam+', imroot='+imnam+',imchan='+str(ccounter)+',chanchunk='+str(chanchunk)+',niter='+str(niter)+',alg="'+alg+'", scales='+str(scales)... | def gen_command(ccounter): return 'a.imagechan_new(msname='+'"'+msname+'", start='+str(startsel[ccounter])+', numchan='+str(nchansel[ccounter])+', field="'+str(field)+'", spw='+str(spwsel[chancounter])+', cubeim='+imnam+', imroot='+imnam+',imchan='+str(chancounter)+',chanchunk='+str(chanchunk)+',niter='+str(niter)+',al... |
readyputchan[chanind[k]]=True chanind[k]=chancounter | readyputchan[chanind[k]]=True | def gen_command(ccounter): return 'a.imagechan_new(msname='+'"'+msname+'", start='+str(startsel[ccounter])+', numchan='+str(nchansel[ccounter])+', field="'+str(field)+'", spw='+str(spwsel[chancounter])+', cubeim='+imnam+', imroot='+imnam+',imchan='+str(chancounter)+',chanchunk='+str(chanchunk)+',niter='+str(niter)+',al... |
if flagbackup: backup_flags(fglocal, modestr) | def flagdata2(vis = None, flagbackup = None, selectdata = None, spw = None, field = None, antenna = None, uvrange = None, timerange = None, correlation = None, scan = None, feed = None, array = None, manualflag = None, mf_spw = None, mf_field = None, mf_antenna = None, mf_uvrange = None, mf_timerange = None, mf_scan = ... | |
if (string.find(a[k][1], 'ipython console') > 0 or string.find(a[k][1],"casapy.py") > 0): | if a[k][1] == "<string>" or (string.find(a[k][1], 'ipython console') > 0 or string.find(a[k][1],"casapy.py") > 0): | def __launch( self ): |
print "splitline2=",splitline2 | def readmultifieldboxfile(self, boxfiles): circles={} boxes={} for k in range(len(self.imageids)): circles[self.imageids[k]]=[] boxes[self.imageids[k]]=[] for boxfile in boxfiles: f=open(boxfile) while 1: try: line=f.readline() if(len(line)==0): raise Exception if (line.find('#')!=0): ### its an AIPS boxfile splitline=... | |
(freqlist,finc)=self.getfreqs(nchan,spw,start,1) | if(mode=='velocity'): (freqlist,finc)=self.getfreqs(nchan,spw,start,-1) else: (freqlist,finc)=self.getfreqs(nchan,spw,start,1) | def setChannelization(self,mode,spw,field,nchan,start,width,frame,veltype,restf): """ determine appropriate values for channelization parameters when default values are used for mode='velocity' or 'frequency' or 'channel' """ #pdb.set_trace() #if (mode!='frequency' and mode!='velocity') or (nchan!=-1 and start!='' and ... |
if(mode=='velocity' and nchan==-1): vmin=self.convertvf(str(freqlist[-1])+'Hz',frame,field,restf) vmax=self.convertvf(str(freqlist[0])+'Hz',frame,field,restf) if(width==''): vwidth=qa.sub(qa.quantity(vmax),qa.quantity(self.convertvf(str(freqlist[1])+'Hz',frame,field,restf))) else: vwidth=qa.convert(width,'m/s') vrange=... | def setChannelization(self,mode,spw,field,nchan,start,width,frame,veltype,restf): """ determine appropriate values for channelization parameters when default values are used for mode='velocity' or 'frequency' or 'channel' """ #pdb.set_trace() #if (mode!='frequency' and mode!='velocity') or (nchan!=-1 and start!='' and ... | |
if(width==''): v1 = self.convertvf(str(freqlist[-2])+'Hz',frame,field,restf) v0 = self.convertvf(str(freqlist[-1])+'Hz',frame,field,restf) retwidth=str(qa.quantity(qa.sub(qa.quantity(v1),qa.quantity(v0)))['value'])+'m/s' else: retwidth=width | if nchan ==-1: if retnchan > 1: vmin=self.convertvf(str(freqlist[-1])+'Hz',frame,field,restf) vmax=self.convertvf(str(freqlist[0])+'Hz',frame,field,restf) if(width==''): vwidth=qa.sub(qa.quantity(vmax),qa.quantity(self.convertvf(str(freqlist[1])+'Hz',frame,field,restf))) else: vwidth=qa.convert(width,'m/s') vrange=qa.... | def setChannelization(self,mode,spw,field,nchan,start,width,frame,veltype,restf): """ determine appropriate values for channelization parameters when default values are used for mode='velocity' or 'frequency' or 'channel' """ #pdb.set_trace() #if (mode!='frequency' and mode!='velocity') or (nchan!=-1 and start!='' and ... |
finc=chanfreqs1d[1]-chanfreqs1d[0] | if width==-1: finc=chanfreqs1d[-1]-chanfreqs1d[-2] else: finc=chanfreqs1d[1]-chanfreqs1d[0] | def getfreqs(self,nchan,spw,start,width, dummy=False): """ returns a list of frequencies to be used in output clean image """ #pdb.set_trace() freqlist=[] finc=1 loc_nchan=0 |
if(qa.quantity(start)['unit'].find('Hz') > -1): bw=chanfreqs1d[-1]-startf | if(qa.quantity(start)['unit'].find('Hz') > -1): if width==-1: bw=startf-chanfreqs1d[0] else: bw=chanfreqs1d[-1]-startf | def getfreqs(self,nchan,spw,start,width, dummy=False): """ returns a list of frequencies to be used in output clean image """ #pdb.set_trace() freqlist=[] finc=1 loc_nchan=0 |
self.assertTrue(abs(diffData).max() == 0) | self.assertTrue(abs(diffData).max() < 4e-13) | def checkImage(self, gotImage, expectedName): expected = iatool.create() expected.open(expectedName) got = iatool.create() if type(gotImage) == str: got.open(gotImage) else: got = gotImage self.assertTrue(got.shape() == expected.shape()) diffData = got.getchunk() - expected.getchunk() self.assertTrue(abs(diffData).max(... |
util.nextfig() | def simdata( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refda... | |
os.system('rm -rf ' +myasdm_dataset_name+'.ms*') | os.system('rm -rf ' +msname) os.system('rm -rf ' +msname+'.flagversions') | def tearDown(self): os.system('rm -rf ' +myasdm_dataset_name) os.system('rm -rf ' +myasdm_dataset_name+'.ms*') |
retValue = {'success': True, 'msgs': "", 'error_msgs': '' } | retValue = {'success': True, 'msgs': "", 'error_msgs': '' } if (not os.path.exists(myasdm_dataset_name)): print myname, ': Error: Input asdm does not exist %s'%myasdm_dataset_name | def test3(self): '''Asdm-import 3: Good input''' retValue = {'success': True, 'msgs': "", 'error_msgs': '' } try: self.res = importoldasdm(myasdm_dataset_name) except: retValue['success']=False retValue['error_msgs']=retValue['error_msgs']+'Failed to run on good input.' |
print myname, ": Error ", sys.exc_info()[0] raise | def test3(self): '''Asdm-import 3: Good input''' retValue = {'success': True, 'msgs': "", 'error_msgs': '' } try: self.res = importoldasdm(myasdm_dataset_name) except: retValue['success']=False retValue['error_msgs']=retValue['error_msgs']+'Failed to run on good input.' | |
print myname, ": Success! Now checking output ..." | def test3(self): '''Asdm-import 3: Good input''' retValue = {'success': True, 'msgs': "", 'error_msgs': '' } try: self.res = importoldasdm(myasdm_dataset_name) except: retValue['success']=False retValue['error_msgs']=retValue['error_msgs']+'Failed to run on good input.' | |
"ASDMBinary", | def verify_asdm(asdmname): print "Verifying asdm ", asdmname if(not os.path.exists(asdmname)): print "asdm ", asdmname, " doesn't exist." raise Exception # test for the existence of all obligatory tables allTables = [ "Antenna.xml", "ASDMBinary", "ASDM.xml", # "CalData.xml", # "CalDelay.xml", # "CalReduction.xml", "Con... | |
"FocusModel.xml", "Focus.xml", | def verify_asdm(asdmname): print "Verifying asdm ", asdmname if(not os.path.exists(asdmname)): print "asdm ", asdmname, " doesn't exist." raise Exception # test for the existence of all obligatory tables allTables = [ "Antenna.xml", "ASDMBinary", "ASDM.xml", # "CalData.xml", # "CalDelay.xml", # "CalReduction.xml", "Con... | |
pweight -- weighting for polarization average options: 'none' 'var' = 1/var(spec) weighted 'tsys' = 1/Tsys**2 weighted default: 'none' """ | pweight -- weighting for polarization average options: 'var' = 1/var(spec) weighted 'tsys' = 1/Tsys**2 weighted default: 'tsys' """ | def pweight(): """ pweight -- weighting for polarization average options: 'none' 'var' = 1/var(spec) weighted 'tsys' = 1/Tsys**2 weighted default: 'none' """ |
tweight -- weighting for time average options: 'none' 'var' = 1/var(spec) weighted 'tsys' = 1/Tsys**2 weighted 'tint' = integration time weighted 'tintsys' = Tint/Tsys**2 'median' = median averaging default: 'none' | tweight -- weighting for time average options: 'var' = 1/var(spec) weighted 'tsys' = 1/Tsys**2 weighted 'tint' = integration time weighted 'tintsys' = Tint/Tsys**2 'median' = median averaging default: 'tintsys' | def tweight(): """ tweight -- weighting for time average options: 'none' 'var' = 1/var(spec) weighted 'tsys' = 1/Tsys**2 weighted 'tint' = integration time weighted 'tintsys' = Tint/Tsys**2 'median' = median averaging default: 'none' """ |
print 'hello1' | def getfreqs(self,nchan,spw,start,width, dummy=False): """ returns a list of frequencies to be used in output clean image """ #pdb.set_trace() freqlist=[] finc=1 loc_nchan=0 | |
print type(chanfreqs1dx) | def getfreqs(self,nchan,spw,start,width, dummy=False): """ returns a list of frequencies to be used in output clean image """ #pdb.set_trace() freqlist=[] finc=1 loc_nchan=0 | |
def time_then_chan_avg(inms, tbin, chanbin, outms="", zaptemp=True, zaporig=False, chanselstr=""): | def time_then_chan_avg(inms, tbin, chanbin, outms="", zaptemp=True, zaporig=False, chanselstr="", datacolstr='corrected'): | def time_then_chan_avg(inms, tbin, chanbin, outms="", zaptemp=True, zaporig=False, chanselstr=""): """ Bins time and frequency in 1.x passes. First inms is time averaged to in_timebin<tbin>.ms by split with timebin = tbin. Then in_timebin<tbin>.ms (much smaller than inms!) is channel averaged to outms by split with w... |
timechansel = chanselstr cs_simplifications = [] | def time_then_chan_avg(inms, tbin, chanbin, outms="", zaptemp=True, zaporig=False, chanselstr=""): """ Bins time and frequency in 1.x passes. First inms is time averaged to in_timebin<tbin>.ms by split with timebin = tbin. Then in_timebin<tbin>.ms (much smaller than inms!) is channel averaged to outms by split with w... | |
if (timechansel.find(':') > -1) and ((timechansel.find(',') > -1) or (timechansel.find(';') > -1)): | if (chanselstr.find(':') > -1) and ((chanselstr.find(',') > -1) or (chanselstr.find(';') > -1)): | def time_then_chan_avg(inms, tbin, chanbin, outms="", zaptemp=True, zaporig=False, chanselstr=""): """ Bins time and frequency in 1.x passes. First inms is time averaged to in_timebin<tbin>.ms by split with timebin = tbin. Then in_timebin<tbin>.ms (much smaller than inms!) is channel averaged to outms by split with w... |
chanpat = r':\d+(~\d+)?(;\d+)?' timechansel = re.sub(chanpat, '', timechansel) datacolstr = 'all' tb.open(inms) cns = tb.colnames() tb.close() if 'IMAGING_WEIGHT' not in cns: clearcal(vis=inms, spw=timechansel) | def time_then_chan_avg(inms, tbin, chanbin, outms="", zaptemp=True, zaporig=False, chanselstr=""): """ Bins time and frequency in 1.x passes. First inms is time averaged to in_timebin<tbin>.ms by split with timebin = tbin. Then in_timebin<tbin>.ms (much smaller than inms!) is channel averaged to outms by split with w... | |
split(vis=inms, outputvis=tms, timebin=tbin, spw=timechansel, | split(vis=inms, outputvis=tms, timebin=tbin, spw=chanselstr, | def time_then_chan_avg(inms, tbin, chanbin, outms="", zaptemp=True, zaporig=False, chanselstr=""): """ Bins time and frequency in 1.x passes. First inms is time averaged to in_timebin<tbin>.ms by split with timebin = tbin. Then in_timebin<tbin>.ms (much smaller than inms!) is channel averaged to outms by split with w... |
timechansel, | chanselstr, | def time_then_chan_avg(inms, tbin, chanbin, outms="", zaptemp=True, zaporig=False, chanselstr=""): """ Bins time and frequency in 1.x passes. First inms is time averaged to in_timebin<tbin>.ms by split with timebin = tbin. Then in_timebin<tbin>.ms (much smaller than inms!) is channel averaged to outms by split with w... |
chanselstr = update_chanselstr(chanselstr, timechansel) | if funnyshapes: tb.open(tms) cns = tb.colnames() tb.close() if 'IMAGING_WEIGHT' not in cns: clearcal(vis=tms) casalog.post("Clearing tb locks") tb.clearlocks() | def time_then_chan_avg(inms, tbin, chanbin, outms="", zaptemp=True, zaporig=False, chanselstr=""): """ Bins time and frequency in 1.x passes. First inms is time averaged to in_timebin<tbin>.ms by split with timebin = tbin. Then in_timebin<tbin>.ms (much smaller than inms!) is channel averaged to outms by split with w... |
split(vis=tms, outputvis=outms, datacolumn='data', width=chanbin, spw=chanselstr) | if datacolstr.lower() not in ['all', 'float_data', 'lag_data']: datacolstr = 'data' split(vis=tms, outputvis=outms, datacolumn=datacolstr, width=chanbin) | def time_then_chan_avg(inms, tbin, chanbin, outms="", zaptemp=True, zaporig=False, chanselstr=""): """ Bins time and frequency in 1.x passes. First inms is time averaged to in_timebin<tbin>.ms by split with timebin = tbin. Then in_timebin<tbin>.ms (much smaller than inms!) is channel averaged to outms by split with w... |
def update_chanselstr(totchansel, firstchansel): """ When doing a two-step split, the channel selection string (spw) may need to be updated for the 2nd run, since the 1st run can remap the spw and channel numbers. For example, if the first run uses "15~18:0~9;3", the output of that run no longer has spws called 15 to ... | def time_then_chan_avg(inms, tbin, chanbin, outms="", zaptemp=True, zaporig=False, chanselstr=""): """ Bins time and frequency in 1.x passes. First inms is time averaged to in_timebin<tbin>.ms by split with timebin = tbin. Then in_timebin<tbin>.ms (much smaller than inms!) is channel averaged to outms by split with w... | |
for i in range(offsets.shape[1]): | for i in xrange(offsets.shape[1]): | def simdata2( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refd... |
for k in range(0,nant): antnames.append('A%02d'%k) | for k in xrange(0,nant): antnames.append('A%02d'%k) | def simdata2( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refd... |
for k in range(0,nfld): | for k in xrange(0,nfld): | def simdata2( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refd... |
for k in range(0,nscan) : | for k in xrange(0,nscan) : | def simdata2( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refd... |
msg('copying '+msroot+'.sd.ms to ' + | msg('copying '+sdmsfile+' to ' + | def simdata2( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refd... |
shutil.rmtree(noisymsroot+".sd.ms") shutil.copytree(msfile,noisymsroot+".sd.ms") | shutil.rmtree(noisymsroot+".sd.ms") shutil.copytree(sdmsfile,noisymsroot+".sd.ms") | def simdata2( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refd... |
tpms=project+'.sd.ms' | tpms=sdmsfile | def simdata2( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refd... |
util.flatimage(imagename+".residual",verbose=verbose) | if os.path.exists(imagename+".residual"): util.flatimage(imagename+".residual",verbose=verbose) else: if showresidual: msg(imagename+".residual not found -- residual will not be plotted",priority="warn") showresidual=False | def simdata2( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refd... |
if mode!="channel" and start==0: | if (mode=="frequency" or mode=="velocity") and start==0: | def setChannelization(self,mode,spw,field,nchan,start,width,frame,veltype,restf): """ determine appropriate values for channelization parameters when default values are used for mode='velocity' or 'frequency' or 'channel' """ |
fit = ia.fitprofile(ngauss=1,poly=1,fit=False)['return']['elements']['*1']['parameters'][1]/1e3 | center = ia.fitprofile(ngauss=1,poly=1)['center0'][0] csys = ia.coordsys() fit = csys.velocitytofrequency(center)/1e3 | def imstats(image): ia.open(image) ch0 = (ia.toworld([n/2,n/2,0,0],'n')['numeric'][3])/ 1e3 nch = ia.shape()[3] chn = (ia.toworld([n/2,n/2,0,nch-1],'n')['numeric'][3])/ 1e3 del1 = (ia.toworld([n/2,n/2,0,1],'n')['numeric'][3] - 1e3*ch0) /1e3 wid = (ia.summary()['header']['incr'][3]) /1e3 del2 = (1e3*chn - ia.toworld([n/... |
tb.open(currms) | try: tb.open(currms) except Exception, e: if str(e)[-15:] == " does not exist": print "tb could not open", currms else: print "Error", e, "from tb.open(", currms, ")" break | def checkMSes(holderdict, dir, files): """ Updates holderdict['msdict'] with a list of MSes in dir that match holderdict['musthave'] and holderdict['mspat'] as in lsms(musthave, mspat, combine, sortfirst, remind). If holderdict['doprint']=True a blurb about each ms will be printed as it is found, using holderdict['rem... |
if holderdict.get('doprint'): | elif holderdict.get('doprint'): | def checkMSes(holderdict, dir, files): """ Updates holderdict['msdict'] with a list of MSes in dir that match holderdict['musthave'] and holderdict['mspat'] as in lsms(musthave, mspat, combine, sortfirst, remind). If holderdict['doprint']=True a blurb about each ms will be printed as it is found, using holderdict['rem... |
'isOK': {'pat': r'^\s*(Date__\(UT\)__HR:MN\s+R.A._+\([^_]+\)_+DEC\s+Ob-lon\s+Ob-lat\s+Sl-lon\s+Sl-lat\s+NP.ang\s+NP.dist\s+r\s+rdot\s+delta\s+deldot\s+S-T-O)'} | def readJPLephem(fmfile): """ Reads a JPL Horizons text file (ask Bryan Butler) for a solar system object and returns various quantities in a dictionary. The dict will be blank ({}) if there is a failure. """ retdict = {} casalog.origin('readJPLephem') # Try opening fmfile now, because otherwise there's no point cont... | |
cols = {} cols['date'] = {'comment': 'date', 'pat': r'^\s*(?P<date>\d+-\w+-\d+ \d+:\d+)'} radecpat = r'\s+\d+ \d+ [0-9.]+ [-+ ]?\d+ \d+ [0-9.]+' lonlatpat = r'\s+([0-9.]+|n\.a\.)\s+[-+]?([0-9.]+|n\.a\.)' cols['r'] = {'comment': 'heliocentric distance', 'unit': 'AU', 'pat': r'\s+(?P<r>[0-9.]+)... | datapat = r'^\s*' stoppat = r'\$\$EOE$' | def readJPLephem(fmfile): """ Reads a JPL Horizons text file (ask Bryan Butler) for a solar system object and returns various quantities in a dictionary. The dict will be blank ({}) if there is a failure. """ retdict = {} casalog.origin('readJPLephem') # Try opening fmfile now, because otherwise there's no point cont... |
retdict['data'] = {} for col in cols: retdict['data'][col] = {'comment': cols[col]['comment'], 'data': []} | num_cols = 0 in_data = False comp_mismatches = [] print_datapat = False | def readJPLephem(fmfile): """ Reads a JPL Horizons text file (ask Bryan Butler) for a solar system object and returns various quantities in a dictionary. The dict will be blank ({}) if there is a failure. """ retdict = {} casalog.origin('readJPLephem') # Try opening fmfile now, because otherwise there's no point cont... |
if retdict.has_key('isOK'): | if in_data: if re.match(stoppat, line): break | def readJPLephem(fmfile): """ Reads a JPL Horizons text file (ask Bryan Butler) for a solar system object and returns various quantities in a dictionary. The dict will be blank ({}) if there is a failure. """ retdict = {} casalog.origin('readJPLephem') # Try opening fmfile now, because otherwise there's no point cont... |
for col in matchobj.groupdict(): retdict['data'][col]['data'].append(matchobj.groupdict()[col]) elif re.match(stoppat, line): break | gdict = matchobj.groupdict() for col in gdict: retdict['data'][col]['data'].append(gdict[col]) if len(gdict) < num_cols: print "Partially mismatching line:" print line print "Found:" print gdict print_datapat = True else: print_datapat = True comp_mismatches.append(re.sub(r'\s*$', '', line)) elif re.match(r'^\s*' + co... | def readJPLephem(fmfile): """ Reads a JPL Horizons text file (ask Bryan Butler) for a solar system object and returns various quantities in a dictionary. The dict will be blank ({}) if there is a failure. """ retdict = {} casalog.origin('readJPLephem') # Try opening fmfile now, because otherwise there's no point cont... |
retdict[hk] = {'unit': headers[hk]['unit'], 'value': float(retdict[hk])} | if hk == 'radii': radii = retdict[hk].split('x') a, b, c = [float(r) for r in radii] retdict[hk] = {'unit': headers[hk]['unit'], 'value': (a, b, c)} retdict['meanrad'] = {'unit': headers[hk]['unit'], 'value': mean_radius(a, b, c)} else: try: if type(retdict[hk]) != dict: retdict[hk] = {'unit': headers[hk]['unit'], 'va... | def readJPLephem(fmfile): """ Reads a JPL Horizons text file (ask Bryan Butler) for a solar system object and returns various quantities in a dictionary. The dict will be blank ({}) if there is a failure. """ retdict = {} casalog.origin('readJPLephem') # Try opening fmfile now, because otherwise there's no point cont... |
for dk in ['r', 'delta', 'phang']: retdict['data'][dk]['data'] = {'unit': cols[dk]['unit'], 'value': numpy.array([float(s) for s in retdict['data'][dk]['data']])} | for dk in retdict['data']: if cols[dk].has_key('unit'): retdict['data'][dk]['data'] = {'unit': cols[dk]['unit'], 'value': numpy.array([float(s) for s in retdict['data'][dk]['data']])} | def readJPLephem(fmfile): """ Reads a JPL Horizons text file (ask Bryan Butler) for a solar system object and returns various quantities in a dictionary. The dict will be blank ({}) if there is a failure. """ retdict = {} casalog.origin('readJPLephem') # Try opening fmfile now, because otherwise there's no point cont... |
(errorcode, datasvnr) = commands.getstatusoutput('cd '+DATA_REPOS[0]+' && svnversion 2>&1 | grep -ivw warning') | if os.system("which svnversion") == 0: (errorcode, datasvnr) = commands.getstatusoutput('cd '+DATA_REPOS[0]+' && svnversion 2>&1 | grep -vi warning') else: errorcode = 1 | def __init__(self, test, \ DATA_REPOS=[AIPS_DIR+'/data'], \ WORKING_DIR='/tmp/casa_regression_work/', \ RESULT_DIR='/tmp/casa_regression_result/', \ retemplate=False, cleanup=True, profile=False): """cleanup: set to False to keep data around. profile: set to True to enable C++ profiling. This requires that the command... |
'cd '+DATA_REPOS[0]+" && grep -E 'Rev:' version | awk '{print $2}'" \ | 'cd '+DATA_REPOS[0]+" && grep -E 'Rev:' version" \ | def __init__(self, test, \ DATA_REPOS=[AIPS_DIR+'/data'], \ WORKING_DIR='/tmp/casa_regression_work/', \ RESULT_DIR='/tmp/casa_regression_result/', \ retemplate=False, cleanup=True, profile=False): """cleanup: set to False to keep data around. profile: set to True to enable C++ profiling. This requires that the command... |
srces.append(src) starttimes.append(str(sttime)+"s") stoptimes.append(str(endtime)+"s") dirs.append(caldirection) else: sm.observe(sourcename="phase calibrator", spwname=fband, starttime=qa.quantity(sttime, "s"), stoptime=qa.quantity(endtime, "s"),project=project); | sm.observemany(sourcenames=srces,spwname=fband,starttimes=starttimes,stoptimes=stoptimes,project=project) srces=[] starttimes=[] stoptimes=[] dirs=[] sm.observe(sourcename="phase calibrator", spwname=fband, starttime=qa.quantity(sttime, "s"), stoptime=qa.quantity(endtime, "s"), state_obs_mode="CALIBRATE_PHASE.ON_... | def simdata( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refda... |
if observemany: | if observemany and (not docalibrator): | def simdata( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refda... |
if tp_only: msfile=tpms | def simdata( project=None, modifymodel=None, skymodel=None, inbright=None, indirection=None, incell=None, incenter=None, inwidth=None, # innchan=None, setpointings=None, ptgfile=None, integration=None, direction=None, mapsize=None, maptype=None, pointingspacing=None, caldirection=None, calflux=None, predict=None, refda... | |
vList.append(Violation(self, line)) | vList.append(Violation(self, line, variable)) | def apply(self, lines): vList = [] if (self.getFiletype() in self.getTypeList()): for line in lines: variableList = getVariableNames(line.stripped, "bool") for variable in variableList: if ( re.search("[nN]ot?", variable) ): vList.append(Violation(self, line)) return vList |
if (re.search("^\s*public:", line.stripped) and line.inClass): | if (re.search("^\s*public:", line.stripped) and line.inClass and not line.inNestedClass): | def apply(self, lines): if (self.getFiletype() in self.getTypeList()): vList = [] order = [0, 0, 0] nSeg = 0 for line in lines: if (re.search("^\s*public:", line.stripped) and line.inClass): if order[0]: vList.append( Violation(self, line, "'public' repeated") ) nSeg += 1 order[0] = nSeg if (re.search("^\s*protected:"... |
if (re.search("^\s*protected:", line.stripped) and line.inClass): | if (re.search("^\s*protected:", line.stripped) and line.inClass and not line.inNestedClass): | def apply(self, lines): if (self.getFiletype() in self.getTypeList()): vList = [] order = [0, 0, 0] nSeg = 0 for line in lines: if (re.search("^\s*public:", line.stripped) and line.inClass): if order[0]: vList.append( Violation(self, line, "'public' repeated") ) nSeg += 1 order[0] = nSeg if (re.search("^\s*protected:"... |
if (re.search("^\s*private:", line.stripped) and line.inClass): | if (re.search("^\s*private:", line.stripped) and line.inClass and not line.inNestedClass): | def apply(self, lines): if (self.getFiletype() in self.getTypeList()): vList = [] order = [0, 0, 0] nSeg = 0 for line in lines: if (re.search("^\s*public:", line.stripped) and line.inClass): if order[0]: vList.append( Violation(self, line, "'public' repeated") ) nSeg += 1 order[0] = nSeg if (re.search("^\s*protected:"... |
if (re.search("^\s*};\s*", line.stripped) and lines[line.number - 2].inClass): | if (re.search("^\s*};\s*", line.stripped) and lines[line.number - 2].inClass and not lines[line.number - 2].inNestedClass): | def apply(self, lines): if (self.getFiletype() in self.getTypeList()): vList = [] order = [0, 0, 0] nSeg = 0 for line in lines: if (re.search("^\s*public:", line.stripped) and line.inClass): if order[0]: vList.append( Violation(self, line, "'public' repeated") ) nSeg += 1 order[0] = nSeg if (re.search("^\s*protected:"... |
isBracketAligned = True | isBracketAligned = False | def apply(self, lines): vList = [] # don't enforce this for line continuation of argument lists or other parenthesized statements inParentheses = False if (self.getFiletype() in self.getTypeList()): for line in lines: if (re.search("\([^\)]+$", line.stripped)): inParentheses = True m = re.search("^(\s*)[^\s]", line.s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.