casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConvFuncDiskCache.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //# ConvFuncDiskCache.cc: Definition of the ConvFuncDiskCache class
3 //# Copyright (C) 1997,1998,1999,2000,2001,2002,2003
4 //# Associated Universities, Inc. Washington DC, USA.
5 //#
6 //# This library is free software; you can redistribute it and/or modify it
7 //# under the terms of the GNU Library General Public License as published by
8 //# the Free Software Foundation; either version 2 of the License, or (at your
9 //# option) any later version.
10 //#
11 //# This library is distributed in the hope that it will be useful, but WITHOUT
12 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 //# License for more details.
15 //#
16 //# You should have received a copy of the GNU Library General Public License
17 //# along with this library; if not, write to the Free Software Foundation,
18 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19 //#
20 //# Correspondence concerning AIPS++ should be addressed as follows:
21 //# Internet email: aips2-request@nrao.edu.
22 //# Postal address: AIPS++ Project Office
23 //# National Radio Astronomy Observatory
24 //# 520 Edgemont Road
25 //# Charlottesville, VA 22903-2475 USA
26 //#
27 //# $Id$
28 #ifndef SYNTHESIS_CONVFUNCDISKCACHE_H
29 #define SYNTHESIS_CONVFUNCDISKCACHE_H
30 
31 #include <casa/Arrays/Matrix.h>
32 #include <msvis/MSVis/VisBuffer.h>
35 #include <casa/Arrays/Array.h>
36 #include <casa/Arrays/Vector.h>
41 // Apparently not required here? (gmoellen 06Nov20)
42 //#include <synthesis/MeasurementComponents/EPTimeVarVisJones.h>
44 namespace casa { //# NAMESPACE CASA - BEGIN
45  // <summary>
46  //
47  // An object to manage the caches of pre-computed convolution
48  // functions on the disk and in the memory.
49  //
50  // </summary>
51 
52  // <use visibility=export>
53 
54  // <reviewed reviewer="" date="" tests="" demos="">
55 
56  // <prerequisite>
57  // No pre-requisites.
58  // </prerequisite>
59  //
60  // <etymology>
61  //
62  // ConvFuncDiskCache is an object, to write convolution
63  // functions from the memory cache to the disk cache, and
64  // search/load the disk cache for convolution functions for a give
65  // Parallactic Angle.
66  //
67  //</etymology>
68  //
69  // <synopsis>
70  //
71  // FTMachines uses pre-computed convolution functions for gridding
72  // (FTMachine::put()) and prediction (FTMachine::get()). For
73  // <linkto class=PBWProjectFT>PBWProjectFT</linkto>, the convolution
74  // function computation is expensive. Once computed, it is
75  // efficient to cache these functions as a function of Parallactic
76  // Angle and the value of the w-term (if significant).
77  //
78  // ConvFuncDiskCache class provides interface to the disk cache and
79  // is used in <linkto class=PBWProjectFT>PBWProjectFT</linkto> to
80  // search and load convolution functions from the disk. If a new
81  // convolution function is computed in <linkto
82  // class=PBWProjectFT>PBWProjectFT</linkto>, the disk cache is
83  // updated using the services of this class as well.
84  //
85  // </synopsis>
86  //
87  // <example>
88  // </example>
89  //
90  // <motivation>
91  //
92  // Factor out the code for managing convolution function caches
93  // (memory and disk caches) from the FTMachine code. This is a
94  // specialized service, and has nothing to do with the details of
95  // gridding and prediction of visibilities (which is the function of
96  // FTMachines).
97  //
98  // </motivation>
99  //
100  // <todo asof="2005/07/21">
101  //
102  // <ul> Generalize to handle convolution functions for inhomogeneous
103  // arrays and multi-feed antennas.
104  //
105  // </todo>
106 
108  {
109  public:
110  ConvFuncDiskCache():paList(),XSup(),YSup(), cfPrefix("CF"), aux("aux.dat") {};
113  void setCacheDir(const char *dir) {Dir = dir;}
114  void initCache();
116  casacore::CoordinateSystem& ftcoords, casacore::Int& convSize, casacore::Cube<casacore::Int>& convSupport,
117  casacore::Float convSampling, casacore::String nameQualifier="",casacore::Bool savePA=true);
119  casacore::Int& convSize, casacore::Cube<casacore::Int>& convSupport, casacore::Float convSampling);
122  casacore::Int& which, casacore::Float &pa);
125  casacore::Double& cfRefFreq,casacore::CoordinateSystem& coordys, casacore::String prefix="/CF");
126  void finalize();
129  private:
133  };
134 }
135 
136 #endif
int Int
Definition: aipstype.h:50
void cacheConvFunction(casacore::Int which, casacore::Float pa, casacore::Array< casacore::Complex > &cf, casacore::CoordinateSystem &coords, casacore::CoordinateSystem &ftcoords, casacore::Int &convSize, casacore::Cube< casacore::Int > &convSupport, casacore::Float convSampling, casacore::String nameQualifier="", casacore::Bool savePA=true)
casacore::Bool loadConvFunction(casacore::Int where, casacore::Int Nx, casacore::PtrBlock< casacore::Array< casacore::Complex > * > &convFuncCache, casacore::Cube< casacore::Int > &convSupport, casacore::Vector< casacore::Float > &convSampling, casacore::Double &cfRefFreq, casacore::CoordinateSystem &coordys, casacore::String prefix="/CF")
casacore::Cube< casacore::Int > YSup
casacore::Vector< casacore::Float > Sampling
void setCacheDir(const char *dir)
Model the diagonal elements of the Voltage Pattern Sky Jones Matrices.
Definition: VPSkyJones.h:91
casacore::Cube< casacore::Int > XSup
LatticeExprNode pa(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds 180/pi*atan2(left,right)/2.
double Double
Definition: aipstype.h:55
void cacheWeightsFunction(casacore::Int which, casacore::Float pa, casacore::Array< casacore::Complex > &cfWt, casacore::CoordinateSystem &coords, casacore::Int &convSize, casacore::Cube< casacore::Int > &convSupport, casacore::Float convSampling)
casacore::Bool searchConvFunction(const VisBuffer &vb, VPSkyJones &vpSJ, casacore::Int &which, casacore::Float &pa)
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
float Float
Definition: aipstype.h:54
//////////////////////////////////////////////////////////////////////////
Definition: Utils.h:184
An object to manage the caches of pre-computed convolution functions on the disk and in the memory...
casacore::Vector< casacore::Float > paList
A drop-in replacement for Block&lt;T*&gt;.
Definition: WProjectFT.h:54
ConvFuncDiskCache & operator=(const ConvFuncDiskCache &other)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
VisBuffers encapsulate one chunk of visibility data for processing.
Definition: VisBuffer.h:153
void loadAvgPB(casacore::ImageInterface< casacore::Float > &avgPB)
Interconvert pixel and world coordinates.