casa
$Rev:20696$
|
00001 //# MSSelectionTools.h: Classes to hold results from antenna grammar parser 00002 //# Copyright (C) 1994,1995,1997,1998,1999,2000,2001,2003 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# $Id: MSSelectionTools.h 20750 2009-10-01 06:32:18Z Malte.Marquarding $ 00027 00028 #ifndef MS_MSSELECTIONTOOLS_H 00029 #define MS_MSSELECTIONTOOLS_H 00030 00031 //# Includes 00032 #include <casa/aips.h> 00033 #include <casa/Arrays/Vector.h> 00034 #include <ms/MeasurementSets/MSSelection.h> 00035 00036 namespace casa { //# NAMESPACE CASA - BEGIN 00037 00038 Vector<Int> set_intersection(const Vector<Int>& v1, const Vector<Int>& v2); 00039 Vector<Int> set_union(const Vector<Int>& v1, const Vector<Int>& v2); 00040 00041 // Collective selection returning a selected MS. 00042 Bool mssSetData(const MeasurementSet& ms, 00043 MeasurementSet& selectedMS, 00044 const String& outMSName="", 00045 const String& timeExpr="", 00046 const String& antennaExpr="", 00047 const String& fieldExpr="", 00048 const String& spwExpr="", 00049 const String& uvDistExpr="", 00050 const String& taQLExpr="", 00051 const String& polnExpr="", 00052 const String& scanExpr="", 00053 const String& arrayExpr="", 00054 const String& stateExpr="", 00055 const String& obsExpr="", 00056 MSSelection *mss=NULL 00057 ); 00058 // Collective selection also returning in-row (corr/chan) slices 00059 Bool mssSetData(const MeasurementSet& ms, 00060 MeasurementSet& selectedMS, 00061 Vector<Vector<Slice> >& chanSlices, 00062 Vector<Vector<Slice> >& corrSlices, 00063 const String& outMSName="", 00064 const String& timeExpr="", 00065 const String& antennaExpr="", 00066 const String& fieldExpr="", 00067 const String& spwExpr="", 00068 const String& uvDistExpr="", 00069 const String& taQLExpr="", 00070 const String& polnExpr="", 00071 const String& scanExpr="", 00072 const String& arrayExpr="", 00073 const String& stateExpr="", 00074 const String& obsExpr="", 00075 const Int defaultChanStep=1, 00076 MSSelection *mss=NULL 00077 ); 00078 00079 Bool getSelectedTable(Table& selectedTab, const Table& baseTab, 00080 TableExprNode& fullTEN, const String& outName); 00081 00082 Record mssSelectedIndices(MSSelection& mss, const MeasurementSet *ms); 00083 00084 String stripWhite(const String& str, Bool onlyends=True); 00085 int tokenize(const String& str, const String& sep, Vector<String>& tokens,Bool upCase=False); 00086 Vector<String> &split(const String &s, char delim, Vector<String> &elems); 00087 } 00088 00089 #endif