FlagAgentSummary.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 #ifndef FlagAgentSummary_H_
00024 #define FlagAgentSummary_H_
00025
00026 #include <flagging/Flagging/FlagAgentBase.h>
00027
00028 namespace casa {
00029
00030 class FlagAgentSummary : public FlagAgentBase {
00031
00032 struct summary
00033 {
00034 summary()
00035 {
00036 accumflags.clear();
00037 accumtotal.clear();
00038 accumChannelflags.clear();
00039 accumChanneltotal.clear();
00040 accumPolarizationflags.clear();
00041 accumPolarizationtotal.clear();
00042 accumAntScanflags.clear();
00043 accumAntScantotal.clear();
00044 accumTotalFlags = 0;
00045 accumTotalCount = 0;
00046 }
00047
00048 std::map<std::string, std::map<std::string, uInt64> > accumflags;
00049 std::map<std::string, std::map<std::string, uInt64> > accumtotal;
00050
00051 std::map<Int, std::map<uInt, uInt64> > accumChannelflags;
00052 std::map<Int, std::map<uInt, uInt64> > accumChanneltotal;
00053
00054 std::map<Int, std::map<std::string, uInt64> > accumPolarizationflags;
00055 std::map<Int, std::map<std::string, uInt64> > accumPolarizationtotal;
00056
00057 std::map<Int, std::map<Int, uInt64> > accumAntScanflags;
00058 std::map<Int, std::map<Int, uInt64> > accumAntScantotal;
00059
00060 uInt64 accumTotalFlags, accumTotalCount;
00061 };
00062
00063 public:
00064
00065 FlagAgentSummary(FlagDataHandler *dh, Record config);
00066 ~FlagAgentSummary();
00067
00068 Record getResult();
00069
00070 protected:
00071
00072
00073 void preProcessBuffer(const vi::VisBuffer2 &visBuffer);
00074
00075
00076 bool computeRowFlags(const vi::VisBuffer2 &visBuffer, FlagMapper &flags, uInt row);
00077
00078
00079 void setAgentParameters(Record config);
00080
00081
00082 FlagReport getReport();
00083
00084
00085 void getResultCore(Record &summary);
00086
00087 private:
00088
00089
00090 FlagReport buildFlagCountPlots();
00091 std::map<Int , std::vector<Double> > frequencyList;
00092
00093 Bool spwChannelCounts;
00094 Bool spwPolarizationCounts;
00095 Bool baselineCounts;
00096 Bool fieldCounts;
00097 String display_p;
00098
00099 std::map<std::string, summary* > fieldSummaryMap;
00100 summary *currentSummary;
00101 Int arrayId;
00102 Int fieldId;
00103 Int spw;
00104 Int scan;
00105 Int observationId;
00106
00107 string arrayId_str;
00108 string fieldId_str;
00109 string spw_str;
00110 string scan_str;
00111 string observationId_str;
00112
00113 };
00114
00115
00116 }
00117
00118 #endif
00119