casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SDAlgorithmBase.h
Go to the documentation of this file.
1 //# SDAlgorithmBase.h: Definition for SDAlgorithmBase
2 //# Copyright (C) 1996,1997,1998,1999,2000,2002
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be adressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
27 //# $Id$
28 
29 #ifndef SYNTHESIS_SDALGORITHMBASE_H
30 #define SYNTHESIS_SDALGORITHMBASE_H
31 
33 //#include <synthesis/MeasurementComponents/SkyModel.h>
34 #include <casa/Arrays/Matrix.h>
39 #include <casa/Logging/LogSink.h>
40 #include <casa/System/PGPlotter.h>
41 
42 #include <casa/aips.h>
45 #include <casa/BasicSL/String.h>
47 
51 
52 namespace casa { //# NAMESPACE CASA - BEGIN
53 
54  /* Forware Declaration */
55  class SIMinorCycleController;
56 
57 
59 public:
60 
61  // Empty constructor
63  virtual ~SDAlgorithmBase();
64 
65  // Non virtual. Wrapper function implemented only in the base class.
66  void deconvolve( SIMinorCycleController& loopController,
67  std::shared_ptr<SIImageStore> &imagestore,
68  casacore::Int deconvolverid,
69  casacore::Bool isautomasking=false,
70  //casacore::Bool fastnoise=true);
71  casacore::Bool fastnoise=true,
72  casacore::Record robuststats=casacore::Record());
73 
75  // void setMaskOptions( casacore::String maskstring );
76 
77  // Base Class contains standard restoration. Overload for more complex behaviour.
78  virtual void restore( std::shared_ptr<SIImageStore> imagestore );
79  virtual void pbcor( std::shared_ptr<SIImageStore> imagestore );
80 
82 
83  virtual casacore::uInt getNTaylorTerms(){return 1;};
85  virtual casacore::Long estimateRAM(const std::vector<int>& imsize);
86 protected:
87 
88  // Pure virtual functions to be implemented by various algorithm deconvolvers.
89  virtual void takeOneStep( casacore::Float loopgain, casacore::Int cycleNiter, casacore::Float cycleThreshold,
90  casacore::Float &peakresidual, casacore::Float &modelflux, casacore::Int& iterdone )=0;
91  // virtual void initializeDeconvolver( casacore::Float &peakresidual, casacore::Float &modelflux )=0;
92  virtual void initializeDeconvolver()=0;
93  virtual void finalizeDeconvolver()=0;
94 
95  // Base Class implements the option of single-plane images for the minor cycle.
96  virtual void queryDesiredShape(casacore::Int &nchanchunks, casacore::Int& npolchunks, casacore::IPosition imshape);
97 
98 
99  // Non virtual. Implemented only in the base class.
100  casacore::Int checkStop( SIMinorCycleController &loopcontrols, casacore::Float currentresidual );
103  casacore::Float& maxAbs,casacore::IPosition& posMaxAbs);
104 
105  // Algorithm name
107 
108  std::shared_ptr<SIImageStore> itsImages; //sOriginalImages;
109 
110  // casacore::Vector<casacore::Slicer> itsDecSlices;
111  // casacore::SubImage<casacore::Float> itsResidual, itsPsf, itsModel, itsImage;
112 
116 
118  //casacore::Array<casacore::Float> itsMatMask;
119 
122  // casacore::String itsMaskString;
123  // casacore::Bool itsIsMaskLoaded; // Annoying state variable. Remove if possible.
124 
125 };
126 
127 } //# NAMESPACE CASA - END
128 
129 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
int Int
Definition: aipstype.h:50
void deconvolve(SIMinorCycleController &loopController, std::shared_ptr< SIImageStore > &imagestore, casacore::Int deconvolverid, casacore::Bool isautomasking=false, casacore::Bool fastnoise=true, casacore::Record robuststats=casacore::Record())
Non virtual.
virtual void initializeDeconvolver()=0
virtual void initializeDeconvolver(casacore::Float &amp;peakresidual, casacore::Float &amp;modelflux)=0; ...
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
casacore::IPosition itsMaxPos
casacore::Vector&lt;casacore::Slicer&gt; itsDecSlices; casacore::SubImage&lt;casacore::Float&gt; itsResidual...
casacore::GaussianBeam itsRestoringBeam
casacore::Array&lt;casacore::Float&gt; itsMatMask;
virtual casacore::uInt getNTaylorTerms()
virtual void finalizeDeconvolver()=0
Represents a Gaussian restoring beam associated with an image.
Definition: GaussianBeam.h:68
casacore::Float itsModelFlux
virtual casacore::Long estimateRAM(const std::vector< int > &imsize)
returns the estimate of memory used in kilobytes (kB);
long Long
Definition: aipstype.h:52
virtual void takeOneStep(casacore::Float loopgain, casacore::Int cycleNiter, casacore::Float cycleThreshold, casacore::Float &peakresidual, casacore::Float &modelflux, casacore::Int &iterdone)=0
Pure virtual functions to be implemented by various algorithm deconvolvers.
casacore::String itsUseBeam
std::shared_ptr< SIImageStore > itsImages
SDAlgorithmBase()
Empty constructor.
virtual casacore::String getAlgorithmName()
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
casacore::Bool findMaxAbs(const casacore::Array< casacore::Float > &lattice, casacore::Float &maxAbs, casacore::IPosition &posMaxAbs)
SDMaskHandler itsMaskHandler
float Float
Definition: aipstype.h:54
virtual void queryDesiredShape(casacore::Int &nchanchunks, casacore::Int &npolchunks, casacore::IPosition imshape)
Base Class implements the option of single-plane images for the minor cycle.
casacore::String itsAlgorithmName
Algorithm name.
casacore::Bool findMaxAbsMask(const casacore::Array< casacore::Float > &lattice, const casacore::Array< casacore::Float > &mask, casacore::Float &maxAbs, casacore::IPosition &posMaxAbs)
virtual void restore(std::shared_ptr< SIImageStore > imagestore)
void setMaskOptions(casacore::String maskstring);
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Float itsPeakResidual
virtual ~SDAlgorithmBase()
void setRestoringBeam(casacore::GaussianBeam restbeam, casacore::String usebeam)
casacore::Int checkStop(SIMinorCycleController &loopcontrols, casacore::Float currentresidual)
Non virtual.
unsigned int uInt
Definition: aipstype.h:51
virtual void pbcor(std::shared_ptr< SIImageStore > imagestore)