Skip to content

Commit

Permalink
implemented stall checks
Browse files Browse the repository at this point in the history
  • Loading branch information
o-smirnov committed Jun 22, 2017
1 parent 8373736 commit d96b878
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions DDFacet/Imager/MSMF/ClassImageDeconvMachineMSMF.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,12 +609,15 @@ def Deconvolve(self, ch=0, UpdateRMS=True):
ThisFlux = abs(ThisFlux)
# in weighted or noisemap mode, look up the true max as well
trueMaxDirty = MaxDirty if self._peakMode is "normal" else ThisFlux
# return condition indicating cleaning is to be continued
cont = True

if self._previous_initial_peak is not None and abs(ThisFlux) > self.GD["HMP"]["MajorStallThreshold"]*self._previous_initial_peak:
print>>log,ModColor.Str("STALL! dirty image peak %10.6g Jy, was %10.6g at previous major cycle."
% (ThisFlux, self._previous_initial_peak), col="red")
print>>log,ModColor.Str(" will stop cleaning now")
return "Stall", False, False
print>>log,ModColor.Str("This will be the last major cycle")
cont = False

self._previous_initial_peak = abs(ThisFlux)
#x,y,MaxDirty=NpParallel.A_whereMax(self._MeanDirty.copy(),NCPU=1,DoAbs=DoAbs,Mask=self._MaskArray.copy())
#A=self._MeanDirty.copy()
Expand Down Expand Up @@ -756,7 +759,7 @@ def GivePercentDone(ThisMaxFlux):
(i, ThisPNR, ThisFlux), col="green")


cont = ThisFlux > self.FluxThreshold
cont = cont and ThisFlux > self.FluxThreshold
if not cont:
print>>log, ModColor.Str(
" [iter=%i] absolute flux threshold of %.3g Jy has been reached, PNR %.3g" %
Expand Down

0 comments on commit d96b878

Please sign in to comment.