89#ifndef __GyotoPython_H_
90#define __GyotoPython_H_
261 virtual void klass(
const std::string& c);
348 virtual void
klass(const std::string&);
352 virtual double operator()(double nu) const;
353 virtual double operator()(double nu, double opacity, double ds) const;
391 PyObject * pChristoffel_;
404 void spherical(bool);
405 bool spherical() const;
411 virtual void
klass(const std::string&);
415 virtual void mass(double m);
418 void gmunu(double g[4][4], const double * x) const ;
419 int christoffel(double dst[4][4][4], const double * x) const ;
439 PyObject *pEmission_, *pIntegrateEmission_, *pTransmission_, *
pCall_,
440 *pGetVelocity_, *pGiveDelta_;
441 bool pEmission_overloaded_, pIntegrateEmission_overloaded_;
454 virtual double emission(double nu_em, double dsem, state_t const &coord_ph,
455 double const coord_obj[8]=NULL) const ;
457 virtual void emission(double Inu[], double const nu_em[], size_t nbnu,
458 double dsem, state_t const &coord_ph,
459 double const coord_obj[8]=NULL) const ;
461 virtual double integrateEmission(double nu1, double nu2, double dsem,
462 state_t const &c_ph, double const c_obj[8]=NULL) const;
464 virtual void integrateEmission(double * I, double const * boundaries,
465 size_t const * chaninds, size_t nbnu,
466 double dsem, state_t const &cph, double const *co) const;
468 virtual double transmission(double nuem, double dsem, state_t const &cph, double const *co) const ;
471 virtual double operator()(double const coord[4]) ;
472 virtual void getVelocity(double const pos[4], double vel[4]) ;
473 virtual double giveDelta(double coord[8]);
481 virtual void
klass(const std::string&);
484 virtual double criticalValue() const ;
485 virtual void criticalValue(double) ;
505 PyObject *pEmission_, *pIntegrateEmission_, *pTransmission_, *
pCall_,
506 *pGetVelocity_, *pGiveDelta_;
507 bool pEmission_overloaded_, pIntegrateEmission_overloaded_;
520 virtual double emission(double nu_em, double dsem, state_t const &coord_ph,
521 double const coord_obj[8]=NULL) const ;
523 virtual void emission(double Inu[], double const nu_em[], size_t nbnu,
524 double dsem, state_t const &coord_ph,
525 double const coord_obj[8]=NULL) const ;
527 virtual double integrateEmission(double nu1, double nu2, double dsem,
528 state_t const &c_ph, double const c_obj[8]=NULL) const;
530 virtual void integrateEmission(double * I, double const * boundaries,
531 size_t const * chaninds, size_t nbnu,
532 double dsem, state_t const &cph, double const *co) const;
534 virtual double transmission(double nuem, double dsem, state_t const &cph ,double const *co) const ;
537 virtual double operator()(double const coord[4]) ;
538 virtual void getVelocity(double const pos[4], double vel[4]) ;
546 virtual void
klass(const std::string&);
Base class for metric description.
#define GYOTO_OBJECT_THREAD_SAFETY
Declare virtual bool isThreadSafe() const.
Definition: GyotoObject.h:99
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:84
Spectrum of a simple object (e.g. Star)
Astronomical objects defined bya a potential/distance.
Geometrically thin disks and rings.
Coding a Gyoto::Astrobj::Standard in Python.
Definition: GyotoPython.h:435
Coding a Gyoto::Astrobj::ThinDisk in Python.
Definition: GyotoPython.h:501
Astronomical objects defined bya a potential/distance.
Definition: GyotoStandardAstrobj.h:87
Geometrically thin disks and rings.
Definition: GyotoThinDisk.h:71
Base class for metrics.
Definition: GyotoMetric.h:162
double mass() const
Get mass used in unitLength()
Metric coded in Python.
Definition: GyotoPython.h:378
Base class for classes in the Python plug-in.
Definition: GyotoPython.h:175
virtual void inlineModule(const std::string &)
Set inline_module_ and import the Python module.
virtual void module(const std::string &)
Set module_ and import the Python module.
std::string class_
Name of the Python class that we want to expose.
Definition: GyotoPython.h:196
virtual std::string inlineModule() const
Return inline_module_.
std::string module_
Name of the Python module that holds the class.
Definition: GyotoPython.h:183
virtual std::string klass() const
Retrieve class_.
virtual std::string module() const
Return module_.
std::vector< double > parameters_
Parameters that this class needs.
Definition: GyotoPython.h:205
PyObject * pInstance_
Reference to the python instance once it has been instantiated.
Definition: GyotoPython.h:215
virtual void klass(const std::string &c)
Set class_ and instantiate the Python class.
virtual void parameters(const std::vector< double > &)
Set parameters_ and send them to pInstance_.
std::string inline_module_
Python source code for module that holds the class.
Definition: GyotoPython.h:189
virtual std::vector< double > parameters() const
Retrieve parameters_.
PyObject * pModule_
Reference to the python module once it has been loaded.
Definition: GyotoPython.h:210
Pointers performing reference counting.
Definition: GyotoSmartPointer.h:135
Spectrum emitted by an Astrobj.
Definition: GyotoSpectrum.h:137
Loader for Python classes implementing the Spectrum interface.
Definition: GyotoPython.h:293
PyObject * pCall_
Reference to ___call__.
Definition: GyotoPython.h:303
virtual std::string inlineModule() const
Return inline_module_.
bool pCall_overloaded_
Whether call is overloaded.
Definition: GyotoPython.h:327
virtual Python * clone() const
Cloner.
virtual std::vector< double > parameters() const
Retrieve parameters_.
virtual std::string klass() const
Retrieve class_.
virtual std::string module() const
Return module_.
virtual double integrate(double nu1, double nu2)
Integrate optically thick I_nu.
PyObject * pIntegrate_
Reference to the (optional) integrate method.
Definition: GyotoPython.h:308
PyObject * pGyotoThinDisk()
Get reference to the ThinDisk constructor in the gyoto Python extension.
PyObject * pGyotoSpectrum()
Get reference to the Spectrum constructor in the gyoto Python extension.
PyObject * PyImport_Gyoto()
Return refernce to the gyoto module, or NULL.
PyObject * PyInstance_GetMethod(PyObject *pInstance, const char *name)
Return new reference to method, or NULL if method not found.
PyObject * PyModule_NewFromPythonCode(const char *code)
Create module from Python source code in a C string.
PyObject * pGyotoMetric()
Get reference to the Metric constructor in the gyoto Python extension.
void PyInstance_SetThis(PyObject *pInstance, PyObject *pNew, void *ptr)
Set "this" attribute in instance.
PyObject * pGyotoStandardAstrobj()
Get reference to the StandardAstrobj constructor in the gyoto Python extension.
bool PyCallable_HasVarArg(PyObject *pMethod)
Check whether method accepts the varargs argument.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43