source: trunk/src/python_Scantable.cpp@ 1662

Last change on this file since 1662 was 1598, checked in by Malte Marquarding, 15 years ago

Ticket #170: added scantable.get_coordinate(row). Note that this in the specified reference frame NOT in the basese frame, e.g. usually LSRK/BARY not TOPO. That means that coord.to_frequency(coord.get_rerencepixel()) != coord.get_reference_value(). You need to run {{{freq_align to rectify this

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.9 KB
Line 
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 1598 2009-07-08 01:22:27Z MalteMarquarding $
30//#---------------------------------------------------------------------------
31#include <vector>
32
33#include <boost/python.hpp>
34#include <boost/python/args.hpp>
35
36#include "ScantableWrapper.h"
37
38using namespace boost::python;
39
40namespace asap {
41 namespace python {
42
43void 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("nif", &ScantableWrapper::nif,
61 (boost::python::arg("scanno")=-1) )
62 .def("nbeam", &ScantableWrapper::nbeam,
63 (boost::python::arg("scanno")=-1) )
64 .def("npol", &ScantableWrapper::npol,
65 (boost::python::arg("scanno")=-1) )
66 .def("nchan", &ScantableWrapper::nchan,
67 (boost::python::arg("ifno")=-1) )
68 .def("ncycle", &ScantableWrapper::ncycle,
69 (boost::python::arg("scanno")=-1) )
70 .def("nscan", &ScantableWrapper::nscan)
71 .def("nrow", &ScantableWrapper::nrow)
72 .def("get_fluxunit", &ScantableWrapper::getFluxUnit)
73 .def("set_fluxunit", &ScantableWrapper::setFluxUnit)
74 .def("_setInstrument", &ScantableWrapper::setInstrument)
75 .def("_setfeedtype", &ScantableWrapper::setFeedType)
76 .def("_getspectrum", &ScantableWrapper::getSpectrum,
77 (arg("whichrow")=0, arg("poltype")=std::string("")) )
78 .def("poltype", &ScantableWrapper::getPolType )
79 .def("get_column_names", &ScantableWrapper::columnNames)
80 .def("_getpollabel", &ScantableWrapper::getPolarizationLabel)
81 .def("_setspectrum",&ScantableWrapper::setSpectrum,
82 (boost::python::arg("whichrow")=0) )
83 .def("_getabcissa", &ScantableWrapper::getAbcissa,
84 (boost::python::arg("whichrow")=0) )
85 .def("_getabcissalabel", &ScantableWrapper::getAbcissaLabel,
86 (boost::python::arg("whichrow")=0) )
87 .def("_getmask", &ScantableWrapper::getMask,
88 (boost::python::arg("whichrow")=0) )
89 .def("_gettsys", &ScantableWrapper::getTsys)
90 .def("_getsourcename", &ScantableWrapper::getSourceName,
91 (boost::python::arg("whichrow")=0) )
92 .def("_getelevation", &ScantableWrapper::getElevation,
93 (boost::python::arg("whichrow")=0) )
94 .def("_getazimuth", &ScantableWrapper::getAzimuth,
95 (boost::python::arg("whichrow")=0) )
96 .def("_getparangle", &ScantableWrapper::getParAngle,
97 (boost::python::arg("whichrow")=0) )
98 .def("_gettime", &ScantableWrapper::getTime,
99 (boost::python::arg("whichrow")=0) )
100 .def("_getinttime", &ScantableWrapper::getIntTime,
101 (boost::python::arg("whichrow")=0) )
102 .def("_getdirection", &ScantableWrapper::getDirectionString,
103 (boost::python::arg("whichrow")=0) )
104 .def("get_antennaname", &ScantableWrapper::getAntennaName)
105 .def("_flag", &ScantableWrapper::flag,
106 (boost::python::arg("unflag") = false) )
107 .def("_save", &ScantableWrapper::makePersistent)
108 .def("_summary", &ScantableWrapper::summary,
109 (boost::python::arg("verbose")=true) )
110 .def("_getrestfreqs", &ScantableWrapper::getRestFrequencies)
111 .def("_setrestfreqs", &ScantableWrapper::setRestFrequencies)
112 .def("shift_refpix", &ScantableWrapper::shift)
113 .def("_setcoordinfo", &ScantableWrapper::setCoordInfo)
114 .def("_getcoordinfo", &ScantableWrapper::getCoordInfo)
115 .def("set_dirframe", &ScantableWrapper::setDirection,
116 (boost::python::arg("refstr")="") )
117 .def("_gethistory", &ScantableWrapper::getHistory)
118 .def("_addhistory", &ScantableWrapper::addHistory)
119 .def("_getselection", &ScantableWrapper::getSelection)
120 .def("_setselection", &ScantableWrapper::setSelection)
121 .def("_addfit", &ScantableWrapper::addFit)
122 .def("_getfit", &ScantableWrapper::getFit)
123 .def("_recalcazel", &ScantableWrapper::calculateAZEL)
124 .def("_setsourcetype", &ScantableWrapper::setSourceType)
125 .def("_getdirectionvec", &ScantableWrapper::getDirectionVector)
126 .def("_parallactify", &ScantableWrapper::parallactify)
127 .def("get_coordinate", &ScantableWrapper::getCoordinate)
128 ;
129};
130
131 } // python
132} // asap
Note: See TracBrowser for help on using the repository browser.