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