casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ParameterParser.h
Go to the documentation of this file.
1 //# ParameterParser.h
2 //# Copyright (C) 2007
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This program is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU General Public License as published by the Free
7 //# Software Foundation; either version 2 of the License, or (at your option)
8 //# any later version.
9 //#
10 //# This program is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 //# more details.
14 //#
15 //# You should have received a copy of the GNU General Public License along
16 //# with this program; if not, write to the Free Software Foundation, Inc.,
17 //# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 
26 #ifndef IMAGEANALYSIS_PARAMETERPARSER_H
27 #define IMAGEANALYSIS_PARAMETERPARSER_H
28 
29 #include <casacore/casa/aips.h>
30 
31 #include <vector>
32 
33 namespace casacore{
34 
35 class String;
36 template <class T> class Vector;
37 }
38 
39 namespace casa {
40 
41 
42 
43 // <summary>
44 // Parse various common input parameters to image analysis tasks and tool methods
45 // </summary>
46 // <author>Dave Mehringer</author>
47 // <use visibility=export>
48 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
49 // </reviewed>
50 // <prerequisite>
51 
52 // </prerequisite>
53 
54 // <etymology>
55 // Parse parameters
56 // </etymology>
57 
58 // <synopsis>
59 // This class is for parsing input parameters associated with image analysis tasks and tool methods.
60 
62 public:
63 
64  // <src>ranges</src> are pairs describing the pixel range over which to select.
65  // If you want to select just one pixel in the "range", you must specify that pixel
66  // in both parts of the pair. So if you want to select pixels 0 through 5 and pixel 13,
67  // you'd specify ranges[0] = 0; ranges[1] = 5; ranges[2] = 13; ranges[3] = 13
68  static std::vector<casacore::uInt> consolidateAndOrderRanges(
69  casacore::uInt& nSelected, const std::vector<casacore::uInt>& ranges
70  );
71 
72  // get spectral ranges from chans parameter,
73  // nSelectedChannels will have the total number of channels selected for the
74  // specification, for an image that has nChannels.
75  static std::vector<casacore::uInt> spectralRangesFromChans(
76  casacore::uInt& nSelectedChannels, const casacore::String& specification, const casacore::uInt nChannels
77  );
78 
79  // get a vector of correlations, represented by casacore::String, from a stokes string specifcation,
80  // eg, "LLRR", "IV", etc that is commonly used in the stokes parameter in
81  // casa image analysis tasks
82  static std::vector<casacore::String> stokesFromString(casacore::String& specification);
83 };
84 
85 };
86 
87 #endif
std::vector< double > Vector
Definition: ds9context.h:24
static std::vector< casacore::uInt > consolidateAndOrderRanges(casacore::uInt &nSelected, const std::vector< casacore::uInt > &ranges)
ranges are pairs describing the pixel range over which to select.
static std::vector< casacore::String > stokesFromString(casacore::String &specification)
get a vector of correlations, represented by casacore::String, from a stokes string specifcation...
Parse various common input parameters to image analysis tasks and tool methods &lt;author&gt;Dave Mehringer...
static std::vector< casacore::uInt > spectralRangesFromChans(casacore::uInt &nSelectedChannels, const casacore::String &specification, const casacore::uInt nChannels)
get spectral ranges from chans parameter, nSelectedChannels will have the total number of channels se...
String: the storage and methods of handling collections of characters.
Definition: String.h:223
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42