casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIMapperCollection.h
Go to the documentation of this file.
1 //# SIMapperCollection.h: Imager functionality sits here;
2 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003
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 addressed 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 //#
25 //# $Id$
26 
27 #ifndef SYNTHESIS_SIMAPPERCOLLECTION_H
28 #define SYNTHESIS_SIMAPPERCOLLECTION_H
29 
30 #include <casa/aips.h>
31 #include <casa/OS/Timer.h>
32 #include <casa/Containers/Record.h>
34 #include <casa/Arrays/IPosition.h>
35 #include <casa/Quanta/Quantum.h>
37 
40 
41 namespace casa { //# NAMESPACE CASA - BEGIN
42 
44 {
45  public:
46  // Default constructor
47 
50 
54 
55  /* // No need for now.
56  // Write this function only if we need to support multiple facets on outlier fields too.
57  // In that case, hold a list of original ImageStores and a map to the list of Mappers
58  // to keep track of which original image points to which subset of the Mapper list.
59  // Also add code into "finalizeGrid" to copy only one PSF to the original.
60  void addMapper( casacore::Int mapperId,
61  casacore::String mapperType,
62  casacore::uInt nTaylorTerms,
63  casacore::CountedPtr<FTMachine> ftm,
64  casacore::CountedPtr<FTMachine> iftm,
65  casacore::String imageName,
66  casacore::CoordinateSystem& cSys,
67  casacore::IPosition imShape,
68  const casacore::Bool overwrite );
69  */
70  void initializeGrid(vi::VisBuffer2& vb, casacore::Bool dopsf=false,const casacore::Int mapperid=-1);
72  void initializeGrid(vi::VisibilityIterator2& vi, casacore::Bool dopsf=false, const casacore::Int mapperid=-1);
74  const casacore::Int mapperid=-1);
75  void finalizeGrid(vi::VisBuffer2& vb, casacore::Bool dopsf=false,const casacore::Int mapperid=-1);
76  void initializeDegrid(vi::VisBuffer2& vb,const casacore::Int mapperid=-1);
77  void degrid(vi::VisBuffer2& vb, casacore::Bool saveVirtualMod=false,const casacore::Int mapperid=-1);
79  void finalizeDegrid(vi::VisBuffer2& vb,const casacore::Int mapperid=-1);
80  void addPB(vi::VisBuffer2& vb, PBMath& pbMath, const casacore::MDirection& altDir=casacore::MDirection(), const casacore::Bool useAltDir=False);
81 
83  void initializeGrid(VisBuffer& vb, casacore::Bool dopsf=false,const casacore::Int mapperid=-1);
85  const casacore::Int mapperid=-1);
86  void finalizeGrid(VisBuffer& vb, casacore::Bool dopsf=false,const casacore::Int mapperid=-1);
87  void initializeDegrid(VisBuffer& vb,const casacore::Int mapperid=-1);
88  void degrid(VisBuffer& vb, casacore::Bool saveVirtualMod=false,const casacore::Int mapperid=-1);
89  void saveVirtualModel(VisBuffer& vb);
90  void finalizeDegrid(VisBuffer& vb,const casacore::Int mapperid=-1);
91  void addPB(VisBuffer& vb, PBMath& pbMath);
94 
97 
98  void checkOverlappingModels(casacore::String action); // action='blank' or 'restore'
99 
101 
103  {
104  AlwaysAssert(which>=0 && which<(casacore::Int)itsMappers.nelements(),casacore::AipsError);
105  return itsMappers[which]->getFTM(ift);
106  };
108  {
109  AlwaysAssert(which>=0 && which<(casacore::Int)itsMappers.nelements(),casacore::AipsError);
110  return itsMappers[which]->getFTM2(ift);
111  };
112 
113 
114  void initPB();
115 
117  {AlwaysAssert(which>=0 && which<(casacore::Int)itsMappers.nelements(),casacore::AipsError);
118  return itsMappers[which];};
119  virtual casacore::Long estimateRAM();
120 
121 protected:
122 
124 
127 
129 
130 };
131 
132 
133 } //# NAMESPACE CASA - END
134 
135 #endif
casacore::Int nMappers()
A Measure: astronomical direction.
Definition: MDirection.h:174
int Int
Definition: aipstype.h:50
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
void addPB(vi::VisBuffer2 &vb, PBMath &pbMath, const casacore::MDirection &altDir=casacore::MDirection(), const casacore::Bool useAltDir=False)
void initializeDegrid(vi::VisBuffer2 &vb, const casacore::Int mapperid=-1)
void finalizeDegrid(vi::VisBuffer2 &vb, const casacore::Int mapperid=-1)
Primary beam envelope class, derived from PBMathInterface.
Definition: PBMath.h:126
const casacore::CountedPtr< SIMapper > getMapper(casacore::Int which)
const casacore::CountedPtr< FTMachine > getFTM(casacore::Int which, const casacore::Bool ift=true)
casacore::Bool anyNonZeroModels()
*void initializeGrid(vi::VisBuffer2 &vb, casacore::Bool dopsf=false, const casacore::Int mapperid=-1)
long Long
Definition: aipstype.h:52
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
const casacore::CountedPtr< refim::FTMachine > & getFTM2(casacore::Int which, const casacore::Bool ift=true)
void degrid(vi::VisBuffer2 &vb, casacore::Bool saveVirtualMod=false, const casacore::Int mapperid=-1)
casacore::Vector< casacore::String > getImageNames()
*casacore::Block< casacore::CountedPtr< SIMapper > > itsMappers
Type
Types of known Images that may be made using the makeImage method.
Definition: FTMachine.h:127
Type
Types of known Images that may be made using the makeImage method.
Definition: FTMachine.h:125
void saveVirtualModel(vi::VisBuffer2 &vb)
#define AlwaysAssert(expr, exception)
These marcos are provided for use instead of simply using the constructors of assert_ to allow additi...
Definition: Assert.h:157
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
void grid(vi::VisBuffer2 &vb, casacore::Bool dopsf=false, refim::FTMachine::Type col=refim::FTMachine::CORRECTED, const casacore::Int mapperid=-1)
void finalizeGrid(vi::VisBuffer2 &vb, casacore::Bool dopsf=false, const casacore::Int mapperid=-1)
const Bool False
Definition: aipstype.h:44
SIMapperCollection()
Default constructor.
simple 1-D array
virtual casacore::Long estimateRAM()
VisBuffer2s encapsulate one chunk of visibility data for processing.
Definition: VisBuffer2.h:141
Base class for all Casacore library errors.
Definition: Error.h:134
casacore::Bool releaseImageLocks()
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void addMapper(casacore::CountedPtr< SIMapper > map)
VisBuffers encapsulate one chunk of visibility data for processing.
Definition: VisBuffer.h:153
void checkOverlappingModels(casacore::String action)
casacore::CountedPtr< SIImageStore > imageStore(const casacore::Int id=0)
casacore::Record getFTMRecord(casacore::Int mapperid)