1 | //#---------------------------------------------------------------------------
|
---|
2 | //# python_Scantable.cc: python exposure of c++ Scantable class
|
---|
3 | //#---------------------------------------------------------------------------
|
---|
4 | //# Copyright (C) 2004
|
---|
5 | //# ATNF
|
---|
6 | //#
|
---|
7 | //# This program is free software; you can redistribute it and/or modify it
|
---|
8 | //# under the terms of the GNU General Public License as published by the Free
|
---|
9 | //# Software Foundation; either version 2 of the License, or (at your option)
|
---|
10 | //# any later version.
|
---|
11 | //#
|
---|
12 | //# This program is distributed in the hope that it will be useful, but
|
---|
13 | //# WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
---|
15 | //# Public License for more details.
|
---|
16 | //#
|
---|
17 | //# You should have received a copy of the GNU General Public License along
|
---|
18 | //# with this program; if not, write to the Free Software Foundation, Inc.,
|
---|
19 | //# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
|
---|
20 | //#
|
---|
21 | //# Correspondence concerning this software should be addressed as follows:
|
---|
22 | //# Internet email: Malte.Marquarding@csiro.au
|
---|
23 | //# Postal address: Malte Marquarding,
|
---|
24 | //# Australia Telescope National Facility,
|
---|
25 | //# P.O. Box 76,
|
---|
26 | //# Epping, NSW, 2121,
|
---|
27 | //# AUSTRALIA
|
---|
28 | //#
|
---|
29 | //# $Id: python_Scantable.cpp 1068 2006-07-04 01:27:03Z mar637 $
|
---|
30 | //#---------------------------------------------------------------------------
|
---|
31 | #include <vector>
|
---|
32 |
|
---|
33 | #include <boost/python.hpp>
|
---|
34 | #include <boost/python/args.hpp>
|
---|
35 |
|
---|
36 | #include "ScantableWrapper.h"
|
---|
37 |
|
---|
38 | using namespace boost::python;
|
---|
39 |
|
---|
40 | namespace asap {
|
---|
41 | namespace python {
|
---|
42 |
|
---|
43 | void python_Scantable() {
|
---|
44 | class_<ScantableWrapper>("Scantable")
|
---|
45 | //.def( init <> () )
|
---|
46 | .def( init < const std::string&, const std::string& > () )
|
---|
47 | .def( init < const ScantableWrapper& > () )
|
---|
48 | .def("_copy", &ScantableWrapper::copy)
|
---|
49 | .def("_assign", &ScantableWrapper::assign)
|
---|
50 | .def("getif", &ScantableWrapper::getIF)
|
---|
51 | .def("getbeam", &ScantableWrapper::getBeam)
|
---|
52 | .def("getpol", &ScantableWrapper::getPol)
|
---|
53 | .def("getscan", &ScantableWrapper::getScan)
|
---|
54 | .def("getcycle", &ScantableWrapper::getCycle)
|
---|
55 | .def("nif", &ScantableWrapper::nif,
|
---|
56 | (boost::python::arg("scanno")=-1) )
|
---|
57 | .def("nbeam", &ScantableWrapper::nbeam,
|
---|
58 | (boost::python::arg("scanno")=-1) )
|
---|
59 | .def("npol", &ScantableWrapper::npol,
|
---|
60 | (boost::python::arg("scanno")=-1) )
|
---|
61 | .def("nchan", &ScantableWrapper::nchan,
|
---|
62 | (boost::python::arg("ifno")=-1) )
|
---|
63 | .def("ncycle", &ScantableWrapper::ncycle,
|
---|
64 | (boost::python::arg("scanno")=-1) )
|
---|
65 | .def("nscan", &ScantableWrapper::nscan)
|
---|
66 | .def("nrow", &ScantableWrapper::nrow)
|
---|
67 | .def("get_fluxunit", &ScantableWrapper::getFluxUnit)
|
---|
68 | .def("set_fluxunit", &ScantableWrapper::setFluxUnit)
|
---|
69 | .def("_setInstrument", &ScantableWrapper::setInstrument)
|
---|
70 | .def("_getspectrum", &ScantableWrapper::getSpectrum,
|
---|
71 | (arg("whichrow")=0, arg("poltype")=std::string("")) )
|
---|
72 | .def("poltype", &ScantableWrapper::getPolType )
|
---|
73 | .def("column_names", &ScantableWrapper::columnNames)
|
---|
74 | .def("_getpollabel", &ScantableWrapper::getPolarizationLabel)
|
---|
75 | .def("_setspectrum",&ScantableWrapper::setSpectrum,
|
---|
76 | (boost::python::arg("whichrow")=0) )
|
---|
77 | .def("_getabcissa", &ScantableWrapper::getAbcissa,
|
---|
78 | (boost::python::arg("whichrow")=0) )
|
---|
79 | .def("_getabcissalabel", &ScantableWrapper::getAbcissaLabel,
|
---|
80 | (boost::python::arg("whichrow")=0) )
|
---|
81 | .def("_getmask", &ScantableWrapper::getMask,
|
---|
82 | (boost::python::arg("whichrow")=0) )
|
---|
83 | .def("_gettsys", &ScantableWrapper::getTsys)
|
---|
84 | .def("_getsourcename", &ScantableWrapper::getSourceName,
|
---|
85 | (boost::python::arg("whichrow")=0) )
|
---|
86 | .def("_getelevation", &ScantableWrapper::getElevation,
|
---|
87 | (boost::python::arg("whichrow")=0) )
|
---|
88 | .def("_getazimuth", &ScantableWrapper::getAzimuth,
|
---|
89 | (boost::python::arg("whichrow")=0) )
|
---|
90 | .def("_getparangle", &ScantableWrapper::getParAngle,
|
---|
91 | (boost::python::arg("whichrow")=0) )
|
---|
92 | .def("_gettime", &ScantableWrapper::getTime,
|
---|
93 | (boost::python::arg("whichrow")=0) )
|
---|
94 | .def("_getdirection", &ScantableWrapper::getDirectionString,
|
---|
95 | (boost::python::arg("whichrow")=0) )
|
---|
96 | .def("_flag", &ScantableWrapper::flag)
|
---|
97 | .def("_save", &ScantableWrapper::makePersistent)
|
---|
98 | .def("_summary", &ScantableWrapper::summary,
|
---|
99 | (boost::python::arg("verbose")=true) )
|
---|
100 | .def("_getrestfreqs", &ScantableWrapper::getRestFrequencies)
|
---|
101 | .def("_setrestfreqs", &ScantableWrapper::setRestFrequencies)
|
---|
102 | .def("_setcoordinfo", &ScantableWrapper::setCoordInfo)
|
---|
103 | .def("_getcoordinfo", &ScantableWrapper::getCoordInfo)
|
---|
104 | .def("set_dirframe", &ScantableWrapper::setDirection,
|
---|
105 | (boost::python::arg("refstr")="") )
|
---|
106 | .def("_gethistory", &ScantableWrapper::getHistory)
|
---|
107 | .def("_addhistory", &ScantableWrapper::addHistory)
|
---|
108 | .def("_getselection", &ScantableWrapper::getSelection)
|
---|
109 | .def("_setselection", &ScantableWrapper::setSelection)
|
---|
110 | .def("_addfit", &ScantableWrapper::addFit)
|
---|
111 | .def("_getfit", &ScantableWrapper::getFit)
|
---|
112 | .def("_recalcazel", &ScantableWrapper::calculateAZEL)
|
---|
113 | .def("_setsourcetype", &ScantableWrapper::setSourceType)
|
---|
114 | ;
|
---|
115 | };
|
---|
116 |
|
---|
117 | } // python
|
---|
118 | } // asap
|
---|