[2703] | 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>
|
---|
[2786] | 14 |
|
---|
| 15 | #include <casa/Logging/LogIO.h>
|
---|
| 16 |
|
---|
[2703] | 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)
|
---|
[2915] | 27 | : STCalibration(s, "SPECTRA")
|
---|
[2703] | 28 | {
|
---|
[2720] | 29 | applytable_ = new STCalSkyTable(*s, "PSALMA");
|
---|
[2703] | 30 | }
|
---|
| 31 |
|
---|
[2786] | 32 | void STCalSkyPSAlma::setupSelector(const STSelector &sel)
|
---|
[2703] | 33 | {
|
---|
[2786] | 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 | }
|
---|
[2703] | 50 | }
|
---|
[2915] | 51 |
|
---|
| 52 | void STCalSkyPSAlma::appenddata(uInt scanno, uInt cycleno,
|
---|
| 53 | uInt beamno, uInt ifno, uInt polno,
|
---|
| 54 | uInt freqid, Double time, Float elevation,
|
---|
| 55 | Vector<Float> any_data)
|
---|
[2703] | 56 | {
|
---|
[2915] | 57 | STCalSkyTable *p = dynamic_cast<STCalSkyTable *>(&(*applytable_));
|
---|
| 58 | p->appenddata(scanno, cycleno, beamno, ifno, polno,
|
---|
| 59 | freqid, time, elevation, any_data);
|
---|
[2703] | 60 | }
|
---|
| 61 |
|
---|
| 62 | }
|
---|