00001
00012 #ifdef _MSC_VER
00013
00014 # pragma warning(disable:4231)
00015
00016
00017 # pragma warning(disable:4251)
00018
00019
00020 # pragma warning(disable:4275)
00021
00022
00023 # pragma warning(disable:4800)
00024 #endif
00025
00026
00027 #include <boost/python.hpp>
00028
00029 #include "PyFitsController.h"
00030 #include "PyDataSource.h"
00031
00032 #include "fits/FitsNTuple.h"
00033
00034 using namespace boost::python;
00035
00036 namespace hippodraw {
00037 namespace Python {
00038
00039 void
00040 export_FitsController()
00041 {
00042 class_ < PyFitsController, bases<>,
00043 PyFitsController, boost::noncopyable >
00044 ( "FitsController",
00045 "A class for creation of DataSource objects from a FITS file.",
00046 no_init )
00047
00048 .def ( "instance", &PyFitsController::instance,
00049 return_value_policy < reference_existing_object > (),
00050 "instance () -> FitsController\n"
00051 "\n"
00052 "Returns the single instance of the controller." )
00053
00054 .staticmethod( "instance" )
00055
00056 .def ( "getNTupleNames",
00057 &PyFitsController::getNTupleNames,
00058 return_value_policy < copy_const_reference > (),
00059 "getNTupleNames ( string ) -> sequence\n"
00060 "\n"
00061 "Returns the names of the HDU data source objects in the file." )
00062
00063 .def ( "createNTuple",
00064 &PyFitsController::createNTuple,
00065 return_value_policy < manage_new_object > (),
00066 "createNTuple ( string, string ) -> FitsNTuple\n"
00067 "\n"
00068 "Creates FitsNTuple from the named file with key name. Python \n"
00069 "take possession of it." )
00070
00071 .def ( "createDataArray",
00072 &PyFitsController::createDataArray,
00073 return_value_policy < reference_existing_object > (),
00074 "createDataArray ( string, string ) -> DataArray\n"
00075 "\n"
00076 "Creates DataArray from a file with key name" )
00077
00078 .def ( "writeToFile",
00079 ( void ( PyFitsController::* )
00080 ( const PyDataSource *,
00081 const std::string & ) )
00082 &PyFitsController::writeToFile,
00083 "writeToFile ( DataArray, filename ) -> None.\n"
00084 "writeToFile ( DataSource, filename ) -> None,\n"
00085 "writeToFile ( DataArray, filename, tuple, tuple ) -> None.\n"
00086 "writeToFile ( DataSource, filename, tuple, tuple ) -> None,\n"
00087 "\n"
00088 "Writes a DataSource or DataArray to FITS file as binary table.\n"
00089 "In the latter two forms, the first tuple is list of Cuts and\n"
00090 "and the second is tuple of column labels" )
00091
00092 .def ( "writeToFile",
00093 ( void ( PyFitsController::* )
00094 ( const DataSource *,
00095 const std::string & ) )
00096 &PyFitsController::writeToFile )
00097
00098 .def ( "writeToFile",
00099 ( void ( PyFitsController::* )
00100 ( const DataSource *,
00101 const std::string &,
00102 const std::vector < QtCut * > &,
00103 const std::vector < std::string > & ) )
00104 &PyFitsController::writeToFile )
00105
00106 .def ( "writeToFile",
00107 ( void ( PyFitsController::* )
00108 ( const PyDataSource *,
00109 const std::string &,
00110 const std::vector < QtCut * > &,
00111 const std::vector < std::string > & ) )
00112 &PyFitsController::writeToFile )
00113 ;
00114
00115 }
00116
00117 }
00118 }