source: trunk/src/STCalSkyOtfAlma.cpp@ 2896

Last change on this file since 2896 was 2823, checked in by Takeshi Nakazato, 11 years ago

New Development: No

JIRA Issue: CAS-5375

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: No

Module(s): pipeline

Description: Describe your changes here...

Fixed row number issue in STCalSkyPSAlma.


File size: 1.2 KB
Line 
1//
2// C++ Implementation: STCalSkyOtfAlma
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#include "STSelector.h"
15#include "STCalSkyOtfAlma.h"
16#include "RowAccumulator.h"
17#include "STIdxIter.h"
18#include "STDefs.h"
19#include "EdgeMarker.h"
20
21#include <atnf/PKSIO/SrcType.h>
22
23using namespace std;
24using namespace casa;
25
26namespace asap {
27 STCalSkyOtfAlma::STCalSkyOtfAlma(CountedPtr<Scantable> &s, bool israster)
28 : STCalSkyPSAlma(s),
29 israster_(israster)
30{
31 rowNumbers_ = scantable_->table().rowNumbers();
32}
33
34void STCalSkyOtfAlma::setupSelector(const STSelector &sel)
35{
36 sel_ = sel;
37
38 // Detect edges using EdgeMarker
39 EdgeMarker marker(israster_);
40
41 // we can set insitu=True since we only need
42 // a list of rows to be marked. No marking is
43 // done here.
44 marker.setdata(scantable_, True);
45 marker.setoption(options_);
46 marker.detect();
47 Block<uInt> rows = marker.getDetectedRows();
48 vector<int> vectorRows(rows.nelements());
49 for (size_t i = 0; i < vectorRows.size(); ++i)
50 vectorRows[i] = rowNumbers_[rows[i]];
51
52 // Set list of row indices to selector
53 sel_.setRows(vectorRows);
54}
55
56}
Note: See TracBrowser for help on using the repository browser.