casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
FlagAgentSummary.h
Go to the documentation of this file.
00001 //# FlagAgentSummary.h: This file contains the interface definition of the FlagAgentSummary class.
00002 //#
00003 //#  CASA - Common Astronomy Software Applications (http://casa.nrao.edu/)
00004 //#  Copyright (C) Associated Universities, Inc. Washington DC, USA 2011, All rights reserved.
00005 //#  Copyright (C) European Southern Observatory, 2011, All rights reserved.
00006 //#
00007 //#  This library is free software; you can redistribute it and/or
00008 //#  modify it under the terms of the GNU Lesser General Public
00009 //#  License as published by the Free software Foundation; either
00010 //#  version 2.1 of the License, or (at your option) any later version.
00011 //#
00012 //#  This library is distributed in the hope that it will be useful,
00013 //#  but WITHOUT ANY WARRANTY, without even the implied warranty of
00014 //#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 //#  Lesser General Public License for more details.
00016 //#
00017 //#  You should have received a copy of the GNU Lesser General Public
00018 //#  License along with this library; if not, write to the Free Software
00019 //#  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00020 //#  MA 02111-1307  USA
00021 //# $Id: $
00022 
00023 #ifndef FlagAgentSummary_H_
00024 #define FlagAgentSummary_H_
00025 
00026 #include <flagging/Flagging/FlagAgentBase.h>
00027 
00028 namespace casa { //# NAMESPACE CASA - BEGIN
00029 
00030 class FlagAgentSummary : public FlagAgentBase {
00031 
00032 public:
00033 
00034         FlagAgentSummary(FlagDataHandler *dh, Record config);
00035         ~FlagAgentSummary();
00036 
00037         Record getResult();
00038 
00039 protected:
00040 
00041         // Common functionality for each visBuffer (don't repeat at the row level)
00042         void preProcessBuffer(const vi::VisBuffer2 &visBuffer);
00043 
00044         // Compute flags for a given mapped visibility point
00045         bool computeRowFlags(const vi::VisBuffer2 &visBuffer, FlagMapper &flags, uInt row);
00046 
00047         // Parse configuration parameters
00048         void setAgentParameters(Record config);
00049 
00050         // Get the summary dictionary, and 'view' reports.
00051         FlagReport getReport();
00052 
00053 private:
00054 
00055         // Build simple plot-reports from the summary dictionary
00056         FlagReport buildFlagCountPlots();
00057         std::map<Int , std::vector<Double> > frequencyList;
00058 
00059         Bool spwChannelCounts;
00060         Bool spwPolarizationCounts;
00061         Bool baselineCounts;
00062 
00063         std::map<std::string, std::map<std::string, uInt64> > accumflags;
00064         std::map<std::string, std::map<std::string, uInt64> > accumtotal;
00065 
00066         std::map<Int, std::map<uInt, uInt64> > accumChannelflags;
00067         std::map<Int, std::map<uInt, uInt64> > accumChanneltotal;
00068 
00069         std::map<Int, std::map<std::string, uInt64> > accumPolarizationflags;
00070         std::map<Int, std::map<std::string, uInt64> > accumPolarizationtotal;
00071 
00072         std::map<Int, std::map<Int, uInt64> > accumAntScanflags;
00073         std::map<Int, std::map<Int, uInt64> > accumAntScantotal;
00074 
00075         uInt64 accumTotalFlags, accumTotalCount;
00076 
00077         Int arrayId;
00078         Int fieldId;
00079         Int spw;
00080         Int scan;
00081         Int observationId;
00082 
00083         string arrayId_str;
00084         string fieldId_str;
00085         string spw_str;
00086         string scan_str;
00087         string observationId_str;
00088 
00089 };
00090 
00091 
00092 } //# NAMESPACE CASA - END
00093 
00094 #endif /* FlagAgentSummary_H_ */
00095