source: trunk/src/python_asap.cpp@ 2114

Last change on this file since 2114 was 1974, checked in by Takeshi Nakazato, 14 years ago

New Development: Yes

JIRA Issue: Yes CAS-2718

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: New class msfiller and mswriter added

Test Programs: List test programs

Put in Release Notes: No

Module(s): Module Names change impacts.

Description: Describe your changes here...

New filler/writer specific for Scantable-MS conversion defined.
This is not called from scantable constructor right now.
However, you can call it by explicitly importing msfiller/mswriter.


  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.2 KB
RevLine 
[2]1//#---------------------------------------------------------------------------
[875]2//# python_asap.cc: python module for single dish package asap
[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//#
[30]29//# $Id: python_asap.cpp 1974 2011-01-18 06:52:02Z TakeshiNakazato $
[2]30//#---------------------------------------------------------------------------
31#include <string>
32#include <vector>
[125]33
[2]34#include <boost/python.hpp>
[95]35#include <boost/python/exception_translator.hpp>
[2]36
[125]37#include <casa/aips.h>
38#include <casa/Exceptions/Error.h>
[875]39#include "ScantableWrapper.h"
[125]40
[1501]41#ifndef HAVE_LIBPYRAP
42 #include "pyconversions.h"
43#else
44 #include <pyrap/Converters/PycExcp.h>
45 #include <pyrap/Converters/PycBasicData.h>
[1901]46 #include <pyrap/Converters/PycValueHolder.h>
47 #include <pyrap/Converters/PycRecord.h>
[1501]48#endif
[875]49
50#include "python_asap.h"
[2]51
[1501]52#ifndef HAVE_LIBPYRAP
[95]53namespace asap {
54 namespace python {
[1501]55
[125]56void translate_ex(const casa::AipsError& e)
[95]57{
58 // Use the Python 'C' API to set up an exception object
59 PyErr_SetString(PyExc_RuntimeError, e.what());
60}
61
62 }
63}
[1501]64#endif
65
[2]66using namespace boost::python;
67
[95]68BOOST_PYTHON_MODULE(_asap) {
[875]69 asap::python::python_Scantable();
70 asap::python::python_STFiller();
[1819]71 asap::python::python_Filler();
[1974]72 asap::python::python_MSFiller();
[875]73 asap::python::python_STSelector();
74 asap::python::python_STMath();
[894]75 asap::python::python_Fitter();
[881]76 asap::python::python_STLineFinder();
[960]77 asap::python::python_STFitEntry();
[988]78 asap::python::python_STWriter();
[1974]79 asap::python::python_MSWriter();
[1126]80 asap::python::python_LineCatalog();
[1501]81 asap::python::python_Logger();
[1819]82 asap::python::python_LogSink();
[1598]83 asap::python::python_STCoordinate();
[1715]84 asap::python::python_STAtmosphere();
[1819]85 asap::python::python_SrcType();
[988]86
[1501]87#ifndef HAVE_LIBPYRAP
88 // Use built-in pyconversions.h
[125]89 register_exception_translator<casa::AipsError>(&asap::python::translate_ex);
[875]90 from_python_sequence < std::vector< asap::ScantableWrapper >,
91 variable_capacity_policy > ();
[2]92 std_vector_to_tuple < int > ();
[95]93 from_python_sequence < std::vector < int >,
[2]94 variable_capacity_policy > ();
[1112]95 std_vector_to_tuple < uint > ();
96 from_python_sequence < std::vector < uint >,
97 variable_capacity_policy > ();
[2]98 std_vector_to_tuple < float > ();
[95]99 from_python_sequence < std::vector < float >,
[2]100 variable_capacity_policy > ();
[42]101 std_vector_to_tuple < double > ();
[95]102 from_python_sequence < std::vector < double >,
[42]103 variable_capacity_policy > ();
[2]104 std_vector_to_tuple < std::string > ();
[95]105 from_python_sequence < std::vector < std::string >,
[2]106 variable_capacity_policy > ();
107 std_vector_to_tuple < bool> ();
[95]108 from_python_sequence < std::vector < bool >,
[2]109 variable_capacity_policy > ();
[1501]110#else
111 casa::pyrap::register_convert_excp();
112 casa::pyrap::register_convert_basicdata();
113 casa::pyrap::register_convert_std_vector<asap::ScantableWrapper>();
[1901]114 casa::pyrap::register_convert_std_vector<int>();
115 casa::pyrap::register_convert_std_vector<uint>();
116 casa::pyrap::register_convert_std_vector<float>();
117 casa::pyrap::register_convert_std_vector<double>();
118 casa::pyrap::register_convert_std_vector<std::string>();
119 casa::pyrap::register_convert_std_vector<bool>();
120 casa::pyrap::register_convert_casa_valueholder();
121 casa::pyrap::register_convert_casa_record();
[1501]122#endif
[2]123}
Note: See TracBrowser for help on using the repository browser.