Commits
Wataru Kawasaki authored 0f44433d120 Merge
322 322 | */ |
323 323 | returnRecord.define( RecordFieldId("cycleniter"), maxCycleIterations); |
324 324 | returnRecord.define( RecordFieldId("cyclethreshold"), cycleThreshold); |
325 325 | returnRecord.define( RecordFieldId("loopgain"), itsLoopGain); |
326 326 | returnRecord.define( RecordFieldId("thresholdreached"), thresholdReached); |
327 327 | returnRecord.define( RecordFieldId("nsigma"), itsNsigma); |
328 328 | |
329 329 | return returnRecord; |
330 330 | } |
331 331 | |
332 - | void SIIterBot_state::mergeCycleInitializationRecord(Record& initRecord){ |
332 + | void SIIterBot_state::mergeCycleInitializationRecord(const Record& initRecord){ |
333 333 | //FOR DEBUG - TT 2018/04/16 |
334 334 | LogIO os( LogOrigin("SIIterBot_state",__FUNCTION__,WHERE) ); |
335 335 | std::lock_guard<std::recursive_mutex> guard(recordMutex); |
336 336 | |
337 337 | itsPeakResidual = max( itsPeakResidual, |
338 338 | initRecord.asFloat(RecordFieldId("peakresidual")) ); |
339 339 | itsMaxPsfSidelobe = max( itsMaxPsfSidelobe, initRecord.asFloat(RecordFieldId("maxpsfsidelobe")) ); |
340 340 | |
341 341 | itsPeakResidualNoMask = max( itsPeakResidualNoMask, initRecord.asFloat(RecordFieldId("peakresidualnomask"))); |
342 342 | itsMadRMS = max( itsMadRMS, initRecord.asFloat(RecordFieldId("madrms")) ); |
367 367 | if ( itsMaskSum == -1.0 ) itsMaskSum = thismasksum; |
368 368 | else itsMaskSum += thismasksum; |
369 369 | } |
370 370 | |
371 371 | if ( itsPrevPeakResidual == -1.0 ) itsPrevPeakResidual = itsPeakResidual; |
372 372 | if ( itsPrevPeakResidualNoMask == -1.0 ) itsPrevPeakResidualNoMask = itsPeakResidualNoMask; |
373 373 | |
374 374 | } |
375 375 | |
376 376 | |
377 - | void SIIterBot_state::mergeCycleExecutionRecord( Record& execRecord ){ |
377 + | void SIIterBot_state::mergeCycleExecutionRecord(const Record& execRecord ){ |
378 378 | std::lock_guard<std::recursive_mutex> guard(recordMutex); |
379 379 | |
380 380 | LogIO os( LogOrigin("SIIterBot_state",__FUNCTION__,WHERE) ); |
381 381 | |
382 382 | mergeMinorCycleSummary( execRecord.asArrayDouble( RecordFieldId("summaryminor")) ); |
383 383 | |
384 384 | itsIterDone += execRecord.asInt(RecordFieldId("iterdone")); |
385 385 | |
386 386 | itsMaxCycleIterDone = max( itsMaxCycleIterDone, execRecord.asInt(RecordFieldId("maxcycleiterdone")) ); |
387 387 | |
720 720 | void SIIterBot_state::changeMaxPsfFraction( Float maxpsffraction ) { |
721 721 | std::lock_guard<std::recursive_mutex> guard(recordMutex); |
722 722 | itsMaxPsfFraction = maxpsffraction; |
723 723 | } |
724 724 | |
725 725 | void SIIterBot_state::changeNsigma( Float nsigma) { |
726 726 | std::lock_guard<std::recursive_mutex> guard(recordMutex); |
727 727 | itsNsigma = nsigma; |
728 728 | } |
729 729 | |
730 - | void SIIterBot_state::setControlsFromRecord( Record &recordIn ) { |
730 + | void SIIterBot_state::setControlsFromRecord(const Record &recordIn ) { |
731 731 | LogIO os( LogOrigin("SIIterBot_state",__FUNCTION__,WHERE) ); |
732 732 | std::lock_guard<std::recursive_mutex> guard(recordMutex); |
733 733 | |
734 734 | /* Note it is important that niter get set first as we catch |
735 735 | negative values in the cycleniter, and set it equal to niter */ |
736 736 | if (recordIn.isDefined("niter")) |
737 737 | changeNiter(recordIn.asInt( RecordFieldId("niter"))); |
738 738 | |
739 739 | if (recordIn.isDefined("cycleniter")) |
740 740 | changeCycleNiter(recordIn.asInt( RecordFieldId("cycleniter"))); |