Skip to content

Commit

Permalink
Merge pull request #366 from cyriltasse/spellcheck
Browse files Browse the repository at this point in the history
Spell check
  • Loading branch information
ratt-priv-ci authored Jun 27, 2017
2 parents 21b8a6d + 68c0f29 commit f12956d
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions DDFacet/Array/ModLinAlg.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def test_Dot_ListBlockMat_Mat():
T=ClassTimeIt.ClassTimeIt()


print "Dimentions A[%s], B[%s]"%(BlocksMat.shape,B.shape)
print "Dimensions A[%s], B[%s]"%(BlocksMat.shape,B.shape)
R0=Dot_ListBlockMat_Mat(ListBlocks,B)
T.timeit("ListProd")
R1=np.dot(BlocksMat,B)
Expand Down Expand Up @@ -361,7 +361,7 @@ def test_Dot_ListBlockMat_Mat_Big():
T=ClassTimeIt.ClassTimeIt()


print "Dimentions A[%ix%s -> %s], B[%s]"%(nblocks,ThisBlock.shape,(nblocks*n,nblocks*n),B.shape)
print "Dimensions A[%ix%s -> %s], B[%s]"%(nblocks,ThisBlock.shape,(nblocks*n,nblocks*n),B.shape)
R0=Dot_ListBlockMat_Mat(ListBlocks,B)
T.timeit("ListProd")

Expand Down
2 changes: 1 addition & 1 deletion DDFacet/Array/shared_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, path, exc_info):
self.exc_info = exc_info

class ItemProxy(object):
"""Base class for helper class used to defer loading of ShareDict items until they are actually requested"""
"""Base class for helper class used to defer loading of SharedDict items until they are actually requested"""
def __init__(self, path):
self.path = path
def load(self):
Expand Down
2 changes: 1 addition & 1 deletion DDFacet/CleanSHM.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def read_options():
opt = optparse.OptionParser(usage='Usage: %prog <options>',version='%prog version 1.0',description=desc)

group = optparse.OptionGroup(opt, "* SHM")
group.add_option('--ID',help='ID of ssared memory to be deleted, default is %default',default=None)
group.add_option('--ID',help='ID of shared memory to be deleted, default is %default',default=None)
opt.add_option_group(group)
options, arguments = opt.parse_args()

Expand Down
4 changes: 2 additions & 2 deletions DDFacet/Data/ClassMS.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ def PutVisColumn(self, colname, vis, row0, row1, likecol="DATA", sort_index=None
def SaveVis(self,vis=None,Col="CORRECTED_DATA",spw=0,DoPrint=True):
if vis is None:
vis=self.data
if DoPrint: print>>log, "Writting data in column %s" % ModColor.Str(Col, col="green")
if DoPrint: print>>log, "Writing data in column %s" % ModColor.Str(Col, col="green")
table_all=self.GiveMainTable(readonly=False)

if self.swapped:
Expand Down Expand Up @@ -1553,7 +1553,7 @@ def AddUVW_dt(self):
pBAR.render(ant0+1, na)


print>>log,"Writting in column UVWDT"
print>>log,"Writing in column UVWDT"
t.putcol("UVWDT",UVW_dt)
t.close()

Expand Down
10 changes: 5 additions & 5 deletions DDFacet/Imager/ClassDeconvMachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ def GiveMetroModel(self):

# ####################
# Run MetroClean
print>>log,"Runing a Metropolis-Hastings MCMC on islands larger than %i pixels"%self.GD["SSDClean"]["RestoreMetroSwitch"]
print>>log,"Running a Metropolis-Hastings MCMC on islands larger than %i pixels"%self.GD["SSDClean"]["RestoreMetroSwitch"]
DeconvMachine.setDeconvMode(Mode="MetroClean")
DeconvMachine.Update(self.DicoDirty)
repMinor, continue_deconv, update_model = DeconvMachine.Deconvolve()
Expand Down Expand Up @@ -1426,7 +1426,7 @@ def RestoreAndShift(self):
SmoothNorm=Norm
sqrtSmoothNorm=sqrtNorm
else:
print>>log,ModColor.Str("Using the freq-averaged smooth beam to normalise the apparant images",col="blue")
print>>log,ModColor.Str("Using the freq-averaged smooth beam to normalise the apparent images",col="blue")
SmoothNorm=self.FacetMachine.MeanSmoothJonesNorm
sqrtSmoothNorm=np.sqrt(SmoothNorm)

Expand Down Expand Up @@ -1474,7 +1474,7 @@ def Restore(self):
try:
ModelMachine.PutBackSubsComps()
except:
print>>log, ModColor.Str("Failed Putting back substracted components")
print>>log, ModColor.Str("Failed putting back subtracted components")

# do we have a non-trivial norm (i.e. DDE solutions or beam)?
# @cyriltasse: maybe there's a quicker way to check?
Expand Down Expand Up @@ -1518,7 +1518,7 @@ def smooth_sqrtnorm():
if self.FacetMachine.MeanSmoothJonesNorm is None:
a = self.MeanJonesNorm
else:
print>>log,ModColor.Str("Using the freq-averaged smooth beam to normalise the apparant images",col="blue")
print>>log,ModColor.Str("Using the freq-averaged smooth beam to normalise the apparent images",col="blue")
a=self.FacetMachine.MeanSmoothJonesNorm
else:
a=np.array([1])
Expand All @@ -1532,7 +1532,7 @@ def smooth_sqrtnormcube():
if self.FacetMachine.MeanSmoothJonesNorm is None:
a = self.JonesNorm
else:
print>>log,ModColor.Str("Using the smooth beam to normalise the apparant images",col="blue")
print>>log,ModColor.Str("Using the smooth beam to normalise the apparent images",col="blue")
a=self.FacetMachine.SmoothJonesNorm
else:
a=np.array([1])
Expand Down
2 changes: 1 addition & 1 deletion DDFacet/Imager/ClassImageDeconvMachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def Deconvolve(self, Nminor=None, ch=0):
mm0,mm1=self.Dirty.min(),self.Dirty.max()
print>>log, " Dirty image peak flux = %7.3f Jy [(min, max) = (%7.3f, %7.3f) Jy]"%(MaxDirty,mm0,mm1)
print>>log, " RMS threshold flux = %7.3f Jy [rms = %7.3f Jy]"%(FluxLimit, RMS)
print>>log, " Sidelobs threshold flux = %7.3f Jy [sidelobe = %7.3f of peak]"%(Threshold_SideLobe,self.SideLobeLevel)
print>>log, " Sidelobe threshold flux = %7.3f Jy [sidelobe = %7.3f of peak]"%(Threshold_SideLobe,self.SideLobeLevel)

MaxModelInit=np.max(np.abs(self.ModelImage))

Expand Down
4 changes: 2 additions & 2 deletions DDFacet/Imager/HOGBOM/ClassModelMachineHogbom.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def PutBackSubsComps(self):
# RestoreDico=self.GD["Data"]["RestoreDico"]
RestoreDico = DicoSolsFile["ModelName"][()][0:-4] + ".DicoModel"

print>> log, "Adding previously substracted components"
print>> log, "Adding previously subtracted components"
ModelMachine0 = ClassModelMachine(self.GD)

ModelMachine0.FromFile(RestoreDico)
Expand All @@ -213,4 +213,4 @@ def PutBackSubsComps(self):
if not ((x1, y1) in self.DicoSMStacked["Comp"].keys()):
self.DicoSMStacked["Comp"][(x1, y1)] = ModelMachine0.DicoSMStacked["Comp"][(x0, y0)]
else:
self.DicoSMStacked["Comp"][(x1, y1)] += ModelMachine0.DicoSMStacked["Comp"][(x0, y0)]
self.DicoSMStacked["Comp"][(x1, y1)] += ModelMachine0.DicoSMStacked["Comp"][(x0, y0)]
10 changes: 5 additions & 5 deletions DDFacet/Imager/MORESANE/ClassModelMachineMORESANE.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def GiveSpectralIndexMap(self,CellSizeRad=1.,GaussPars=[(1,1,0)],DoConv=True):


def CleanNegComponants(self,box=20,sig=3,RemoveNeg=True):
print>>log, "Cleaning model dictionary from negative componants with (box, sig) = (%i, %i)"%(box,sig)
print>>log, "Cleaning model dictionary from negative components with (box, sig) = (%i, %i)"%(box,sig)
ModelImage=self.GiveModelImage(self.DicoSMStacked["RefFreq"])[0,0]

Min=scipy.ndimage.filters.minimum_filter(ModelImage,(box,box))
Expand All @@ -269,18 +269,18 @@ def CleanNegComponants(self,box=20,sig=3,RemoveNeg=True):
if RemoveNeg==False:
Lx,Ly=np.where((ModelImage<sig*Min)&(ModelImage!=0))
else:
print>>log, " Removing neg componants too"
print>>log, " Removing neg components too"
Lx,Ly=np.where( ((ModelImage<sig*Min)&(ModelImage!=0)) | (ModelImage<0))

for icomp in range(Lx.size):
key=Lx[icomp],Ly[icomp]
try:
del(self.DicoSMStacked["Comp"][key])
except:
print>>log, " Componant at (%i, %i) not in dict "%key
print>>log, " Component at (%i, %i) not in dict "%key

def CleanMaskedComponants(self,MaskName):
print>>log, "Cleaning model dictionary from masked componants using %s"%(MaskName)
print>>log, "Cleaning model dictionary from masked components using %s"%(MaskName)
im=image(MaskName)
MaskArray=im.getdata()[0,0].T[::-1]
for (x,y) in self.DicoSMStacked["Comp"].keys():
Expand Down Expand Up @@ -371,7 +371,7 @@ def PutBackSubsComps(self):
#RestoreDico=self.GD["Data"]["RestoreDico"]
RestoreDico=DicoSolsFile["ModelName"][()][0:-4]+".DicoModel"

print>>log, "Adding previously substracted components"
print>>log, "Adding previously subtracted components"
ModelMachine0=ClassModelMachine(self.GD)


Expand Down
10 changes: 5 additions & 5 deletions DDFacet/Imager/MSMF/ClassModelMachineMSMF.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def GiveModelImage(self,FreqIn=None,out=None,DoAbs=False):
return ModelImage

def CleanNegComponants(self,box=20,sig=3,RemoveNeg=True):
print>>log, "Cleaning model dictionary from negative componants with (box, sig) = (%i, %i)"%(box,sig)
print>>log, "Cleaning model dictionary from negative components with (box, sig) = (%i, %i)"%(box,sig)
ModelImage=self.GiveModelImage(self.DicoSMStacked["RefFreq"])[0,0]

Min=scipy.ndimage.filters.minimum_filter(ModelImage,(box,box))
Expand All @@ -372,18 +372,18 @@ def CleanNegComponants(self,box=20,sig=3,RemoveNeg=True):
if RemoveNeg==False:
Lx,Ly=np.where((ModelImage<sig*Min)&(ModelImage!=0))
else:
print>>log, " Removing neg componants too"
print>>log, " Removing neg components too"
Lx,Ly=np.where( ((ModelImage<sig*Min)&(ModelImage!=0)) | (ModelImage<0))

for icomp in range(Lx.size):
key=Lx[icomp],Ly[icomp]
try:
del(self.DicoSMStacked["Comp"][key])
except:
print>>log, " Componant at (%i, %i) not in dict "%key
print>>log, " Component at (%i, %i) not in dict "%key

def CleanMaskedComponants(self,MaskName):
print>>log, "Cleaning model dictionary from masked componants using %s"%(MaskName)
print>>log, "Cleaning model dictionary from masked components using %s"%(MaskName)
im=image(MaskName)
MaskArray=im.getdata()[0,0].T[::-1]
for (x,y) in self.DicoSMStacked["Comp"].keys():
Expand Down Expand Up @@ -473,7 +473,7 @@ def PutBackSubsComps(self):
#RestoreDico=self.GD["Data"]["RestoreDico"]
RestoreDico=DicoSolsFile["ModelName"][()][0:-4]+".DicoModel"

print>>log, "Adding previously substracted components"
print>>log, "Adding previously subtracted components"
ModelMachine0=ClassModelMachine(self.GD)


Expand Down
2 changes: 1 addition & 1 deletion DDFacet/Imager/ModModelMachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def GiveMMFromDico(self,DicoSMStacked=None):
DicoSMStacked = Dictionary to instantiate ModelMachine with
"""
if DicoSMStacked["Type"]=="GA":
print>>log,ModColor.Str("Model is of deprecated type GA, overwritting with type SSD")
print>>log,ModColor.Str("Model is of deprecated type GA, overwriting with type SSD")
DicoSMStacked["Type"]="SSD"

if DicoSMStacked is not None: # If the Dict is provided use it to initialise a model machine
Expand Down
2 changes: 1 addition & 1 deletion DDFacet/Imager/SSD/ClassIslandDistanceMachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def CalcCrossIslandFlux(self,ListIslands):
if self.PSFCross is None:
self.CalcCrossIslandPSF(ListIslands)
NIslands=len(ListIslands)
print>>log," grouping cross contaninating islands..."
print>>log," grouping cross contaminating islands..."

MaxIslandFlux=np.zeros((NIslands,),np.float32)
DicoIsland={}
Expand Down
16 changes: 8 additions & 8 deletions DDFacet/Imager/SSD/ClassModelMachineSSD.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def FromFile(self,FileName):


def FromDico(self,DicoSMStacked):
print>>log, "Reading dico model from dico with %i componants"%len(DicoSMStacked["Comp"])
print>>log, "Reading dico model from dico with %i components"%len(DicoSMStacked["Comp"])
#self.PM=self.DicoSMStacked["PM"]
self.DicoSMStacked=DicoSMStacked
self.RefFreq=self.DicoSMStacked["RefFreq"]
Expand Down Expand Up @@ -367,7 +367,7 @@ def GiveSpectralIndexMap(self, threshold=0.1, save_dict=True):


def RemoveNegComponants(self):
print>>log, "Cleaning model dictionary from negative componants"
print>>log, "Cleaning model dictionary from negative components"
ModelImage=self.GiveModelImage(self.DicoSMStacked["RefFreq"])[0,0]

Lx,Ly=np.where(ModelImage<0)
Expand All @@ -377,10 +377,10 @@ def RemoveNegComponants(self):
try:
del(self.DicoSMStacked["Comp"][key])
except:
print>>log, " Componant at (%i, %i) not in dict "%key
print>>log, " Component at (%i, %i) not in dict "%key

def FilterNegComponants(self,box=20,sig=3,RemoveNeg=True):
print>>log, "Cleaning model dictionary from negative componants with (box, sig) = (%i, %i)"%(box,sig)
print>>log, "Cleaning model dictionary from negative components with (box, sig) = (%i, %i)"%(box,sig)
ModelImage=self.GiveModelImage(self.DicoSMStacked["RefFreq"])[0,0]

Min=scipy.ndimage.filters.minimum_filter(ModelImage,(box,box))
Expand All @@ -390,18 +390,18 @@ def FilterNegComponants(self,box=20,sig=3,RemoveNeg=True):
if RemoveNeg==False:
Lx,Ly=np.where((ModelImage<sig*Min)&(ModelImage!=0))
else:
print>>log, " Removing neg componants too"
print>>log, " Removing neg components too"
Lx,Ly=np.where( ((ModelImage<sig*Min)&(ModelImage!=0)) | (ModelImage<0))

for icomp in range(Lx.size):
key=Lx[icomp],Ly[icomp]
try:
del(self.DicoSMStacked["Comp"][key])
except:
print>>log, " Componant at (%i, %i) not in dict "%key
print>>log, " Component at (%i, %i) not in dict "%key

def CleanMaskedComponants(self,MaskName):
print>>log, "Cleaning model dictionary from masked componants using %s"%(MaskName)
print>>log, "Cleaning model dictionary from masked components using %s"%(MaskName)
im=image(MaskName)
MaskArray=im.getdata()[0,0].T[::-1]
for (x,y) in self.DicoSMStacked["Comp"].keys():
Expand Down Expand Up @@ -492,7 +492,7 @@ def PutBackSubsComps(self):
#RestoreDico=self.GD["Data"]["RestoreDico"]
RestoreDico=DicoSolsFile["ModelName"][()][0:-4]+".DicoModel"

print>>log, "Adding previously substracted components"
print>>log, "Adding previously subtracted components"
ModelMachine0=ClassModelMachine(self.GD)


Expand Down

0 comments on commit f12956d

Please sign in to comment.