[2] | 1 | //#---------------------------------------------------------------------------
|
---|
| 2 | //# python_SD.cc: python module for single dish package
|
---|
| 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 | //#
|
---|
[30] | 29 | //# $Id: python_SD.cc 465 2005-02-17 03:46:17Z mar637 $
|
---|
[2] | 30 | //#---------------------------------------------------------------------------
|
---|
| 31 | #include <string>
|
---|
| 32 | #include <vector>
|
---|
[125] | 33 |
|
---|
[2] | 34 | #include <boost/python.hpp>
|
---|
| 35 | #include <boost/python/pyconversions.h>
|
---|
[95] | 36 | #include <boost/python/exception_translator.hpp>
|
---|
[2] | 37 |
|
---|
[125] | 38 | #include <casa/aips.h>
|
---|
| 39 | #include <casa/Exceptions/Error.h>
|
---|
| 40 |
|
---|
[2] | 41 | #include "python_SD.h"
|
---|
| 42 |
|
---|
[95] | 43 | namespace asap {
|
---|
| 44 | namespace python {
|
---|
[125] | 45 | void translate_ex(const casa::AipsError& e)
|
---|
[95] | 46 | {
|
---|
| 47 | // Use the Python 'C' API to set up an exception object
|
---|
| 48 | PyErr_SetString(PyExc_RuntimeError, e.what());
|
---|
| 49 | }
|
---|
| 50 |
|
---|
| 51 | }
|
---|
| 52 | }
|
---|
[2] | 53 | using namespace boost::python;
|
---|
| 54 |
|
---|
[95] | 55 | BOOST_PYTHON_MODULE(_asap) {
|
---|
[83] | 56 | asap::python::python_SDMemTable();
|
---|
| 57 | asap::python::python_SDReader();
|
---|
| 58 | asap::python::python_SDWriter();
|
---|
| 59 | asap::python::python_SDMath();
|
---|
[95] | 60 | asap::python::python_SDFitter();
|
---|
[465] | 61 | asap::python::python_SDFitTable();
|
---|
[297] | 62 | asap::python::python_SDLineFinder();
|
---|
[2] | 63 |
|
---|
[125] | 64 | register_exception_translator<casa::AipsError>(&asap::python::translate_ex);
|
---|
[95] | 65 |
|
---|
[2] | 66 | std_vector_to_tuple < int > ();
|
---|
[95] | 67 | from_python_sequence < std::vector < int >,
|
---|
[2] | 68 | variable_capacity_policy > ();
|
---|
| 69 | std_vector_to_tuple < float > ();
|
---|
[95] | 70 | from_python_sequence < std::vector < float >,
|
---|
[2] | 71 | variable_capacity_policy > ();
|
---|
[42] | 72 | std_vector_to_tuple < double > ();
|
---|
[95] | 73 | from_python_sequence < std::vector < double >,
|
---|
[42] | 74 | variable_capacity_policy > ();
|
---|
[2] | 75 | std_vector_to_tuple < std::string > ();
|
---|
[95] | 76 | from_python_sequence < std::vector < std::string >,
|
---|
[2] | 77 | variable_capacity_policy > ();
|
---|
| 78 | std_vector_to_tuple < bool> ();
|
---|
[95] | 79 | from_python_sequence < std::vector < bool >,
|
---|
[2] | 80 | variable_capacity_policy > ();
|
---|
| 81 | }
|
---|