casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlotMSTransformations.h
Go to the documentation of this file.
1 //# PlotMSAveraging.h: Transformation parameters.
2 //# Copyright (C) 2009
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library 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 Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 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 //# $Id: $
27 #ifndef PLOTMSTRANSFORMATIONS_H_
28 #define PLOTMSTRANSFORMATIONS_H_
29 
31 #include <casa/Quanta/Quantum.h>
34 
35 namespace casa {
36 
37 // Specifies averaging parameters for an MS.
39 public:
40  // Static //
41 
42  // Enum and methods to define the different fields for an casacore::MS averaging.
43  // <group>
45  FRAME, VELDEF)
47  "Frame", "veldef")
48  // </group>
49 
50  // Non-Static //
51 
52  // Constructor, which uses default values.
54 
55  // Destructor.
56  ~PlotMSTransformations();
57 
58 
59  // Converts this object to/from a record. Each field will have a key that
60  // is its enum name
61  // <group>
62  void fromRecord(const casacore::RecordInterface& record);
63  casacore::Record toRecord() const;
64  // </group>
65 
66 
67  // If any transformations are specified, return true
68  casacore::Bool anyTransform() const { return ((frameStr()!="") ||
69  (veldefStr()!="RADIO") ||
70  (xpcOffset()!=0.0) ||
71  (ypcOffset()!=0.0) ||
72  (formStokes()) ); };
73 
74  // Convenience methods for returning the standard field values.
75  // <group>
81  casacore::Double restFreq() const { return restFreq_; }; // In MHz
82  casacore::Double restFreqHz() const { return restFreq_*1.0e6; };
83  casacore::Double xpcOffset() const { return XpcOffset_; };
84  casacore::Double ypcOffset() const { return YpcOffset_; };
85  casacore::Bool formStokes() const { return formStokes_; };
86 
87  // </group>
88 
89 
90  // Convenience methods for setting the standard field values.
91  // <group>
93  void setFrame(const casacore::String& typeStr) {
98  void setRestFreq(casacore::Double restfreq) { restFreq_ = restfreq; }; // in MHz
99  void setRestFreq(casacore::Quantity restfreq) { restFreq_ = restfreq.getValue("MHz"); };
102  void setFormStokes(casacore::Bool formstokes) { formStokes_ = formstokes; };
103  // </group>
104 
105 
106  // Equality operators.
107  // <group>
108  bool operator==(const PlotMSTransformations& other) const;
109  bool operator!=(const PlotMSTransformations& other) const {
110  return !(operator==(other)); }
111  // </group>
112 
113  // Print out a summary
114  casacore::String summary() const;
115 
116 private:
117 
118  // The Frequency frame
120 
121  // The Velocity Defn
123 
124  // The rest frequency (MHz)
126 
127  // Phase center offsets
129 
130  // Form casacore::Stokes from correlations
132 
133  // Sets the default values.
134  void setDefaults();
135 
136 };
137 
138 }
139 
140 #endif /* PLOTMSTRANSFORMATIONS_H_ */
static Bool getType(MFrequency::Types &tp, const String &in)
Translate string to reference code.
void setXpcOffset(casacore::Double dx)
casacore::Double restFreqHz() const
#define PMS_ENUM2(NAME, ALLMETHOD, ALLSTRMETHOD, CONVMETHOD,...)
bool operator==(const PlotMSTransformations &other) const
Equality operators.
casacore::MFrequency::Types mfreqType_
The Frequency frame.
virtual Type type()
Return the type enum.
casacore::Record toRecord() const
casacore::Double ypcOffset() const
void setFrame(casacore::MFrequency::Types type)
Convenience methods for setting the standard field values.
casacore::String summary() const
Print out a summary.
void setVelDef(casacore::MDoppler::Types type)
static Bool getType(MDoppler::Types &tp, const String &in)
Translate string to reference code.
void setVelDef(const casacore::String &typeStr)
static const String & showType(MDoppler::Types tp)
casacore::String frameStr() const
casacore::MFrequency::Types frame()
Convenience methods for returning the standard field values.
casacore::Bool formStokes() const
double Double
Definition: aipstype.h:55
PMS_ENUM1(Field, fields, fieldStrings, field, FRAME, VELDEF) PMS_ENUM2(Field
Static //.
bool operator!=(const PlotMSTransformations &other) const
casacore::Bool formStokes_
Form casacore::Stokes from correlations.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Bool anyTransform() const
If any transformations are specified, return true.
void setDefaults()
Sets the default values.
Types
Types of known MDopplers Warning: The order defines the order in the translation matrix FromTo in th...
Definition: MDoppler.h:149
void fromRecord(const casacore::RecordInterface &record)
Converts this object to/from a record.
void setRestFreq(casacore::Quantity restfreq)
static const String & showType(MFrequency::Types tp)
void setRestFreq(casacore::Double restfreq)
casacore::Double xpcOffset() const
const Qtype & getValue() const
Get value of quantum in current units (i.e.
casacore::Double restFreq() const
Specifies averaging parameters for an MS.
void setYpcOffset(casacore::Double dy)
void setFrame(const casacore::String &typeStr)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void setFormStokes(casacore::Bool formstokes)
Abstract base class for Record classes.
Types
Types of known MFrequencies Warning: The order defines the order in the translation matrix FromTo in...
Definition: MFrequency.h:176
casacore::Double XpcOffset_
Phase center offsets.
casacore::MDoppler::Types veldef()
casacore::String veldefStr() const
casacore::MDoppler::Types mdoppType_
The Velocity Defn.
casacore::Double restFreq_
The rest frequency (MHz)
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42