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