casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIMinorCycleController.h
Go to the documentation of this file.
1 //# SISubterBot.h: This file contains the interface definition SISubIterBot class
2 //#
3 //# CASA - Common Astronomy Software Applications (http://casa.nrao.edu/)
4 //# Copyright (C) Associated Universities, Inc. Washington DC, USA 2011, All rights reserved.
5 //# Copyright (C) European Southern Observatory, 2011, All rights reserved.
6 //#
7 //# This library is free software; you can redistribute it and/or
8 //# modify it under the terms of the GNU Lesser General Public
9 //# License as published by the Free software Foundation; either
10 //# version 2.1 of the License, or (at your option) any later version.
11 //#
12 //# This library is distributed in the hope that it will be useful,
13 //# but WITHOUT ANY WARRANTY, without even the implied warranty of
14 //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 //# Lesser General Public License for more details.
16 //#
17 //# You should have received a copy of the GNU Lesser General Public
18 //# License along with this library; if not, write to the Free Software
19 //# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 //# MA 02111-1307 USA
21 //# $Id: $
22 
23 #ifndef SYNTHESIS_MINORCYCLECONTROLLER
24 #define SYNTHESIS_MINORCYCLECONTROLLER
25 
26 // .casarc interface
28 
29 // System utilities (for profiling macros)
30 #include <casa/OS/HostInfo.h>
31 #include <sys/time.h>
32 
33 
34 // Include files for the DBus Service
35 //#include <casadbus/interfaces/SynthImager.adaptor.h>
36 
37 namespace casacore{
38 
39  class Record;
40 }
41 
42 namespace casa { //# NAMESPACE CASA - BEGIN
43 
44 
46  {
47  public:
48 
49  // make noncopyable...
53 
54  virtual ~SIMinorCycleController();
55 
56  /* Method to call to determine if a major cycle is required, true if
57  - exceeded number maxcycleniter
58  - exceeded cycle threshold
59  */
60  virtual casacore::Int majorCycleRequired(casacore::Float currentPeakResidual);
61 
62  /* This method sets the following controls for the Minor Cycle Controller:
63  - niter
64  - cycleniter
65  - interactiveniter?
66  - threshold
67  - cyclethreshold
68  - interactive theshold?
69  - loop gain
70  - cycle factor
71  */
73 
74  /* Get Cycle Execution casacore::Data:
75  Returns information about the set of cycles just executed:
76  - iterdone
77  - maxcycleiterdone
78  - updated model flag
79  - peak residual
80  - minor cycle summary
81  */
83 
84 
85  /* Get Initialization Data
86  Returns information at the beginning of a cycle:
87  - peak residual
88  - maxPSFSidelobe
89  */
91 
92  /* Getter Methods for the control variables */
94 
95  void incrementMinorCycleCount(casacore::Int itersDonePerStep=1);
96 
101 
103 
104  /* This method resets the iteration counter for the cycle */
105  void resetCycleIter();
106 
107  /* Flag to note that the model has been updated */
108  void setUpdatedModelFlag(casacore::Bool updatedmodel);
109 
110  void addSummaryMinor(casacore::uInt deconvolverid, casacore::uInt subimageid, casacore::Float model, casacore::Float peakresidual);
111 
112  /* Variables to track status inside each Deconvolver */
116 
117  /* user input for n-sigma */
119 
120  void setPeakResidual(casacore::Float peakResidual);
121  void setPeakResidualNoMask(casacore::Float peakResidual);
122  void addIntegratedFlux(casacore::Float integratedFlux);
123  void setMaxPsfSidelobe(casacore::Float maxPsfSidelobe);
124  void setMadRMS(casacore::Float madRMS);
125  void setNsigmaThreshold(casacore::Float nsigmaThreshold);
126  void setMaskSum(casacore::Float maskSum);
127  void setNsigma(casacore::Float nsigma);
128 
129  void setPBMask(casacore::Float pbMaskLevel);
130 
131  void resetMinResidual();
132 
133  protected:
134  /* Control Variables */
140 
142 
143  /* Status Reporting Variables */
144  casacore::Int itsIterDone; // Iterations done during this set of cycles
145  casacore::Int itsCycleIterDone; // Iterations done on this subimage
146  casacore::Int itsIterDiff; // Difference between latest and previous count, to catch zero increments.
147 
148  /* Useful only for reporting */
149  casacore::Int itsTotalIterDone; // Total iterations done by deconvolver
150 
151  /* This variable keeps track of the maximum number of iterations done
152  during a major cycle */
154 
158 
165 
167 
168  /* Summary Variable */
171  casacore::Int itsDeconvolverID; /* An ID per Deconvolver. Used only for the summary */
172  };
173 
174 
175 } //# NAMESPACE CASA - END
176 
177 #endif /* SISUBITERBOT_H_ */
void addSummaryMinor(casacore::uInt deconvolverid, casacore::uInt subimageid, casacore::Float model, casacore::Float peakresidual)
void incrementMinorCycleCount(casacore::Int itersDonePerStep=1)
casacore::Bool isThresholdReached()
int Int
Definition: aipstype.h:50
casacore::Int getCycleNiter()
void addIntegratedFlux(casacore::Float integratedFlux)
void setNsigmaThreshold(casacore::Float nsigmaThreshold)
void setUpdatedModelFlag(casacore::Bool updatedmodel)
void setPeakResidualNoMask(casacore::Float peakResidual)
void setCycleControls(casacore::Record &)
casacore::Record getCycleExecutionRecord()
casacore::Float getIntegratedFlux()
casacore::Float getPeakResidual()
casacore::Float getNsigma()
void setNsigma(casacore::Float nsigma)
void setMadRMS(casacore::Float madRMS)
casacore::Array< casacore::Double > itsSummaryMinor
casacore::Float getCycleThreshold()
casacore::Float getMaxPsfSidelobe()
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
float Float
Definition: aipstype.h:54
casacore::Record getCycleInitializationRecord()
void setPeakResidual(casacore::Float peakResidual)
casacore::Float getLoopGain()
void setMaskSum(casacore::Float maskSum)
void setMaxPsfSidelobe(casacore::Float maxPsfSidelobe)
SIMinorCycleController & operator=(const SIMinorCycleController &)=delete
virtual casacore::Int majorCycleRequired(casacore::Float currentPeakResidual)
casacore::Float getPBMask()
unsigned int uInt
Definition: aipstype.h:51
void setPBMask(casacore::Float pbMaskLevel)
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42