source: trunk/src/STCalTsys.cpp@ 2915

Last change on this file since 2915 was 2915, checked in by Takeshi Nakazato, 11 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
Line 
1//
2// C++ Implementation: STCalTsys
3//
4// Description:
5//
6//
7// Author: Takeshi Nakazato <takeshi.nakazato@nao.ac.jp> (C) 2012
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12
13#include <vector>
14
15#include <casa/Arrays/ArrayMath.h>
16#include <casa/Logging/LogIO.h>
17
18#include "STSelector.h"
19#include "STCalTsys.h"
20#include "STDefs.h"
21#include <atnf/PKSIO/SrcType.h>
22
23using namespace std;
24using namespace casa;
25
26namespace asap {
27 STCalTsys::STCalTsys(CountedPtr<Scantable> &s, vector<int> &iflist)
28 : STCalibration(s, "TSYS"),
29 iflist_(iflist)
30{
31 applytable_ = new STCalTsysTable(*s);
32}
33
34void STCalTsys::setupSelector(const STSelector &sel)
35{
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 }
57}
58
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)
63{
64 STCalTsysTable *p = dynamic_cast<STCalTsysTable *>(&(*applytable_));
65 p->appenddata(scanno, cycleno, beamno, ifno, polno,
66 freqid, time, elevation, any_data);
67}
68
69}
Note: See TracBrowser for help on using the repository browser.