1 | //
|
---|
2 | // C++ Implementation: STCalSkyPSAlma
|
---|
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/Logging/LogIO.h>
|
---|
16 |
|
---|
17 | #include "STSelector.h"
|
---|
18 | #include "STCalSkyPSAlma.h"
|
---|
19 | #include "STDefs.h"
|
---|
20 | #include <atnf/PKSIO/SrcType.h>
|
---|
21 |
|
---|
22 | using namespace std;
|
---|
23 | using namespace casa;
|
---|
24 |
|
---|
25 | namespace asap {
|
---|
26 | STCalSkyPSAlma::STCalSkyPSAlma(CountedPtr<Scantable> &s)
|
---|
27 | : STCalibration(s, "SPECTRA")
|
---|
28 | {
|
---|
29 | applytable_ = new STCalSkyTable(*s, "PSALMA");
|
---|
30 | }
|
---|
31 |
|
---|
32 | void STCalSkyPSAlma::setupSelector(const STSelector &sel)
|
---|
33 | {
|
---|
34 | sel_ = sel;
|
---|
35 | vector<int> types = sel_.getTypes();
|
---|
36 | if (types.size() == 0) {
|
---|
37 | types.resize(1);
|
---|
38 | types[0] = SrcType::PSOFF;
|
---|
39 | sel_.setTypes(types);
|
---|
40 | }
|
---|
41 | else if (find(types.begin(), types.end(), SrcType::PSOFF) == types.end()) {
|
---|
42 | LogIO os(LogOrigin("STCalSkyPSAlma", "setupSelector", WHERE));
|
---|
43 | os << LogIO::SEVERE << "Selection contains no data." << LogIO::EXCEPTION;
|
---|
44 | }
|
---|
45 | else {
|
---|
46 | types.resize(1);
|
---|
47 | types[0] = SrcType::PSOFF;
|
---|
48 | sel_.setTypes(types);
|
---|
49 | }
|
---|
50 | }
|
---|
51 |
|
---|
52 | void STCalSkyPSAlma::appenddata(uInt scanno, uInt cycleno,
|
---|
53 | uInt beamno, uInt ifno, uInt polno,
|
---|
54 | uInt freqid, Double time, Float elevation,
|
---|
55 | const Vector<Float> &any_data,
|
---|
56 | const Vector<uChar> &channel_flag)
|
---|
57 | {
|
---|
58 | STCalSkyTable *p = dynamic_cast<STCalSkyTable *>(&(*applytable_));
|
---|
59 | p->appenddata(scanno, cycleno, beamno, ifno, polno,
|
---|
60 | freqid, time, elevation, any_data, channel_flag);
|
---|
61 | }
|
---|
62 |
|
---|
63 | }
|
---|