Commits
263 263 | default: |
264 264 | ThrowCc("Logic Error: Unhandled type"); |
265 265 | } |
266 266 | LogIO log(LogOrigin("StatWtTVI", __func__)); |
267 267 | log << LogIO::NORMAL << "Using sliding time window of width " |
268 268 | << _slidingTimeWindowWidth << " s" << LogIO::POST; |
269 269 | |
270 270 | } |
271 271 | } |
272 272 | _configureStatAlg(config); |
273 - | //_logUsedChannels(); |
274 273 | return True; |
275 274 | } |
276 275 | |
277 276 | void StatWtTVI::_configureStatAlg(const Record& config) { |
278 277 | String field = "statalg"; |
279 278 | if (config.isDefined(field)) { |
280 279 | ThrowIf( |
281 280 | config.type(config.fieldNumber(field)) != TpString, |
282 281 | "Unsupported type for field '" + field + "'" |
283 282 | ); |
383 382 | Double, Array<Float>::const_iterator, |
384 383 | Array<Bool>::const_iterator |
385 384 | >() |
386 385 | ); |
387 386 | stats.insert(StatisticsData::MEAN); |
388 387 | _wtStats->setStatsToCalculate(stats); |
389 388 | _wtStats->setCalculateAsAdded(True); |
390 389 | } |
391 390 | |
392 391 | void StatWtTVI::_logUsedChannels() const { |
393 - | cout << "*** " << __func__ << " called" << endl; |
394 392 | // FIXME uses underlying MS |
395 393 | MSMetaData msmd(&ms(), 100.0); |
396 394 | const auto nchan = msmd.nChans(); |
397 395 | // uInt nspw = nchan.size(); |
398 396 | LogIO log(LogOrigin("StatWtTVI", __func__)); |
399 397 | log << LogIO::NORMAL << "Weights are being computed using "; |
400 398 | const auto cend = _chanSelFlags.cend(); |
401 399 | const auto nspw = _samples.size(); |
402 400 | // for (uInt i=0; i<nspw; ++i) { |
403 401 | for (const auto& kv: _samples) { |
404 402 | const auto spw = kv.first; |
405 - | cout << "spw debug " << spw << endl; |
406 403 | log << "SPW " << spw << ", channels "; |
407 404 | const auto flagCube = _chanSelFlags.find(spw); |
408 405 | if (flagCube == cend) { |
409 406 | log << "0~" << (nchan[spw] - 1); |
410 407 | } |
411 408 | else { |
412 409 | vector<pair<uInt, uInt>> startEnd; |
413 410 | const auto flags = flagCube->second.tovector(); |
414 411 | bool started = false; |
415 412 | std::unique_ptr<pair<uInt, uInt>> curPair; |