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 PLOTMSSELECTION_H_
00028 #define PLOTMSSELECTION_H_
00029
00030 #include <casa/Containers/Record.h>
00031 #include <ms/MSSel/MSSelection.h>
00032 #include <plotms/PlotMS/PlotMSConstants.h>
00033
00034 #include <map>
00035
00036 namespace casa {
00037
00038
00039 class MeasurementSet;
00040 class NewCalTable;
00041
00042
00043
00044 class PlotMSSelection {
00045 public:
00046
00047
00048
00049
00050
00051
00052
00053 PMS_ENUM1(Field, fields, fieldStrings, field,
00054 FIELD, SPW, TIMERANGE, UVRANGE, ANTENNA, SCAN,
00055 CORR, ARRAY, OBSERVATION, INTENT, FEED, MSSELECT)
00056 PMS_ENUM2(Field, fields, fieldStrings, field,
00057 "field", "spw", "timerange", "uvrange", "antenna", "scan",
00058 "corr", "array", "observation", "intent", "feed", "msselect")
00059
00060
00061
00062
00063 static String defaultValue(Field f);
00064
00065
00066
00067
00068
00069 PlotMSSelection();
00070
00071
00072 PlotMSSelection(const PlotMSSelection& copy);
00073
00074
00075 ~PlotMSSelection();
00076
00077
00078
00079
00080
00081 void fromRecord(const RecordInterface& record);
00082 Record toRecord() const;
00083
00084
00085
00086 String toStringShort() const;
00087
00088
00089
00090 void apply(MeasurementSet& ms, MeasurementSet& selectedMS,
00091 Vector<Vector<Slice> >& chansel,
00092 Vector<Vector<Slice> >& corrsel);
00093
00094
00095 void apply(NewCalTable& ct, NewCalTable& selectedCT,
00096 Vector<Vector<Slice> >& chansel,
00097 Vector<Vector<Slice> >& corrsel);
00098
00099
00100
00101 const String& getValue(Field f) const;
00102 void getValue(Field f, String& value) const { value = getValue(f); }
00103 void setValue(Field f, const String& value);
00104
00105
00106
00107
00108 const String& field() const { return getValue(FIELD); }
00109 const String& spw() const { return getValue(SPW); }
00110 const String& timerange() const { return getValue(TIMERANGE); }
00111 const String& uvrange() const { return getValue(UVRANGE); }
00112 const String& antenna() const { return getValue(ANTENNA); }
00113 const String& scan() const { return getValue(SCAN); }
00114 const String& corr() const { return getValue(CORR); }
00115 const String& array() const { return getValue(ARRAY); }
00116 const String& observation() const {return getValue(OBSERVATION);}
00117 const String& intent() const { return getValue(INTENT);}
00118 const String& feed() const { return getValue(FEED);}
00119 const String& msselect() const { return getValue(MSSELECT); }
00120 const Int& forceNew() const { return forceNew_; }
00121
00122
00123
00124
00125 void setField(const String& v) { setValue(FIELD, v); }
00126 void setSpw(const String& v) { setValue(SPW, v); }
00127 void setTimerange(const String& v) { setValue(TIMERANGE, v); }
00128 void setUvrange(const String& v) { setValue(UVRANGE, v); }
00129 void setAntenna(const String& v) { setValue(ANTENNA, v); }
00130 void setScan(const String& v) { setValue(SCAN, v); }
00131 void setCorr(const String& v) { setValue(CORR, v); }
00132 void setArray(const String& v) { setValue(ARRAY, v); }
00133 void setObservation(const String& v) {setValue(OBSERVATION, v); }
00134 void setIntent(const String& v) { setValue(INTENT, v); }
00135 void setFeed(const String& v) { setValue(FEED, v); }
00136 void setMsselect(const String& v) { setValue(MSSELECT, v); }
00137 void setForceNew(const Int& forcenew) { forceNew_ = forcenew; }
00138
00139
00140
00141
00142 bool operator==(const PlotMSSelection& other) const;
00143 bool operator!=(const PlotMSSelection& other) const {
00144 return !(operator==(other)); }
00145
00146 bool fieldsEqual(const PlotMSSelection& other) const;
00147 bool fieldsNotEqual(const PlotMSSelection& other) const {
00148 return !fieldsEqual(other); }
00149
00150
00151
00152
00153 PlotMSSelection& operator=(const PlotMSSelection& copy);
00154
00155
00156 Vector<int> getSelectedAntennas1();
00157 Vector<int> getSelectedAntennas2();
00158
00159
00160 bool isEmpty() const;
00161 private:
00162
00163 std::map<Field, String> itsValues_;
00164
00165
00166
00167
00168 Int forceNew_;
00169 Vector<int> selAnts;
00170 Vector<int> selAnts2;
00171
00172
00173 void initDefaults();
00174
00175 };
00176
00177 }
00178
00179 #endif