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 5434 : 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 5434 : floatDataFound_p (false)
38 5434 : {}
39 :
40 :
41 : void
42 3599207 : ViColumns2::attachColumns (const Table & t, bool attachSpecialColumns)
43 : {
44 3599207 : const ColumnDescSet & cds = t.tableDesc ().columnDescSet ();
45 :
46 3599207 : antenna1_p.attach (t, MS::columnName (MS::ANTENNA1));
47 3599207 : antenna2_p.attach (t, MS::columnName (MS::ANTENNA2));
48 :
49 3599207 : corrVis_p = ArrayColumn<Complex>();
50 3599207 : if (cds.isDefined ("CORRECTED_DATA")) {
51 2248721 : corrVis_p.attach (t, "CORRECTED_DATA");
52 : }
53 :
54 3599207 : exposure_p.attach (t, MS::columnName (MS::EXPOSURE));
55 3599207 : feed1_p.attach (t, MS::columnName (MS::FEED1));
56 3599207 : feed2_p.attach (t, MS::columnName (MS::FEED2));
57 3599207 : flag_p.attach (t, MS::columnName (MS::FLAG));
58 3599207 : flagCategory_p.attach (t, MS::columnName (MS::FLAG_CATEGORY));
59 3599207 : flagRow_p.attach (t, MS::columnName (MS::FLAG_ROW));
60 :
61 3599207 : floatVis_p = ArrayColumn<Float>();
62 3599207 : 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 2806964 : floatDataFound_p = false;
67 : }
68 :
69 3599207 : modelVis_p = ArrayColumn<Complex>();
70 3599207 : if (cds.isDefined ("MODEL_DATA")) {
71 2040014 : modelVis_p.attach (t, "MODEL_DATA");
72 : }
73 :
74 3599207 : observation_p.attach (t, MS::columnName (MS::OBSERVATION_ID));
75 3599207 : processor_p.attach (t, MS::columnName (MS::PROCESSOR_ID));
76 3599207 : scan_p.attach (t, MS::columnName (MS::SCAN_NUMBER));
77 3599207 : sigma_p.attach (t, MS::columnName (MS::SIGMA));
78 3599207 : state_p.attach (t, MS::columnName (MS::STATE_ID));
79 3599207 : time_p.attach (t, MS::columnName (MS::TIME));
80 3599207 : timeCentroid_p.attach (t, MS::columnName (MS::TIME_CENTROID));
81 3599207 : timeInterval_p.attach (t, MS::columnName (MS::INTERVAL));
82 3599207 : uvw_p.attach (t, MS::columnName (MS::UVW));
83 :
84 3599207 : vis_p = ArrayColumn<Complex>();
85 3599207 : if (cds.isDefined (MS::columnName (MS::DATA))) {
86 2806964 : vis_p.attach (t, MS::columnName (MS::DATA));
87 : }
88 :
89 3599207 : weight_p.attach (t, MS::columnName (MS::WEIGHT));
90 :
91 3599207 : weightSpectrum_p = ArrayColumn<Float>();
92 3599207 : if (cds.isDefined (MS::columnName (MS::WEIGHT_SPECTRUM))) {
93 1852298 : weightSpectrum_p.attach (t, MS::columnName (MS::WEIGHT_SPECTRUM));
94 : }
95 :
96 3599207 : sigmaSpectrum_p = ArrayColumn<Float>();
97 3599207 : if (cds.isDefined (MS::columnName (MS::SIGMA_SPECTRUM))) {
98 137273 : sigmaSpectrum_p.attach (t, MS::columnName (MS::SIGMA_SPECTRUM));
99 : }
100 :
101 3599207 : if (attachSpecialColumns){
102 :
103 3599207 : array_p.attach (t, MS::columnName (MS::ARRAY_ID));
104 :
105 3599207 : dataDescription_p.attach (t, MS::columnName (MS::DATA_DESC_ID));
106 :
107 3599207 : field_p.attach (t, MS::columnName (MS::FIELD_ID));
108 : }
109 3599207 : }
110 :
111 : Bool
112 3599207 : ViColumns2::isFloatDataPresent () const
113 : {
114 3599207 : return floatDataFound_p;
115 : }
116 :
117 : } // end namespace vi
118 :
119 : using namespace casacore;
120 : } // end namespace casa
|