export_FitsController.cxx
Go to the documentation of this file.
1 
12 #ifdef _MSC_VER
13 // nonstandard extension used 'extern' before...
14 # pragma warning(disable:4231)
15 
16 // needs to have dll-interface used by client
17 # pragma warning(disable:4251)
18 
19 // non dll-interface struct
20 # pragma warning(disable:4275)
21 
22 // 'int' : forcing value to bool 'true' or 'false' (performance warning)
23 # pragma warning(disable:4800)
24 #endif
25 
26 // include first to avoid _POSIX_C_SOURCE warning.
27 #include <boost/python.hpp>
28 
29 #include "PyFitsController.h"
30 #include "PyDataSource.h"
31 
32 #include "fits/FitsNTuple.h"
33 
34 using namespace boost::python;
35 
36 namespace hippodraw {
37 namespace Python {
38 
39 void
41 {
42  class_ < PyFitsController, bases<>,
43  PyFitsController, boost::noncopyable >
44  ( "FitsController",
45  "A class for creation of DataSource objects from a FITS file.",
46  no_init )
47 
48  .def ( "instance", &PyFitsController::instance,
49  return_value_policy < reference_existing_object > (),
50  "instance () -> FitsController\n"
51  "\n"
52  "Returns the single instance of the controller." )
53 
54  .staticmethod( "instance" )
55 
56  .def ( "getNTupleNames",
57  &PyFitsController::getNTupleNames,
58  return_value_policy < copy_const_reference > (),
59  "getNTupleNames ( string ) -> sequence\n"
60  "\n"
61  "Returns the names of the HDU data source objects in the file." )
62 
63  .def ( "createNTuple",
64  &PyFitsController::createNTuple,
65  return_value_policy < manage_new_object > (),
66  "createNTuple ( string, string ) -> FitsNTuple\n"
67  "\n"
68  "Creates FitsNTuple from the named file with key name. Python \n"
69  "take possession of it." )
70 
71  .def ( "createDataArray",
72  &PyFitsController::createDataArray,
73  return_value_policy < reference_existing_object > (),
74  "createDataArray ( string, string ) -> DataArray\n"
75  "\n"
76  "Creates DataArray from a file with key name" )
77 
78  .def ( "writeToFile",
79  ( void ( PyFitsController::* ) // function pointer cast
80  ( const PyDataSource *, // function signature
81  const std::string & ) )
82  &PyFitsController::writeToFile,
83  "writeToFile ( DataArray, filename ) -> None.\n"
84  "writeToFile ( DataSource, filename ) -> None,\n"
85  "writeToFile ( DataArray, filename, tuple, tuple ) -> None.\n"
86  "writeToFile ( DataSource, filename, tuple, tuple ) -> None,\n"
87  "\n"
88  "Writes a DataSource or DataArray to FITS file as binary table.\n"
89  "In the latter two forms, the first tuple is list of Cuts and\n"
90  "and the second is tuple of column labels" )
91 
92  .def ( "writeToFile",
93  ( void ( PyFitsController::* ) // function pointer cast
94  ( const DataSource *, // function signature
95  const std::string & ) )
96  &PyFitsController::writeToFile )
97 
98  .def ( "writeToFile",
99  ( void ( PyFitsController::* ) // function pointer
100  ( const DataSource *, // function signature
101  const std::string &,
102  const std::vector < QtCut * > &,
103  const std::vector < std::string > & ) )
104  &PyFitsController::writeToFile )
105 
106  .def ( "writeToFile",
107  ( void ( PyFitsController::* ) // function pointer
108  ( const PyDataSource *, // function signature
109  const std::string &,
110  const std::vector < QtCut * > &,
111  const std::vector < std::string > & ) )
112  &PyFitsController::writeToFile )
113  ;
114 
115 }
116 
117 } // namespace Python
118 } // namespace hippodraw

Generated for HippoDraw Class Library by doxygen