casa
$Rev:20696$
|
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/MeasurementEquations/SDAlgorithmBase.h> 00039 #include<synthesis/MeasurementEquations/SDAlgorithmHogbomClean.h> 00040 #include<synthesis/MeasurementEquations/SDMaskHandler.h> 00041 #include <synthesis/MeasurementEquations/SIMinorCycleController.h> 00042 00043 namespace casa { //# NAMESPACE CASA - BEGIN 00044 00045 // Forward declarations 00046 class MeasurementSet; 00047 template<class T> class ImageInterface; 00048 00049 // <summary> Class that contains functions needed for imager </summary> 00050 00051 class SynthesisDeconvolver 00052 { 00053 public: 00054 // Default constructor 00055 00056 SynthesisDeconvolver(); 00057 ~SynthesisDeconvolver(); 00058 00059 // Copy constructor and assignment operator 00060 00061 // make all pure-inputs const 00062 void setupDeconvolution(Record recpars); 00063 00064 Record initMinorCycle(); 00065 Record executeMinorCycle(Record& subIterBot); 00066 00067 // Helpers 00068 Float getPeakResidual(); 00069 Float getModelFlux(); 00070 Float getPSFSidelobeLevel(); 00071 00072 // Restoration (and post-restoration PB-correction) 00073 void restore(); 00074 00075 // For interaction 00076 void getCopyOfResidualAndMask( TempImage<Float> &/*residual*/, TempImage<Float>& /*mask*/ ); 00077 void setMask( TempImage<Float> &/*mask*/ ); 00078 00079 void setStartingModel(Record modpars); 00080 00081 protected: 00082 00083 // Gather all part images to the 'full' one 00084 void gatherImages(); 00085 void scatterModel(); 00086 00087 // Normalize. This can later change to be more general, i.e. used for PB-correction too... 00088 void divideResidualByWeight(); 00089 void divideModelByWeight(); 00090 00091 // For the deconvolver, decide how many sliced deconvolution calls to make 00092 // Vector<Slicer> partitionImages(); 00093 00094 // Check if images exist on disk and are all the same shape 00095 Bool setupImagesOnDisk(); 00096 Bool doImagesExist( String imagename ); 00097 00099 00100 CountedPtr<SDAlgorithmBase> itsDeconvolver; 00101 CountedPtr<SDMaskHandler> itsMaskHandler; 00102 00103 CountedPtr<SIImageStore> itsImages; 00104 Vector<CountedPtr<SIImageStore> > itsPartImages; 00105 00106 IPosition itsImageShape; 00107 00108 String itsImageName; 00109 Vector<String> itsPartImageNames; 00110 String itsStartingModelName; 00111 00112 uInt itsDeconvolverId; 00113 00114 // Vector<Slicer> itsDecSlices; 00115 00116 // CountedPtr<PagedImage<Float> > itsImage, itsPsf, itsResidual, itsWeight; 00117 //CountedPtr<PagedImage<Float> > itsModel; 00118 //Vector<CountedPtr<PagedImage<Float> > > itsPartImages, itsPartPsfs, itsPartResiduals, itsPartWeights; 00119 00120 Float itsBeam; 00121 00122 SIMinorCycleController loopController; 00123 00125 00126 00127 }; 00128 00129 00130 } //# NAMESPACE CASA - END 00131 00132 #endif