FlagAgentDisplay.h

Go to the documentation of this file.
00001 //# FlagAgentDisplay.h: This file contains the interface definition of the FlagAgentDisplay 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 FlagAgentDisplay_H_
00024 #define FlagAgentDisplay_H_
00025 
00026 #include <flagging/Flagging/FlagAgentBase.h>
00027 
00028 #include <casadbus/viewer/ViewerProxy.h>
00029 #include <casadbus/plotserver/PlotServerProxy.h>
00030 #include <casadbus/utilities/BusAccess.h>
00031 #include <casadbus/session/DBusSession.h>
00032 
00033 //#include <ms/MeasurementSets/MSColumns.h>
00034 
00035 #include <flagging/Flagging/FlagPlotServerProxy.h>
00036 
00037 
00038 namespace casa { //# NAMESPACE CASA - BEGIN
00039   
00040   class FlagAgentDisplay : public FlagAgentBase {
00041     
00042   public:
00043     
00044     FlagAgentDisplay(FlagDataHandler *dh, Record config, Bool writePrivateFlagCube = false);
00045     ~FlagAgentDisplay();
00046 
00047     // Make plots and either display or write to a file
00048     Bool displayReports(FlagReport &combinedReport);
00049     
00050     // Get a report/summary
00051     FlagReport getReport();
00052     
00053   protected:
00054     
00055     // Compute flags for a given (time,freq) map
00056     bool computeAntennaPairFlags(const vi::VisBuffer2 &visBuffer, VisMapper &visibilities,FlagMapper &flag,Int antenna1,Int antenna2,vector<uInt> &rows);
00057 
00058     void preProcessBuffer(const vi::VisBuffer2 &visBuffer);
00059     
00060     // Choose how to step through the baselines in the current chunk
00061     void iterateAntennaPairsInteractive(antennaPairMap *antennaPairMap_ptr);
00062     
00063     // Parse configuration parameters
00064     void setAgentParameters(Record config);
00065 
00066   private:
00067     
00068     Bool setDataLayout();
00069     Bool setReportLayout();
00070     Bool buildDataPlotWindow();
00071     Bool buildReportPlotWindow();
00072 
00073 
00074     void getChunkInfo(const vi::VisBuffer2 &visBuffer);
00075     Bool skipBaseline(std::pair<Int,Int> antennaPair);
00076  
00077     void getUserInput();
00078     void getReportUserInput();
00079     
00080     void DisplayRaster(Int xdim, Int ydim, Vector<Float> &data, uInt frame);
00081     void DisplayLine(Int xdim, Vector<Double> &xdata, Vector<Float> &ydata, String label, String color, Bool hold,  uInt frame);
00082     void DisplayScatter(Int xdim, Vector<Double> &xdata, Vector<Float> &ydata, String label, String color, Bool hold,  uInt frame);
00083     void DisplayLineScatterError(FlagPlotServerProxy *&plotter, String &plottype, Vector<Float> &xdata, Vector<Float> &ydata, String &errortype, Vector<Float> &error, String label, String color, uInt frame);
00084 
00085     // Plotter members
00086     FlagPlotServerProxy *dataplotter_p;  
00087     FlagPlotServerProxy *reportplotter_p;
00088 
00089     // GUI parameters
00090     String userChoice_p;
00091     String userFixA1_p, userFixA2_p;
00092 
00093     Int skipScan_p, skipSpw_p, skipField_p;
00094 
00095     // Control parameters
00096     Bool pause_p;
00097 
00098     // visBuffer state variables
00099     Int fieldId_p;
00100     String fieldName_p;
00101     Int scanStart_p;
00102     Int scanEnd_p;
00103     Int spwId_p;
00104     uInt nPolarizations_p;
00105     Vector<Double> freqList_p;
00106     String antenna1_p;
00107     String antenna2_p;
00108 
00109     Bool dataDisplay_p, reportDisplay_p; // show per chunk plots and/or end-of-MS plots
00110     String reportFormat_p;
00111     Bool stopAndExit_p;
00112     Bool reportReturn_p;
00113     Bool showBandpass_p;
00114 
00115     Vector<dbus::variant> panels_p, report_panels_p;
00116     const char *dock_xml_p, *report_dock_xml_p;
00117 //    Bool showBandpass_p;
00118 
00119     // Control parameters
00120 //    Bool stopAndExit_p;
00121 //    Bool pause_p;
00122 //    Bool dataDisplay_p, reportDisplay_p; // show per chunk plots and/or end-of-MS plots
00123 //    Bool reportReturn_p;
00124 //    String reportFormat_p;
00125     
00126     // visBuffer state variables
00127 //    Int fieldId_p;
00128 //    String fieldName_p;
00129 //    Int scanStart_p;
00130 //    Int scanEnd_p;
00131 //    Int spwId_p;
00132 //    String antenna1_p;
00133 //    String antenna2_p;
00134     
00135 //    uInt nPolarizations_p;
00136 //    Vector<Double> freqList_p;
00137     
00138     // GUI parameters
00139 //    String userChoice_p;
00140 //    String userFixA1_p, userFixA2_p;
00141     
00142 //    Int skipScan_p, skipSpw_p, skipField_p;
00143 
00144     Vector<String> plotColours_p;
00145     
00146     
00147   };
00148   
00149   
00150 } //# NAMESPACE CASA - END
00151 
00152 #endif /* FLAGAGENTDISPLAY_H_ */
00153 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1