Line data Source code
1 : #include <msvis/MSVis/ViColumns2.h>
2 : #include <casacore/ms/MeasurementSets.h>
3 :
4 : using namespace casacore;
5 : namespace casa {
6 :
7 : namespace vi {
8 :
9 5544 : ViColumns2::ViColumns2 ()
10 5544 : : antenna1_p (),
11 5544 : antenna2_p (),
12 5544 : array_p (),
13 5544 : corrVis_p (),
14 5544 : dataDescription_p (),
15 5544 : exposure_p (),
16 5544 : feed1_p (),
17 5544 : feed2_p (),
18 5544 : field_p (),
19 5544 : flagCategory_p (),
20 5544 : flagRow_p (),
21 5544 : flag_p (),
22 5544 : floatVis_p (),
23 5544 : modelVis_p (),
24 5544 : observation_p (),
25 5544 : processor_p (),
26 5544 : scan_p (),
27 5544 : sigma_p (),
28 5544 : state_p (),
29 5544 : timeCentroid_p (),
30 5544 : timeInterval_p (),
31 5544 : time_p (),
32 5544 : uvw_p (),
33 5544 : vis_p (),
34 5544 : weightSpectrum_p (),
35 5544 : sigmaSpectrum_p (),
36 5544 : weight_p (),
37 5544 : floatDataFound_p (false)
38 5544 : {}
39 :
40 :
41 : void
42 3641217 : ViColumns2::attachColumns (const Table & t, bool attachSpecialColumns)
43 : {
44 3641217 : const ColumnDescSet & cds = t.tableDesc ().columnDescSet ();
45 :
46 3641217 : antenna1_p.attach (t, MS::columnName (MS::ANTENNA1));
47 3641217 : antenna2_p.attach (t, MS::columnName (MS::ANTENNA2));
48 :
49 3641217 : corrVis_p = ArrayColumn<Complex>();
50 3641217 : if (cds.isDefined ("CORRECTED_DATA")) {
51 2265660 : corrVis_p.attach (t, "CORRECTED_DATA");
52 : }
53 :
54 3641217 : exposure_p.attach (t, MS::columnName (MS::EXPOSURE));
55 3641217 : feed1_p.attach (t, MS::columnName (MS::FEED1));
56 3641217 : feed2_p.attach (t, MS::columnName (MS::FEED2));
57 3641217 : flag_p.attach (t, MS::columnName (MS::FLAG));
58 3641217 : flagCategory_p.attach (t, MS::columnName (MS::FLAG_CATEGORY));
59 3641217 : flagRow_p.attach (t, MS::columnName (MS::FLAG_ROW));
60 :
61 3641217 : floatVis_p = ArrayColumn<Float>();
62 3641217 : if (cds.isDefined (MS::columnName (MS::FLOAT_DATA))) {
63 807837 : floatVis_p.attach (t, MS::columnName (MS::FLOAT_DATA));
64 807837 : floatDataFound_p = true;
65 : } else {
66 2833380 : floatDataFound_p = false;
67 : }
68 :
69 3641217 : modelVis_p = ArrayColumn<Complex>();
70 3641217 : if (cds.isDefined ("MODEL_DATA")) {
71 2056579 : modelVis_p.attach (t, "MODEL_DATA");
72 : }
73 :
74 3641217 : observation_p.attach (t, MS::columnName (MS::OBSERVATION_ID));
75 3641217 : processor_p.attach (t, MS::columnName (MS::PROCESSOR_ID));
76 3641217 : scan_p.attach (t, MS::columnName (MS::SCAN_NUMBER));
77 3641217 : sigma_p.attach (t, MS::columnName (MS::SIGMA));
78 3641217 : state_p.attach (t, MS::columnName (MS::STATE_ID));
79 3641217 : time_p.attach (t, MS::columnName (MS::TIME));
80 3641217 : timeCentroid_p.attach (t, MS::columnName (MS::TIME_CENTROID));
81 3641217 : timeInterval_p.attach (t, MS::columnName (MS::INTERVAL));
82 3641217 : uvw_p.attach (t, MS::columnName (MS::UVW));
83 :
84 3641217 : vis_p = ArrayColumn<Complex>();
85 3641217 : if (cds.isDefined (MS::columnName (MS::DATA))) {
86 2833380 : vis_p.attach (t, MS::columnName (MS::DATA));
87 : }
88 :
89 3641217 : weight_p.attach (t, MS::columnName (MS::WEIGHT));
90 :
91 3641217 : weightSpectrum_p = ArrayColumn<Float>();
92 3641217 : if (cds.isDefined (MS::columnName (MS::WEIGHT_SPECTRUM))) {
93 1856776 : weightSpectrum_p.attach (t, MS::columnName (MS::WEIGHT_SPECTRUM));
94 : }
95 :
96 3641217 : sigmaSpectrum_p = ArrayColumn<Float>();
97 3641217 : if (cds.isDefined (MS::columnName (MS::SIGMA_SPECTRUM))) {
98 137243 : sigmaSpectrum_p.attach (t, MS::columnName (MS::SIGMA_SPECTRUM));
99 : }
100 :
101 3641217 : if (attachSpecialColumns){
102 :
103 3641217 : array_p.attach (t, MS::columnName (MS::ARRAY_ID));
104 :
105 3641217 : dataDescription_p.attach (t, MS::columnName (MS::DATA_DESC_ID));
106 :
107 3641217 : field_p.attach (t, MS::columnName (MS::FIELD_ID));
108 : }
109 3641217 : }
110 :
111 : Bool
112 3641217 : ViColumns2::isFloatDataPresent () const
113 : {
114 3641217 : return floatDataFound_p;
115 : }
116 :
117 : } // end namespace vi
118 :
119 : using namespace casacore;
120 : } // end namespace casa
|