Commits

George Moellenbrock authored b73b591a328
Update tMSMetaInfoForCal_GT to test center frequency accessor.
No tags

code/synthesis/MeasurementComponents/test/tMSMetaInfoForCal_GT.cc

Modified
81 81
82 82
83 83
84 84 // These are information-free, essentially, for the "<noms>" case
85 85 //cout << "msm.fieldIdAtTime(123456789.0) = " << msm.fieldIdAtTime(123456789.0) << endl;
86 86 //cout << "msm.scanNumberAtTime(123456789.0) = " << msm.scanNumberAtTime(123456789.0) << endl;
87 87 ASSERT_EQ(-1,msm.fieldIdAtTime(123456789.0));
88 88 ASSERT_EQ(-1,msm.scanNumberAtTime(123456789.0));
89 89
90 90
91 + // <noms> case returns zero for center freq (for now)
92 + ASSERT_EQ(0,msm.centerFreq(0));
93 +
91 94 }
92 95
93 96 {
94 97 MSMetaInfoForCal msm(10,1,5);
95 98
96 99 // Basic MS info
97 100 ASSERT_EQ(False,msm.msOk());
98 101 ASSERT_EQ(String("<noms>"),msm.msname());
99 102
100 103 // Shapes
118 121 ASSERT_EQ(uInt(5),fldnames.nelements());
119 122 for (Int ifld=0;ifld<5;++ifld)
120 123 ASSERT_EQ(String("FieldId"+String::toString(ifld)),fldnames[ifld]);
121 124
122 125 // These are information-free, essentially, for the "<noms>" case
123 126 //cout << "msm.fieldIdAtTime(123456789.0) = " << msm.fieldIdAtTime(123456789.0) << endl;
124 127 //cout << "msm.scanNumberAtTime(123456789.0) = " << msm.scanNumberAtTime(123456789.0) << endl;
125 128 ASSERT_EQ(-1,msm.fieldIdAtTime(123456789.0));
126 129 ASSERT_EQ(-1,msm.scanNumberAtTime(123456789.0));
127 130
131 +
128 132 }
129 133
130 134
131 135 }
132 136
133 137 TEST(MSMetaInfoForCal, MSbyName) {
134 138
135 139 // Path to an MS in the DR
136 140 String *casapath = new String[2];
137 141 split(EnvironmentVariable::get("CASAPATH"), casapath, 2, String(" "));
187 191
188 192 /*
189 193 cout << "msm.scanNumberAtTime(4793957198.0) = " << msm.scanNumberAtTime(4793957198.0) << endl;
190 194 cout << "msm.scanNumberAtTime(4793957198.9) = " << msm.scanNumberAtTime(4793957198.9) << endl;
191 195 cout << "msm.scanNumberAtTime(4793957196.0) = " << msm.scanNumberAtTime(4793957196.0) << endl;
192 196 cout << "msm.scanNumberAtTime(4793957287.2999993) = " << msm.scanNumberAtTime(4793957287.2999993) << endl;
193 197 cout << "msm.scanNumberAtTime(4793957287.4) = " << msm.scanNumberAtTime(4793957287.4) << endl;
194 198 cout << "msm.scanNumberAtTime(4793957290.0) = " << msm.scanNumberAtTime(4793957290.0) << endl;
195 199 */
196 200
201 + // Check some center frequencies
202 + ASSERT_EQ(1.6675,msm.centerFreq(0));
203 + ASSERT_EQ(2.0515,msm.centerFreq(6));
204 + ASSERT_EQ(0.9765,msm.centerFreq(8));
205 + ASSERT_EQ(1.4885,msm.centerFreq(15));
206 +
207 +
197 208 }
198 209
199 210
200 211 else
201 212 // Must not have full test DR
202 213 cout << "Can't find real test MS: " << mspath << endl;
203 214
204 215 }
205 216
206 217 TEST(MSMetaInfoForCal, MSbyMS) {
252 263
253 264
254 265 //cout << "msm.fieldIdAtTime(4793957198.) = " << msm.fieldIdAtTime(4793957198.0) << endl;
255 266 ASSERT_EQ(1,msm.fieldIdAtTime(4793957190.0)); // near end of scan 30
256 267
257 268 //cout << "msm.scanNumberAtTime(4793957190.0) = " << msm.scanNumberAtTime(4793957190.0) << endl;
258 269 //cout << "msm.scanNumberAtTime(4793957200.0) = " << msm.scanNumberAtTime(4793957200.0) << endl;
259 270 ASSERT_EQ(30,msm.scanNumberAtTime(4793957190.0)); // near end of scan 30
260 271 ASSERT_EQ(31,msm.scanNumberAtTime(4793957200.0)); // near beg of scan 31
261 272
273 +
274 + // Check some center frequencies
275 + ASSERT_EQ(1.6675,msm.centerFreq(0));
276 + ASSERT_EQ(2.0515,msm.centerFreq(6));
277 + ASSERT_EQ(0.9765,msm.centerFreq(8));
278 + ASSERT_EQ(1.4885,msm.centerFreq(15));
279 +
280 + cout << msm.centerFreq(8) << endl;
281 +
282 +
262 283 }
263 284
264 285
265 286
266 287

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut