PlotMSTransformations.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef PLOTMSTRANSFORMATIONS_H_
00028 #define PLOTMSTRANSFORMATIONS_H_
00029
00030 #include <plotms/PlotMS/PlotMSConstants.h>
00031 #include <casa/Quanta/Quantum.h>
00032 #include <measures/Measures/MFrequency.h>
00033 #include <measures/Measures/MDoppler.h>
00034
00035 namespace casa {
00036
00037
00038 class PlotMSTransformations {
00039 public:
00040
00041
00042
00043
00044 PMS_ENUM1(Field, fields, fieldStrings, field,
00045 FRAME, VELDEF)
00046 PMS_ENUM2(Field, fields, fieldStrings, field,
00047 "Frame", "veldef")
00048
00049
00050
00051
00052
00053 PlotMSTransformations();
00054
00055
00056 ~PlotMSTransformations();
00057
00058
00059
00060
00061
00062 void fromRecord(const RecordInterface& record);
00063 Record toRecord() const;
00064
00065
00066
00067
00068 Bool anyTransform() const { return ((frameStr()!="") ||
00069 (veldefStr()!="RADIO") ||
00070 (xpcOffset()!=0.0) ||
00071 (ypcOffset()!=0.0) ||
00072 (formStokes()) ); };
00073
00074
00075
00076 MFrequency::Types frame() { return mfreqType_; };
00077 MDoppler::Types veldef() { return mdoppType_; };
00078 String frameStr() const { return (mfreqType_==MFrequency::N_Types ?
00079 "" : MFrequency::showType(mfreqType_)); };
00080 String veldefStr() const { return MDoppler::showType(mdoppType_); };
00081 Double restFreq() const { return restFreq_; };
00082 Double restFreqHz() const { return restFreq_*1.0e6; };
00083 Double xpcOffset() const { return XpcOffset_; };
00084 Double ypcOffset() const { return YpcOffset_; };
00085 Bool formStokes() const { return formStokes_; };
00086
00087
00088
00089
00090
00091
00092 void setFrame(MFrequency::Types type) { mfreqType_=type; };
00093 void setFrame(const String& typeStr) {
00094 if (typeStr=="") mfreqType_=MFrequency::N_Types;
00095 else MFrequency::getType(mfreqType_,typeStr); };
00096 void setVelDef(MDoppler::Types type) { mdoppType_=type; };
00097 void setVelDef(const String& typeStr) { MDoppler::getType(mdoppType_,typeStr); };
00098 void setRestFreq(Double restfreq) { restFreq_ = restfreq; };
00099 void setRestFreq(Quantity restfreq) { restFreq_ = restfreq.getValue("MHz"); };
00100 void setXpcOffset(Double dx) { XpcOffset_ = dx; };
00101 void setYpcOffset(Double dy) { YpcOffset_ = dy; };
00102 void setFormStokes(Bool formstokes) { formStokes_ = formstokes; };
00103
00104
00105
00106
00107
00108 bool operator==(const PlotMSTransformations& other) const;
00109 bool operator!=(const PlotMSTransformations& other) const {
00110 return !(operator==(other)); }
00111
00112
00113
00114 String summary() const;
00115
00116 private:
00117
00118
00119 MFrequency::Types mfreqType_;
00120
00121
00122 MDoppler::Types mdoppType_;
00123
00124
00125 Double restFreq_;
00126
00127
00128 Double XpcOffset_, YpcOffset_;
00129
00130
00131 Bool formStokes_;
00132
00133
00134 void setDefaults();
00135
00136 };
00137
00138 }
00139
00140 #endif