Changeset 3062


Ignore:
Timestamp:
11/18/15 20:02:30 (9 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-8098

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...


Data selection for Tsys calibration takes intents into account. Only take Tsys's with SrcType::POFFCAL (CALIBRATE_ATMOSPHERE#OFF_SOURCE).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STCalTsys.cpp

    r2958 r3062  
    1515#include <casa/Arrays/ArrayMath.h>
    1616#include <casa/Logging/LogIO.h>
     17#include <tables/Tables/ScalarColumn.h>
    1718
    1819#include "STSelector.h"
     
    4950void STCalTsys::setupSelector(const STSelector &sel)
    5051{
     52  // sel is an selector object that is associated with
     53  // input Scantable
    5154  sel_ = sel;
     55  //cout << "original: " << endl << sel_.print() << endl;
    5256  vector<int> ifnos = sel_.getIFs();
    5357  if (ifnos.size() > 0) {
     
    7074    sel_.setIFs(iflist_);
    7175  }
     76
     77  // intent selection
     78  ROScalarColumn<Int> srctypeCol(scantable_->table(), "SRCTYPE");
     79  Vector<Int> srctype = srctypeCol.getColumn();
     80  uInt calOffCount = 0;
     81  uInt calOnCount = 0;
     82  for (size_t i = 0; i < srctype.nelements(); ++i) {
     83    if (srctype[i] == static_cast<Int>(SrcType::PONCAL)) {
     84      calOnCount++;
     85    }
     86    else if (srctype[i] == static_cast<Int>(SrcType::POFFCAL)) {
     87      calOffCount++;
     88    }
     89  }
     90  //cout << "srctype = " << srctype << endl;
     91  //cout << "calOnCount, calOffCount = " << calOnCount << "," << calOffCount << endl;
     92  if (calOnCount == 0 || calOffCount == 0) {
     93    LogIO os(LogOrigin("STCalTsys", "setupSelector", WHERE));
     94    os << LogIO::SEVERE << "Input scantable doesn't have ATMCal intents" << LogIO::EXCEPTION;
     95  }
     96
     97  vector<int> intents = sel_.getTypes();
     98  if (count(intents.begin(), intents.end(), static_cast<Int>(SrcType::POFFCAL)) == 0) {
     99    intents.push_back(static_cast<Int>(SrcType::POFFCAL));
     100    sel_.setTypes(intents);
     101  }
     102
     103  //cout << "modified: " << endl << sel_.print() << endl;
    72104}
    73105
Note: See TracChangeset for help on using the changeset viewer.