00001 //# FlagAgentClipping.h: This file contains the interface definition of the FlagAgentClipping 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 FlagAgentClipping_H_ 00024 #define FlagAgentClipping_H_ 00025 00026 #include <flagging/Flagging/FlagAgentBase.h> 00027 00028 namespace casa { //# NAMESPACE CASA - BEGIN 00029 00030 class FlagAgentClipping : public FlagAgentBase { 00031 00032 public: 00033 00034 FlagAgentClipping(FlagDataHandler *dh, Record config, Bool writePrivateFlagCube = false, Bool flag = true); 00035 ~FlagAgentClipping(); 00036 00037 protected: 00038 00039 // Common functionality for each visBuffer (don't repeat at the row level) 00040 // jagonzal: With the new WEIGHT/SIGMA convention it is not longer 00041 // necessary divide the clipping range between the number of channels 00042 // void preProcessBuffer(const vi::VisBuffer2 &visBuffer); 00043 00044 // Compute flags afor a given mapped visibility point 00045 bool computeInRowFlags(const vi::VisBuffer2 &visBuffer, VisMapper &visibilities,FlagMapper &flags, uInt row); 00046 00047 // Specialization of the different clipping cases 00048 bool checkVisForClipOutside(Float visExpression); 00049 bool checkVisForClipInside(Float visExpression); 00050 bool checkVisForClipOutsideAndZeros(Float visExpression); 00051 bool checkVisForClipInsideAndZeros(Float visExpression); 00052 bool checkVisForNaNs(Float visExpression); 00053 bool checkVisForNaNsAndZeros(Float visExpression); 00054 00055 // Parse configuration parameters 00056 void setAgentParameters(Record config); 00057 00058 private: 00059 00061 Bool clipminmax_p; 00062 Bool clipoutside_p; 00063 Bool clipzeros_p; 00064 Bool weightcol_p; 00065 Float clipmin_p; 00066 Float clipmax_p; 00067 Float original_clipmin_p; 00068 Float original_clipmax_p; 00069 00070 // Specialization for the clipping case 00071 bool (casa::FlagAgentClipping::*checkVis_p)(Float); 00072 00073 }; 00074 00075 00076 } //# NAMESPACE CASA - END 00077 00078 #endif /* FlagAgentClipping_H_ */ 00079