00001 //# SynthesisDeconvolver.h: Imager functionality sits here; 00002 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# 00025 //# $Id$ 00026 00027 #ifndef SYNTHESIS_SYNTHESISDECONVOLVER_H 00028 #define SYNTHESIS_SYNTHESISDECONVOLVER_H 00029 00030 #include <casa/aips.h> 00031 #include <casa/OS/Timer.h> 00032 #include <casa/Containers/Record.h> 00033 #include <ms/MeasurementSets/MeasurementSet.h> 00034 #include <casa/Arrays/IPosition.h> 00035 #include <casa/Quanta/Quantum.h> 00036 #include <measures/Measures/MDirection.h> 00037 00038 #include<synthesis/ImagerObjects/SDAlgorithmBase.h> 00039 #include<synthesis/ImagerObjects/SDAlgorithmHogbomClean.h> 00040 #include<synthesis/ImagerObjects/SDAlgorithmClarkClean.h> 00041 #include<synthesis/ImagerObjects/SDAlgorithmClarkClean2.h> 00042 #include<synthesis/ImagerObjects/SDAlgorithmMSMFS.h> 00043 #include<synthesis/ImagerObjects/SDAlgorithmMSClean.h> 00044 #include<synthesis/ImagerObjects/SDAlgorithmMEM.h> 00045 #include<synthesis/ImagerObjects/SDAlgorithmAAspClean.h> 00046 00047 #include<synthesis/ImagerObjects/SDMaskHandler.h> 00048 #include <synthesis/ImagerObjects/SIMinorCycleController.h> 00049 00050 #include<synthesis/ImagerObjects/SynthesisUtilMethods.h> 00051 00052 namespace casa { //# NAMESPACE CASA - BEGIN 00053 00054 // Forward declarations 00055 class MeasurementSet; 00056 template<class T> class ImageInterface; 00057 00058 // <summary> Class that contains functions needed for imager </summary> 00059 00060 class SynthesisDeconvolver 00061 { 00062 public: 00063 // Default constructor 00064 00065 SynthesisDeconvolver(); 00066 ~SynthesisDeconvolver(); 00067 00068 // Copy constructor and assignment operator 00069 00070 // make all pure-inputs const 00071 00072 void setupDeconvolution(const SynthesisParamsDeconv& decpars); 00073 00074 // void setupDeconvolution(Record recpars); 00075 00076 Record initMinorCycle(); 00077 Record executeMinorCycle(Record& subIterBot); 00078 00079 Record interactiveGUI(Record& iterRec); 00080 00081 // Helpers 00082 /* 00083 Float getPeakResidual(); 00084 Float getModelFlux(); 00085 Float getPSFSidelobeLevel(); 00086 */ 00087 // Restoration (and post-restoration PB-correction) 00088 void restore(); 00089 void pbcor();// maybe add a way to take in arbitrary PBs here. 00090 00091 // For interaction 00092 void getCopyOfResidualAndMask( TempImage<Float> &/*residual*/, TempImage<Float>& /*mask*/ ); 00093 void setMask( TempImage<Float> &/*mask*/ ); 00094 00095 void setStartingModel(); 00096 void setupMask(); 00097 void setAutoMask(); 00098 00099 protected: 00100 00101 SHARED_PTR<SIImageStore> makeImageStore( String imagename ); 00102 /* 00103 void findMinMax(const Array<Float>& lattice, 00104 const Array<Float>& mask, 00105 Float& minVal, Float& maxVal, 00106 Float& minValMask, Float& maxValMask); 00107 00108 void printImageStats(); 00109 */ 00110 00111 // Gather all part images to the 'full' one 00112 //void gatherImages(); 00113 //void scatterModel(); 00114 00115 00116 // For the deconvolver, decide how many sliced deconvolution calls to make 00117 // Vector<Slicer> partitionImages(); 00118 00119 // Check if images exist on disk and are all the same shape 00120 //Bool setupImagesOnDisk(); 00121 // Bool doImagesExist( String imagename ); 00122 00124 00125 SHARED_PTR<SDAlgorithmBase> itsDeconvolver; 00126 SHARED_PTR<SDMaskHandler> itsMaskHandler; 00127 00128 SHARED_PTR<SIImageStore> itsImages; 00129 00130 IPosition itsImageShape; 00131 00132 String itsImageName; 00133 Vector<String> itsStartingModelNames; 00134 Bool itsAddedModel; 00135 00136 00137 Float itsBeam; 00138 00139 SIMinorCycleController itsLoopController; 00140 00142 00143 uInt itsDeconvolverId; 00144 Vector<Float> itsScales; 00145 00146 String itsMaskType; 00147 Vector<String> itsMaskList; 00148 String itsMaskString; 00149 Float itsPBMask; 00150 String itsAutoMaskAlgorithm; 00151 String itsMaskThreshold; 00152 Float itsFracOfPeak; 00153 String itsMaskResolution; 00154 Float itsMaskResByBeam; 00155 Int itsNMask; 00156 Bool itsAutoAdjust; 00157 Bool itsIsMaskLoaded; // Try to get rid of this state variable ! 00158 Bool itsIsInteractive; 00159 00160 }; 00161 00162 00163 } //# NAMESPACE CASA - END 00164 00165 #endif