casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MSUtil.h
Go to the documentation of this file.
00001 //# MSUtil.h: Definitions for MS utilities
00002 //# Copyright (C) 2011
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 adressed 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 //#
00027 //# $Id$
00028 
00029 #ifndef MSVIS_MSUTIL_H
00030 #define MSVIS_MSUTIL_H
00031 #include <casa/aips.h>
00032 #include <ms/MeasurementSets/MeasurementSet.h>
00033 namespace casa { //# NAMESPACE CASA - BEGIN
00034 
00035   class MSUtil{
00036 
00037   public:
00038     //Empty Constructor if needed
00039     MSUtil();
00040     //This method gives you the channels (and spws) that will cover the 
00041     //freq range provided in the frame the user stated. 
00042     //The conversion from the data frame will be done properly for finding this
00043     //spw, start, nchan will be resized appropriately
00044     static void getSpwInFreqRange(Vector<Int>& spw, Vector<Int>& start,
00045                                   Vector<Int>& nchan,
00046                                   const MeasurementSet& ms, 
00047                                   const Double freqStart,
00048                                   const Double freqEnd,
00049                                   const Double freqStep,
00050                                   const MFrequency::Types freqframe=MFrequency::LSRK, 
00051                                   const Int fieldId=0);
00052     
00053 
00054     // The following wil provide the range of frequency convered in the frame requested by the spw, channel selection 
00055  
00056     static void getFreqRangeInSpw( Double& freqStart,
00057                               Double& freqEnd, 
00058                               const Vector<Int>& spw, 
00059                               const Vector<Int>& start,
00060                               const Vector<Int>& nchan,
00061                               const MeasurementSet& ms, 
00062                               const MFrequency::Types freqframe=MFrequency::LSRK,
00063                                    const Int fieldId=0);
00064 
00065   private:
00066     static void rejectConsecutive(const Vector<Double>& t, Vector<Double>& retval, Vector<Int>& indx);
00067 
00068   };
00069 } //# NAMESPACE CASA - END
00070 #endif