1 | //#---------------------------------------------------------------------------
|
---|
2 | //# python_Scantable.cc: python exposure of c++ Scantable class
|
---|
3 | //#---------------------------------------------------------------------------
|
---|
4 | //# Copyright (C) 2004-2012
|
---|
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 2665 2012-10-15 04:52:34Z MalteMarquarding $
|
---|
30 | //#---------------------------------------------------------------------------
|
---|
31 |
|
---|
32 | #include <boost/python.hpp>
|
---|
33 | #include <boost/python/args.hpp>
|
---|
34 | #include <vector>
|
---|
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 < int > () )
|
---|
47 | .def( init < const std::string&, int > () )
|
---|
48 | .def( init < const ScantableWrapper& > () )
|
---|
49 | .def("_copy", &ScantableWrapper::copy)
|
---|
50 | .def("_assign", &ScantableWrapper::assign)
|
---|
51 | .def("getif", &ScantableWrapper::getIF)
|
---|
52 | .def("getifnos", &ScantableWrapper::getIFNos)
|
---|
53 | .def("getbeam", &ScantableWrapper::getBeam)
|
---|
54 | .def("getbeamnos", &ScantableWrapper::getBeamNos)
|
---|
55 | .def("getpol", &ScantableWrapper::getPol)
|
---|
56 | .def("getpolnos", &ScantableWrapper::getPolNos)
|
---|
57 | .def("getscan", &ScantableWrapper::getScan)
|
---|
58 | .def("getscannos", &ScantableWrapper::getScanNos)
|
---|
59 | .def("getcycle", &ScantableWrapper::getCycle)
|
---|
60 | .def("getmolnos", &ScantableWrapper::getMolNos)
|
---|
61 | .def("nif", &ScantableWrapper::nif,
|
---|
62 | (boost::python::arg("scanno")=-1) )
|
---|
63 | .def("nbeam", &ScantableWrapper::nbeam,
|
---|
64 | (boost::python::arg("scanno")=-1) )
|
---|
65 | .def("npol", &ScantableWrapper::npol,
|
---|
66 | (boost::python::arg("scanno")=-1) )
|
---|
67 | .def("nchan", &ScantableWrapper::nchan,
|
---|
68 | (boost::python::arg("ifno")=-1) )
|
---|
69 | .def("ncycle", &ScantableWrapper::ncycle,
|
---|
70 | (boost::python::arg("scanno")=-1) )
|
---|
71 | .def("nscan", &ScantableWrapper::nscan)
|
---|
72 | .def("nrow", &ScantableWrapper::nrow)
|
---|
73 | .def("get_fluxunit", &ScantableWrapper::getFluxUnit)
|
---|
74 | .def("set_fluxunit", &ScantableWrapper::setFluxUnit)
|
---|
75 | .def("_setInstrument", &ScantableWrapper::setInstrument)
|
---|
76 | .def("_setfeedtype", &ScantableWrapper::setFeedType)
|
---|
77 | .def("_getspectrum", &ScantableWrapper::getSpectrum,
|
---|
78 | (boost::python::arg("whichrow")=0,
|
---|
79 | boost::python::arg("poltype")=std::string("")) )
|
---|
80 | .def("poltype", &ScantableWrapper::getPolType )
|
---|
81 | .def("get_column_names", &ScantableWrapper::columnNames)
|
---|
82 | .def("_getpollabel", &ScantableWrapper::getPolarizationLabel)
|
---|
83 | .def("_setspectrum",&ScantableWrapper::setSpectrum,
|
---|
84 | (boost::python::arg("whichrow")=0) )
|
---|
85 | .def("_getabcissa", &ScantableWrapper::getAbcissa,
|
---|
86 | (boost::python::arg("whichrow")=0) )
|
---|
87 | .def("_getabcissalabel", &ScantableWrapper::getAbcissaLabel,
|
---|
88 | (boost::python::arg("whichrow")=0) )
|
---|
89 | .def("_getmask", &ScantableWrapper::getMask,
|
---|
90 | (boost::python::arg("whichrow")=0) )
|
---|
91 | .def("_getclipmask", &ScantableWrapper::getClipMask,
|
---|
92 | (boost::python::arg("whichrow")=0) )
|
---|
93 | .def("_gettsys", &ScantableWrapper::getTsys)
|
---|
94 | .def("_gettsysspectrum", &ScantableWrapper::getTsysSpectrum )
|
---|
95 | .def("_getsourcename", &ScantableWrapper::getSourceName,
|
---|
96 | (boost::python::arg("whichrow")=0) )
|
---|
97 | .def("_getelevation", &ScantableWrapper::getElevation,
|
---|
98 | (boost::python::arg("whichrow")=0) )
|
---|
99 | .def("_getazimuth", &ScantableWrapper::getAzimuth,
|
---|
100 | (boost::python::arg("whichrow")=0) )
|
---|
101 | .def("_getparangle", &ScantableWrapper::getParAngle,
|
---|
102 | (boost::python::arg("whichrow")=0) )
|
---|
103 | .def("_gettime", &ScantableWrapper::getTime,
|
---|
104 | (boost::python::arg("whichrow")=0,
|
---|
105 | boost::python::arg("prec")=0) )
|
---|
106 | .def("_getinttime", &ScantableWrapper::getIntTime,
|
---|
107 | (boost::python::arg("whichrow")=0) )
|
---|
108 | .def("_getdirection", &ScantableWrapper::getDirectionString,
|
---|
109 | (boost::python::arg("whichrow")=0) )
|
---|
110 | .def("get_antennaname", &ScantableWrapper::getAntennaName)
|
---|
111 | .def("_flag", &ScantableWrapper::flag)
|
---|
112 | .def("_flag_row", &ScantableWrapper::flagRow)
|
---|
113 | .def("_getflagrow", &ScantableWrapper::getFlagRow,
|
---|
114 | (boost::python::arg("whichrow")=0) )
|
---|
115 | .def("_clip", &ScantableWrapper::clip,
|
---|
116 | (boost::python::arg("clipoutside")=true,
|
---|
117 | boost::python::arg("unflag")=false) )
|
---|
118 | .def("_save", &ScantableWrapper::makePersistent)
|
---|
119 | .def("_summary", &ScantableWrapper::summary,
|
---|
120 | (boost::python::arg("filename")=""))
|
---|
121 | .def("_list_header", &ScantableWrapper::listHeader)
|
---|
122 | .def("_getrestfreqs", &ScantableWrapper::getRestFrequency)
|
---|
123 | .def("_setrestfreqs", &ScantableWrapper::setRestFrequencies)
|
---|
124 | .def("shift_refpix", &ScantableWrapper::shift)
|
---|
125 | .def("_setcoordinfo", &ScantableWrapper::setCoordInfo)
|
---|
126 | .def("_getcoordinfo", &ScantableWrapper::getCoordInfo)
|
---|
127 | .def("set_dirframe", &ScantableWrapper::setDirection,
|
---|
128 | (boost::python::arg("refstr")="") )
|
---|
129 | .def("_gethistory", &ScantableWrapper::getHistory)
|
---|
130 | .def("_addhistory", &ScantableWrapper::addHistory)
|
---|
131 | .def("_getselection", &ScantableWrapper::getSelection)
|
---|
132 | .def("_setselection", &ScantableWrapper::setSelection)
|
---|
133 | .def("_addfit", &ScantableWrapper::addFit)
|
---|
134 | .def("_getfit", &ScantableWrapper::getFit)
|
---|
135 | .def("_recalcazel", &ScantableWrapper::calculateAZEL)
|
---|
136 | .def("_setsourcetype", &ScantableWrapper::setSourceType)
|
---|
137 | .def("_getdirectionvec", &ScantableWrapper::getDirectionVector)
|
---|
138 | .def("_parallactify", &ScantableWrapper::parallactify)
|
---|
139 | .def("get_coordinate", &ScantableWrapper::getCoordinate)
|
---|
140 | .def("_get_weather", &ScantableWrapper::getWeather)
|
---|
141 | .def("_reshape", &ScantableWrapper::reshapeSpectrum,
|
---|
142 | (boost::python::arg("nmin")=-1,
|
---|
143 | boost::python::arg("nmax")=-1) )
|
---|
144 | .def("_regrid_specchan", &ScantableWrapper::regridSpecChannel,
|
---|
145 | (boost::python::arg("nchan")=-1) )
|
---|
146 | .def("_poly_baseline", &ScantableWrapper::polyBaseline)
|
---|
147 | .def("_auto_poly_baseline", &ScantableWrapper::autoPolyBaseline)
|
---|
148 | .def("_chebyshev_baseline", &ScantableWrapper::chebyshevBaseline)
|
---|
149 | .def("_auto_chebyshev_baseline", &ScantableWrapper::autoChebyshevBaseline)
|
---|
150 | .def("_cspline_baseline", &ScantableWrapper::cubicSplineBaseline)
|
---|
151 | .def("_auto_cspline_baseline", &ScantableWrapper::autoCubicSplineBaseline)
|
---|
152 | .def("_sinusoid_baseline", &ScantableWrapper::sinusoidBaseline)
|
---|
153 | .def("_auto_sinusoid_baseline", &ScantableWrapper::autoSinusoidBaseline)
|
---|
154 | .def("get_rms", &ScantableWrapper::getRms)
|
---|
155 | .def("format_blparams_row", &ScantableWrapper::formatBaselineParams)
|
---|
156 | .def("format_piecewise_blparams_row", &ScantableWrapper::formatPiecewiseBaselineParams)
|
---|
157 | .def("_getflagtrafast", &ScantableWrapper::getFlagtraFast,
|
---|
158 | (boost::python::arg("whichrow")=0) )
|
---|
159 | .def("_fft", &ScantableWrapper::execFFT)
|
---|
160 | //.def("_sspline_baseline", &ScantableWrapper::smoothingSplineBaseline)
|
---|
161 | //.def("_test_cin", &ScantableWrapper::testCin)
|
---|
162 | .def("_getmolidcol_list", &ScantableWrapper::getMoleculeIdColumnData)
|
---|
163 | .def("_setmolidcol_list", &ScantableWrapper::setMoleculeIdColumnData)
|
---|
164 | ;
|
---|
165 | };
|
---|
166 |
|
---|
167 | } // python
|
---|
168 | } // asap
|
---|