source: trunk/src/python_STGrid.cpp@ 2675

Last change on this file since 2675 was 2671, checked in by Takeshi Nakazato, 12 years ago

New Development: No

JIRA Issue: Yes CAS-4429

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Implemented gauss and gjinc gridding. Added some arguments to
pass necessary parameters for those grid functions.

Also, defined helper function that plots current grid function
against radius in pixel.


File size: 2.7 KB
RevLine 
[2356]1//#---------------------------------------------------------------------------
2//# python_STGrid.cc: python exposure of c++ STGrid class
3//#---------------------------------------------------------------------------
[2526]4#include <boost/python.hpp>
5#include <boost/python/args.hpp>
6
[2356]7#include <string>
[2360]8#include <vector>
[2356]9
10#include "STGrid.h"
[2593]11#include "ScantableWrapper.h"
[2356]12
13using namespace boost::python;
14
15namespace asap {
16 namespace python {
17
18void python_STGrid() {
19 class_<STGrid>("stgrid")
20 .def( init <> () )
21 .def( init < const std::string > () )
[2390]22 .def( init < const std::vector<std::string> > () )
[2362]23 .def("_setif", &STGrid::setIF)
[2360]24 .def("_setpollist", &STGrid::setPolList)
[2364]25 .def("_setscanlist", &STGrid::setScanList)
[2671]26 .def("_defineimage", &STGrid::defineImage,
27 (boost::python::arg("nx")=-1,
28 boost::python::arg("ny")=-1,
29 boost::python::arg("scellx")="",
30 boost::python::arg("scelly")="",
31 boost::python::arg("scenter")=""))
32 .def("_setfunc", &STGrid::setFunc,
33 (boost::python::arg("convsupport")=-1,
34 boost::python::arg("truncate")="",
35 boost::python::arg("gwidth")="",
36 boost::python::arg("jwidth")=""))
[2356]37 .def("_grid", &STGrid::grid)
38 .def("_setin", &STGrid::setFileIn)
[2390]39 .def("_setfiles", &STGrid::setFileList)
[2361]40 .def("_setweight", &STGrid::setWeight)
[2396]41 .def("_enableclip", &STGrid::enableClip)
42 .def("_disableclip", &STGrid::disableClip)
[2356]43 .def("_save", &STGrid::saveData)
[2671]44 .def("_getfunc", &STGrid::getConvFunc)
[2356]45 ;
[2593]46
47 class_<STGrid2>("stgrid2")
48 .def( init <> () )
49 .def( init < const ScantableWrapper & > () )
50 .def( init < const std::vector<ScantableWrapper> & > () )
51 .def("_setif", &STGrid2::setIF)
52 .def("_setpollist", &STGrid2::setPolList)
53 .def("_setscanlist", &STGrid2::setScanList)
[2671]54 .def("_defineimage", &STGrid2::defineImage,
55 (boost::python::arg("nx")=-1,
56 boost::python::arg("ny")=-1,
57 boost::python::arg("scellx")="",
58 boost::python::arg("scelly")="",
59 boost::python::arg("scenter")=""))
60 .def("_setfunc", &STGrid2::setFunc,
61 (boost::python::arg("convsupport")=-1,
62 boost::python::arg("truncate")="",
63 boost::python::arg("gwidth")="",
64 boost::python::arg("jwidth")=""))
[2593]65 .def("_grid", &STGrid2::grid)
66 .def("_setin", &STGrid2::setScantable)
67 .def("_setfiles", &STGrid2::setScantableList)
68 .def("_setweight", &STGrid2::setWeight)
69 .def("_enableclip", &STGrid2::enableClip)
70 .def("_disableclip", &STGrid2::disableClip)
71 .def("_get", &STGrid2::getResultAsScantable)
[2671]72 .def("_getfunc", &STGrid2::getConvFunc)
[2593]73 ;
74
[2356]75};
76
77 } // python
78} // asap
Note: See TracBrowser for help on using the repository browser.