source: branches/alma/src/python_STSelector.cpp@ 1661

Last change on this file since 1661 was 1639, checked in by Kana Sugimoto, 15 years ago

New Development: Yes

JIRA Issue: Yes (CAS-1429)

Ready to Release: Yes

Interface Changes: Yes

What Interface Changed:
A new python method, selector.set_rows(rownrs=[]),
and a cpp function,
STSelector::setRows( const std::vector< int >& rows ),
are added.
The cpp function can be called with selector._setrows()
from python scripts.

Test Programs:

# @casa
s=sd.scantable('ORIGINAL_TABLE_NAME', False)
sel=sd.selector()
rownrs=[1,3,5,7]
sel.set_rows(rownrs)
s.set_selection(sel)
s2=s.copy()
s2.save(name='NEW_TABLE_NAME',format='ASAP',overwrite=True)

Put in Release Notes: Yes

Module(s):

Description:

Data selection by a list of row numbers can be done by
the new method selector.set_rows.

File size: 1.5 KB
Line 
1//
2// C++ Implementation: python_STSelector
3//
4// Description: This file is the boost::python wrapper for asap::STSelector
5//
6//
7// Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2006
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12#include <boost/python.hpp>
13
14#include "STSelector.h"
15
16using namespace boost::python;
17
18namespace asap {
19 namespace python {
20
21 void python_STSelector() {
22 class_<STSelector>("selector")
23 .def( init <> () )
24 .def( init < const STSelector& > () )
25 .def("_getbeams", &STSelector::getBeams)
26 .def("_getifs", &STSelector::getIFs)
27 .def("_getpols", &STSelector::getPols)
28 .def("_getpoltypes", &STSelector::getPolTypes)
29 .def("_getscans", &STSelector::getScans)
30 .def("_getcycles", &STSelector::getCycles)
31 .def("_gettaql", &STSelector::getTaQL)
32 .def("_getorder", &STSelector::getSortOrder)
33 .def("_reset", &STSelector::reset)
34 .def("_setbeams", &STSelector::setBeams)
35 .def("_setifs", &STSelector::setIFs)
36 .def("_setpols", &STSelector::setPolarizations)
37 .def("_setpolstrings", &STSelector::setPolFromStrings)
38 .def("_setscans", &STSelector::setScans)
39 .def("_setcycles", &STSelector::setCycles)
40 .def("_setname", &STSelector::setName)
41 .def("_settaql", &STSelector::setTaQL)
42 .def("_setorder", &STSelector::setSortOrder)
43 .def("_setrows", &STSelector::setRows)
44 .def("_empty", &STSelector::empty)
45 ;
46 };
47 }
48}
Note: See TracBrowser for help on using the repository browser.