Source
252
252
253
253
//re-calculate current nsigma threhold
254
254
//os<<"Calling calcRobustRMS ....syndeconv."<<LogIO::POST;
255
255
Float nsigmathresh = 0.0;
256
256
Bool useautomask = ( itsAutoMaskAlgorithm=="multithresh" ? true : false);
257
257
Int iterdone = itsLoopController.getIterDone();
258
258
if ( itsNsigma >0.0 ) {
259
259
itsMaskHandler->setPBMaskLevel(itsPBMask);
260
260
Array<Double> medians, robustrms;
261
261
// 2 cases to use existing stats.
262
-
// 1. automask has run with fastnoise=True and the image statistics record has filled
263
-
// (if fastnoise=False, the stats depends on mask so it needs to be recalculated ?) or
262
+
// 1. automask has run and so the image statistics record has filled
263
+
// or
264
264
// 2. no automask but for the first cycle but already initial calcRMS has ran to avoid duplicate
265
-
//
266
-
//os<<" useautomask="<<useautomask<<" itsFastNoise="<<itsFastNoise<<" itsRobustStats.nfields()="<<itsRobustStats.nfields()<<LogIO::POST;
267
-
if ((useautomask && itsFastNoise && itsRobustStats.nfields()) ||
265
+
//
266
+
if ((useautomask && itsRobustStats.nfields()) ||
268
267
(!useautomask && iterdone==0 && itsRobustStats.nfields()) ) {
269
268
os <<LogIO::DEBUG1<<"automask on: check the current stats"<<LogIO::POST;
270
269
//os<< "itsRobustStats nfield="<< itsRobustStats.nfields() << LogIO::POST;;
271
270
if (itsRobustStats.isDefined("medabsdevmed")) {
272
271
Array<Double> mads;
273
272
itsRobustStats.get(RecordFieldId("medabsdevmed"), mads);
274
-
os<<LogIO::DEBUG1<<"Using mad from automask ="<< mads <<LogIO::POST;
275
-
os<<LogIO::DEBUG1<<"converted robust rms from automask ="<< mads*1.4826 <<LogIO::POST;
273
+
os<<LogIO::DEBUG1<<"Using robust rms from automask ="<< mads*1.4826 <<LogIO::POST;
276
274
robustrms = mads*1.4826;
277
275
}
278
276
else if(itsRobustStats.isDefined("robustrms")) {
279
277
itsRobustStats.get(RecordFieldId("robustrms"), robustrms);
280
278
}
281
279
itsRobustStats.get(RecordFieldId("median"), medians);
282
280
283
281
}
284
282
else { // do own stats calculation
285
283
timer.mark();