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