00001 //# CalSolVi2Organizer.h: MS Meta info services in Calibraiton context 00002 //# Copyright (C) 2016 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 adressed 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 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# 00027 00028 #ifndef SYNTHESIS_CALSOLVI2ORGANIZER_H 00029 #define SYNTHESIS_CALSOLVI2ORGANIZER_H 00030 00031 #include <casa/aips.h> 00032 #include <casa/iostream.h> 00033 #include <casa/BasicSL/String.h> 00034 #include <ms/MeasurementSets/MeasurementSet.h> 00035 #include <msvis/MSVis/SimpleSimVi2.h> 00036 #include <mstransform/TVI/ChannelAverageTVI.h> 00037 #include <synthesis/MeasurementComponents/CalibratingVi2.h> 00038 00039 00040 namespace casa { //# NAMESPACE CASA - BEGIN 00041 00042 class VisEquation; 00043 00044 class CalSolVi2Organizer { 00045 00046 public: 00047 00048 // Construct 00049 CalSolVi2Organizer(); 00050 00051 // Dtor 00052 ~CalSolVi2Organizer(); 00053 00054 Int nLayers() const { return factories_.nelements(); }; 00055 00056 // Build and Return a reference to the fully-stacked VI 00057 vi::VisibilityIterator2& makeFullVI(); 00058 00059 // Count solutions 00060 Int countSolutions(Vector<Int>& nChunkPerSolve); 00061 00062 // Add disk-accesing layer factory 00063 // void addDiskIO(); 00064 00065 // Add spoofed data layer factory 00066 void addSimIO(); 00067 void addSimIO(const vi::SimpleSimVi2Parameters& ss); 00068 00069 // Add calibrating layer factory (one way or another) 00070 void addCalForSolving(Float calfactor); 00071 void addCalForSolving(VisEquation& ve); 00072 00073 // Add chan-averaging layer factory 00074 void addChanAve(Int chanbin); 00075 00076 // Add time-averaging layer factory 00077 void addTimeAve(Float timebin); 00078 00079 private: 00080 00081 void barf(); 00082 00083 // Add a factory to the internal list 00084 void appendFactory(vi::ViiLayerFactory* f); 00085 00086 // Delete everything 00087 void cleanUp(); 00088 00089 // Derive MS iteration sort order, based on comb* 00090 void deriveVI2Sort(Block<Int>& sortcols, // Double& iterInterval 00091 Bool combobs,Bool combscan, 00092 Bool combfld,Bool combspw); 00093 00094 // Pointers to the various kinds of layer factories we may use 00095 vi::ViiLayerFactory *ss_, *cal_, *chanave_, *timeave_; 00096 00097 //vi::SimpleSimVi2LayerFactory *ss_; 00098 //vi::CalSolvingVi2LayerFactoryByVE *cal_; 00099 //vi::ChannelAverageTVILayerFactory *chanave_; 00100 // AveragingVi2LayerFactory *timeave_; 00101 00102 Vector<vi::ViiLayerFactory*> factories_; 00103 00104 vi::VisibilityIterator2* vi_; 00105 00106 }; 00107 00108 00109 } //# NAMESPACE CASA - END 00110 00111 #endif 00112 00113