CalCache.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CALCACHE_H_
00028 #define CALCACHE_H_
00029
00030 #include <plotms/Data/PlotMSCacheBase.h>
00031
00032 #include <plotms/PlotMS/PlotMSAveraging.h>
00033 #include <plotms/PlotMS/PlotMSConstants.h>
00034 #include <plotms/PlotMS/PlotMSFlagging.h>
00035
00036
00037 #include <synthesis/CalTables/NewCalTable.h>
00038 #include <synthesis/CalTables/CTIter.h>
00039 #include <casa/aips.h>
00040 #include <casa/Arrays.h>
00041 #include <casa/Containers/Block.h>
00042
00043 namespace casa {
00044
00045
00046 class PlotMSApp;
00047 class PlotMSIndexer;
00048
00049 class CalCache : public PlotMSCacheBase {
00050
00051
00052 friend class PlotMSIndexer;
00053
00054 public:
00055
00056
00057 CalCache(PlotMSApp* parent);
00058
00059
00060 virtual ~CalCache();
00061
00062
00063 PlotMSCacheBase::Type cacheType() const { return PlotMSCacheBase::CAL; };
00064
00065
00066 inline Bool parsAreComplex() { return parsAreComplex_; };
00067
00068
00069 Matrix<Int>& chanAveBounds(Int spw) { return chanAveBounds_p(spw); };
00070
00071
00072
00073
00074
00075
00076
00077 virtual String polname(Int ipol);
00078
00079
00080 void setFilename(String filename);
00081
00082 protected:
00083
00084
00085 virtual void loadIt(vector<PMS::Axis>& loadAxes,
00086 vector<PMS::DataColumn>& loadData,
00087 ThreadCommunication* thread = NULL);
00088
00089 private:
00090
00091
00092 CalCache(const CalCache&);
00093
00094
00095 void setUpCalIter(const String& calname,
00096 PlotMSSelection& selection,
00097 Bool readonly=True,
00098 Bool chanselect=True,
00099 Bool corrselect=True);
00100
00101
00102 void countChunks(ROCTIter& ci,ThreadCommunication* thread);
00103
00104
00105
00106
00107
00108 void loadCalChunks(ROCTIter& ci,
00109 const vector<PMS::Axis> loadAxes,
00110 ThreadCommunication* thread);
00111
00112
00113 void loadCalAxis(ROCTIter& cti, Int chunk, PMS::Axis axis, String pol);
00114
00115
00116 Slice getParSlice(String axis, String polnSel);
00117
00118 String toVisCalAxis(PMS::Axis axis);
00119
00120
00121 void checkRatioArray(Array<Float>& array, Int chunk);
00122
00123
00124 virtual void flagToDisk(const PlotMSFlagging& flagging,
00125 Vector<Int>& chunks,
00126 Vector<Int>& relids,
00127 Bool flag,
00128 PlotMSIndexer* indexer, int index);
00129
00130
00131
00132 Vector<Matrix<Int> > chanAveBounds_p;
00133
00134
00135 Vector<Int> nVBPerAve_;
00136
00137
00138 String basis_;
00139
00140 Bool divZero_;
00141
00142
00143 ROCTIter* ci_p;
00144 CTIter* wci_p;
00145
00146
00147 Bool parsAreComplex_;
00148
00149
00150
00151
00152
00153 };
00154 typedef CountedPtr<CalCache> CalCachePtr;
00155
00156
00157 }
00158
00159 #endif