source: trunk/src/STCalTsys.cpp @ 2919

Last change on this file since 2919 was 2915, checked in by Takeshi Nakazato, 10 years ago

New Development: No

JIRA Issue: No

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...

Refactoring STCalibration and its derived classes.
Fix for threshold of time gap analysis.


File size: 1.6 KB
RevLine 
[2696]1//
2// C++ Implementation: STCalTsys
3//
4// Description:
5//
6//
[2703]7// Author: Takeshi Nakazato <takeshi.nakazato@nao.ac.jp> (C) 2012
[2696]8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12
[2703]13#include <vector>
[2786]14
15#include <casa/Arrays/ArrayMath.h>
16#include <casa/Logging/LogIO.h>
17
[2703]18#include "STSelector.h"
[2696]19#include "STCalTsys.h"
[2703]20#include "STDefs.h"
21#include <atnf/PKSIO/SrcType.h>
[2696]22
[2703]23using namespace std;
[2696]24using namespace casa;
25
26namespace asap {
[2703]27  STCalTsys::STCalTsys(CountedPtr<Scantable> &s, vector<int> &iflist)
[2915]28    : STCalibration(s, "TSYS"),
[2703]29      iflist_(iflist)
[2696]30{
[2703]31  applytable_ = new STCalTsysTable(*s);
[2696]32}
33
[2786]34void STCalTsys::setupSelector(const STSelector &sel)
[2696]35{
[2786]36  sel_ = sel;
37  vector<int> ifnos = sel_.getIFs();
38  if (ifnos.size() > 0) {
39    int nif = 0;
40    int nifOrg = iflist_.size();
41    vector<int> iflistNew(iflist_);
42    for (int i = 0; i < nifOrg; i++) {
43      if (find(ifnos.begin(), ifnos.end(), iflist_[i]) != ifnos.end()) {
44        iflistNew[nif] = iflist_[i];
45        ++nif;
46      }
47    }
48    if (nif == 0) {
49      LogIO os(LogOrigin("STCalTsys", "setupSelector", WHERE));
50      os << LogIO::SEVERE << "Selection contains no data." << LogIO::EXCEPTION;
51    }
52    sel_.setIFs(iflistNew);
53  }
54  else {
55    sel_.setIFs(iflist_);
56  }
[2696]57}
58
[2915]59void STCalTsys::appenddata(uInt scanno, uInt cycleno,
60                           uInt beamno, uInt ifno, uInt polno,
61                           uInt freqid, Double time, Float elevation,
62                           Vector<Float> any_data)
[2696]63{
[2915]64  STCalTsysTable *p = dynamic_cast<STCalTsysTable *>(&(*applytable_));
65  p->appenddata(scanno, cycleno, beamno, ifno, polno,
66                freqid, time, elevation, any_data);
[2696]67}
68
69}
Note: See TracBrowser for help on using the repository browser.