Changeset 2786


Ignore:
Timestamp:
03/11/13 12:46:39 (12 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-4770

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: test_sdcal2

Put in Release Notes: No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Bug fix on handling data selection of input Scantable object.


Location:
trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STCalSkyOtfAlma.cpp

    r2758 r2786  
    3030{}
    3131
    32 void STCalSkyOtfAlma::setupSelector()
     32void STCalSkyOtfAlma::setupSelector(const STSelector &sel)
    3333{
    34   sel_.reset();
     34  sel_ = sel;
    3535
    3636  // Detect edges using EdgeMarker
  • trunk/src/STCalSkyOtfAlma.h

    r2757 r2786  
    4141 
    4242protected:
    43   virtual void setupSelector();
     43  virtual void setupSelector(const STSelector &sel);
    4444  //virtual void fillCalTable();
    4545
  • trunk/src/STCalSkyPSAlma.cpp

    r2749 r2786  
    1212
    1313#include <vector>
     14
     15#include <casa/Logging/LogIO.h>
     16
    1417#include "STSelector.h"
    1518#include "STCalSkyPSAlma.h"
     
    2932}
    3033
    31 void STCalSkyPSAlma::setupSelector()
     34void STCalSkyPSAlma::setupSelector(const STSelector &sel)
    3235{
    33   sel_.reset();
    34   vector<int> types(1,SrcType::PSOFF);
    35   sel_.setTypes(types);
     36  sel_ = sel;
     37  vector<int> types = sel_.getTypes();
     38  if (types.size() == 0) {
     39    types.resize(1);
     40    types[0] = SrcType::PSOFF;
     41    sel_.setTypes(types);
     42  }
     43  else if (find(types.begin(), types.end(), SrcType::PSOFF) == types.end()) {
     44    LogIO os(LogOrigin("STCalSkyPSAlma", "setupSelector", WHERE));
     45    os << LogIO::SEVERE << "Selection contains no data." << LogIO::EXCEPTION;
     46  }
     47  else {
     48    types.resize(1);
     49    types[0] = SrcType::PSOFF;
     50    sel_.setTypes(types);
     51  }
    3652}
    3753
  • trunk/src/STCalSkyPSAlma.h

    r2757 r2786  
    4242 
    4343protected:
    44   virtual void setupSelector();
     44  virtual void setupSelector(const STSelector &sel);
    4545  virtual void fillCalTable();
    4646};
  • trunk/src/STCalTsys.cpp

    r2749 r2786  
    1212
    1313#include <vector>
     14
     15#include <casa/Arrays/ArrayMath.h>
     16#include <casa/Logging/LogIO.h>
     17
    1418#include "STSelector.h"
    1519#include "STCalTsys.h"
     
    1822#include "STDefs.h"
    1923#include <atnf/PKSIO/SrcType.h>
    20 
    21 #include <casa/Arrays/ArrayMath.h>
    2224
    2325using namespace std;
     
    3234}
    3335
    34 void STCalTsys::setupSelector()
     36void STCalTsys::setupSelector(const STSelector &sel)
    3537{
    36   sel_.reset();
    37   sel_.setIFs(iflist_);
     38  sel_ = sel;
     39  vector<int> ifnos = sel_.getIFs();
     40  if (ifnos.size() > 0) {
     41    int nif = 0;
     42    int nifOrg = iflist_.size();
     43    vector<int> iflistNew(iflist_);
     44    for (int i = 0; i < nifOrg; i++) {
     45      if (find(ifnos.begin(), ifnos.end(), iflist_[i]) != ifnos.end()) {
     46        iflistNew[nif] = iflist_[i];
     47        ++nif;
     48      }
     49    }
     50    if (nif == 0) {
     51      LogIO os(LogOrigin("STCalTsys", "setupSelector", WHERE));
     52      os << LogIO::SEVERE << "Selection contains no data." << LogIO::EXCEPTION;
     53    }
     54    sel_.setIFs(iflistNew);
     55  }
     56  else {
     57    sel_.setIFs(iflist_);
     58  }
    3859}
    3960
  • trunk/src/STCalTsys.h

    r2747 r2786  
    4343 
    4444private:
    45   void setupSelector();
     45  void setupSelector(const STSelector &sel);
    4646  void fillCalTable();
    4747
  • trunk/src/STCalibration.cpp

    r2742 r2786  
    2525{
    2626  STSelector selOrg = scantable_->getSelection();
    27   setupSelector();
     27  setupSelector(selOrg);
    2828  scantable_->setSelection(sel_);
    2929 
  • trunk/src/STCalibration.h

    r2757 r2786  
    2525#include "STDefs.h"
    2626#include "STApplyTable.h"
     27#include "STSelector.h"
    2728
    2829namespace asap {
     
    4748
    4849protected:
    49   virtual void setupSelector() = 0;
     50  virtual void setupSelector(const STSelector &sel) = 0;
    5051  virtual void fillCalTable() = 0;
    5152
Note: See TracChangeset for help on using the changeset viewer.