source: trunk/src/python_Scantable.cpp@ 885

Last change on this file since 885 was 884, checked in by mar637, 19 years ago

added setSpectrum

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.1 KB
RevLine 
[2]1//#---------------------------------------------------------------------------
[872]2//# python_Scantable.cc: python exposure of c++ Scantable class
[2]3//#---------------------------------------------------------------------------
4//# Copyright (C) 2004
[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//#
29//# $Id:
30//#---------------------------------------------------------------------------
31#include <vector>
32
33#include <boost/python.hpp>
[16]34#include <boost/python/args.hpp>
[125]35
[872]36#include "ScantableWrapper.h"
[2]37
38using namespace boost::python;
39
[83]40namespace asap {
[2]41 namespace python {
42
[872]43void python_Scantable() {
44 class_<ScantableWrapper>("Scantable")
[96]45 //.def( init <> () )
[872]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 .def("nbeam", &ScantableWrapper::nbeam)
57 .def("npol", &ScantableWrapper::npol)
58 .def("nchan", &ScantableWrapper::nchan)
59 .def("nscan", &ScantableWrapper::nscan)
60 .def("nrow", &ScantableWrapper::nrow)
61 .def("get_fluxunit", &ScantableWrapper::getFluxUnit)
62 .def("set_fluxunit", &ScantableWrapper::setFluxUnit)
63 .def("_setInstrument", &ScantableWrapper::setInstrument)
64 .def("_getspectrum", &ScantableWrapper::getSpectrum,
[884]65 (boost::python::arg("whichrow")=0))
[872]66 /*
67 .def("nstokes", &ScantableWrapper::nStokes)
68 .def("_getstokesspectrum", &ScantableWrapper::getStokesSpectrum,
[884]69 (boost::python::arg("whichrow")=0),
[505]70 (boost::python::arg("linpol")=false) )
[872]71 .def("_stokestopolspectrum", &ScantableWrapper::stokesToPolSpectrum,
[884]72 (boost::python::arg("whichrow")=0),
[494]73 (boost::python::arg("linear")=false),
[539]74 (boost::python::arg("thepol")=-1) )
[872]75 */
76 .def("_getpolarizationlabel", &ScantableWrapper::getPolarizationLabel,
[494]77 (boost::python::arg("linear")=false),
78 (boost::python::arg("stokes")=false),
79 (boost::python::arg("linpol")=false) )
80// (boost::python::arg("thepol")=0) ) // Boost fails with 4 arguments
[884]81 .def("_setspectrum",&ScantableWrapper::setSpectrum,
82 (boost::python::arg("whichrow")=0) )
[872]83 .def("_getabcissa", &ScantableWrapper::getAbcissa,
[884]84 (boost::python::arg("whichrow")=0) )
[872]85 .def("_getabcissalabel", &ScantableWrapper::getAbcissaLabel,
[884]86 (boost::python::arg("whichrow")=0) )
[872]87 .def("_getmask", &ScantableWrapper::getMask,
[884]88 (boost::python::arg("whichrow")=0) )
[872]89 .def("_gettsys", &ScantableWrapper::getTsys)
90 .def("_getsourcename", &ScantableWrapper::getSourceName,
[884]91 (boost::python::arg("whichrow")=0) )
[872]92 .def("_getelevation", &ScantableWrapper::getElevation,
[884]93 (boost::python::arg("whichrow")=0) )
[872]94 .def("_getazimuth", &ScantableWrapper::getAzimuth,
[884]95 (boost::python::arg("whichrow")=0) )
[872]96 .def("_getparangle", &ScantableWrapper::getParAngle,
[884]97 (boost::python::arg("whichrow")=0) )
[872]98 .def("_gettime", &ScantableWrapper::getTime,
[884]99 (boost::python::arg("whichrow")=0) )
[872]100 .def("_flag", &ScantableWrapper::flag)
101 .def("_save", &ScantableWrapper::makePersistent)
102 .def("_summary", &ScantableWrapper::summary,
[745]103 (boost::python::arg("verbose")=true) )
[872]104 .def("_getrestfreqs", &ScantableWrapper::getRestFrequencies)
105 //.def("_setrestfreqs", &ScantableWrapper::setRestFrequencies)
106 .def("_setcoordinfo", &ScantableWrapper::setCoordInfo)
107 .def("_getcoordinfo", &ScantableWrapper::getCoordInfo)
108 .def("_gethistory", &ScantableWrapper::getHistory)
109 .def("_addhistory", &ScantableWrapper::addHistory)
110 .def("_getselection", &ScantableWrapper::getSelection)
111 .def("_setselection", &ScantableWrapper::setSelection)
112 /*
113 .def("_addfit", &ScantableWrapper::addFit)
114 .def("_getfit", &ScantableWrapper::getSDFitTable)
115 */
116 .def("_recalcazel", &ScantableWrapper::calculateAZEL)
[2]117 ;
118};
119
120 } // python
[83]121} // asap
Note: See TracBrowser for help on using the repository browser.