casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalSolVi2Organizer.h
Go to the documentation of this file.
1 //# CalSolVi2Organizer.h: MS Meta info services in Calibraiton context
2 //# Copyright (C) 2016
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 
28 #ifndef SYNTHESIS_CALSOLVI2ORGANIZER_H
29 #define SYNTHESIS_CALSOLVI2ORGANIZER_H
30 
31 #include <casa/aips.h>
32 #include <casa/iostream.h>
33 #include <casa/BasicSL/String.h>
38 
39 
40 namespace casa { //# NAMESPACE CASA - BEGIN
41 
42 class VisEquation;
43 
45 
46 public:
47 
48  // Construct
50 
51  // Dtor
53 
54  int nLayers() const { return factories_.nelements(); };
55 
56  // Build and Return a reference to the fully-stacked VI
58 
59  // Count solutions
60  int countSolutions(casacore::Vector<int>& nChunkPerSolve);
61 
62  // Add disk-accesing layer factory
63  void addDiskIO(casacore::MeasurementSet* ms,float interval,
64  casacore::Bool combobs=false,casacore::Bool combscan=false,
65  casacore::Bool combfld=false,casacore::Bool combspw=false,
66  casacore::Bool useMSIter2=true,
67  std::shared_ptr<vi::FrequencySelections> freqSel=nullptr);
68 
69  // Add spoofed data layer factory
70  void addSimIO();
71  void addSimIO(const vi::SimpleSimVi2Parameters& ss);
72 
73  // Add calibrating layer factory (one way or another)
74  void addCalForSolving(float calfactor);
75  void addCalForSolving(VisEquation& ve);
76 
77  // Add chan-averaging layer factory
78  void addChanAve(casacore::Vector<int> chanbin);
79 
80  // Add time-averaging layer factory
81  void addTimeAve(float timebin);
82 
83  // Add calibration specific data filter
84  // config should have the following entries:
85  // "mode" (String) -- calibration mode (only "SDGAIN_OTFD" is supported)
86  // mode="SDGAIN_OTFD" configuration parameters
87  // "smooth" (Bool) -- apply smoothing or not (optional; default is False)
88  // "radius" (String) -- radius of the central region as a quantity string
89  // (optional; default is half of beam size)
90  void addCalFilter(casacore::Record const &config);
91 
92 private:
93 
94  void barf();
95 
96  // Add a factory to the internal list
98 
99  // Delete everything
100  void cleanUp();
101 
102  // Derive MS iteration sort order, based on comb*
103  void deriveVI2Sort(casacore::Block<int>& sortcols,
104  bool combobs,bool combscan,
105  bool combfld,bool combspw);
106 
107  // Pointers to the various kinds of layer factories we may use
109 
110  //vi::SimpleSimVi2LayerFactory *ss_;
111  //vi::CalSolvingVi2LayerFactoryByVE *cal_;
112  //vi::ChannelAverageTVILayerFactory *chanave_;
113  // AveragingVi2LayerFactory *timeave_;
114 
116 
118 
119 };
120 
121 
122 } //# NAMESPACE CASA - END
123 
124 #endif
125 
126 
casacore::Vector< vi::ViiLayerFactory * > factories_
vi::SimpleSimVi2LayerFactory *ss_; vi::CalSolvingVi2LayerFactoryByVE *cal_; vi::ChannelAverageTVILaye...
vi::ViiLayerFactory * data_
Pointers to the various kinds of layer factories we may use.
void addSimIO()
Add spoofed data layer factory.
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
vi::VisibilityIterator2 & makeFullVI()
Build and Return a reference to the fully-stacked VI.
vi::ViiLayerFactory * timeave_
vi::VisibilityIterator2 * vi_
void deriveVI2Sort(casacore::Block< int > &sortcols, bool combobs, bool combscan, bool combfld, bool combspw)
Derive MS iteration sort order, based on comb*.
void addTimeAve(float timebin)
Add time-averaging layer factory.
vi::ViiLayerFactory * chanave_
void appendFactory(vi::ViiLayerFactory *f)
Add a factory to the internal list.
int countSolutions(casacore::Vector< int > &nChunkPerSolve)
Count solutions.
void addChanAve(casacore::Vector< int > chanbin)
Add chan-averaging layer factory.
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 cleanUp()
Delete everything.
A Table intended to hold astronomical data (a set of Measurements).
vi::ViiLayerFactory * cal_
void addCalFilter(casacore::Record const &config)
Add calibration specific data filter config should have the following entries: &quot;mode&quot; (String) – cali...
CalSolVi2Organizer()
Construct.
void addCalForSolving(float calfactor)
Add calibrating layer factory (one way or another)
vi::ViiLayerFactory * calfilter_
void addDiskIO(casacore::MeasurementSet *ms, float interval, casacore::Bool combobs=false, casacore::Bool combscan=false, casacore::Bool combfld=false, casacore::Bool combspw=false, casacore::Bool useMSIter2=true, std::shared_ptr< vi::FrequencySelections > freqSel=nullptr)
Add disk-accesing layer factory.