Gyoto::Astrobj::Properties Class Reference

Observable properties of an Astronomical object. More...

#include <GyotoAstrobj.h>

Inheritance diagram for Gyoto::Astrobj::Properties:

List of all members.

Public Types

typedef Gyoto::SmartPointer
< Gyoto::SmartPointee
Subcontractor_t (Gyoto::FactoryMessenger *, std::vector< std::string > const &)
 A subcontractor builds an object upon order from the Factory.

Public Member Functions

 Properties ()
 Default constructor (everything is set to NULL);.
 Properties (double *, double *)
 < Set intensity and time pointers.
void init (size_t nbnuobs=0)
 Initialize observable quantities.
Propertiesoperator++ ()
 Increment pointers.
Propertiesoperator+= (ptrdiff_t offset)
 Increment pointers by offset.
 operator Gyoto::Quantity_t () const
void incRefCount ()
 Increment the reference counter. Warning: Don't mess with the counter.
int decRefCount ()
 Decrement the reference counter and return current value. Warning: Don't mess with the counter.
int getRefCount ()
 Get the current number of references.

Public Attributes

double * intensity
double * time
double * distance
double * first_dmin
int first_dmin_found
 Whether Properties::first_dmin was found.
double * redshift
double * spectrum
double * binspectrum
ptrdiff_t offset
 How to jump from one spectral element to the next.
double * impactcoords
double * user1
 GYOTO_QUANTITY_USER1 : User1 Astrobj-specific quantity.
double * user2
 GYOTO_QUANTITY_USER2 : User2 Astrobj-specific quantity.
double * user3
 GYOTO_QUANTITY_USER3 : User3 Astrobj-specific quantity.
double * user4
 GYOTO_QUANTITY_USER4 : User4 Astrobj-specific quantity.
double * user5
 GYOTO_QUANTITY_USER5 : User5 Astrobj-specific quantity.
bool alloc
 True if buffers are allocated for entire field (npix*npix).


class Gyoto::SmartPointer< Gyoto::Astrobj::Properties >

Detailed Description

Observable properties of an Astronomical object.

The sort of properties one wants to measure on a ray-traced Gyoto::Photon which hits a Gyoto::Astrobj. Not all Astrobj are able to fill all of these properties.

An instance of Properties essentially contains a bunch of pointers to memory areas where the observable quantities (see Quantity_t) should be stored.

Astrobj::Generic::processHitQuantities() fills the various arrays upon request. A quantity is ignored if the corresponding pointer is NULL.

Scenery::operator()() increments the Properties between each Photon using Properties::operator++().

The main application (gyoto, the yorick plug-in, or your user application) is responsible for allocating the various arrays, filling the various members of Properties, and doing whatever meaninful with the arrays after they have been filled with values by the ray-tracing code (e.g. saving them to disk or displaying them).

Also see Gyoto::Scenery and Gyoto::Quantity_t.

Member Typedef Documentation

typedef Gyoto::SmartPointer<Gyoto::SmartPointee> Gyoto::SmartPointee::Subcontractor_t(Gyoto::FactoryMessenger *, std::vector< std::string > const &) [inherited]

A subcontractor builds an object upon order from the Factory.

Various classes need to provide a subcontractor to be able to instantiate themselves upon order from the Factory. A subcontractor is a function (often a static member function) which accepts a pointer to a FactoryMessenger as unique parameter, communicates with the Factory using this messenger to read an XML description of the object to build, and returns this objet. SmartPointee::Subcontractor_t* is just generic enough a typedef to cast to and from other subcontractor types: Astrobj::Subcontractor_t, Metric::Subcontractor_t, Spectrum::Subcontractor_t. A subcontractor needs to be registered using the relevant Register() function: Astrobj::Register(), Metric::Register(), Spectrum::Register().

Member Function Documentation

void Gyoto::Astrobj::Properties::init ( size_t  nbnuobs = 0  ) 

Initialize observable quantities.

The pointed-to values are initialized as follows (if the corresponding pointer is not NULL):

  • intensity, firt_dmin_found, redshift, userN: 0
  • time, distance, first_dmin: DBL_MAX
  • for spectrum and binspectrum, nbnuobs values separated by offset in memory are initialized to 0
  • for impactcoords, 16 contiguous values are initialized to DBL_MAX
Properties& Gyoto::Astrobj::Properties::operator++ (  ) 

Increment pointers.

All valid pointers are incremented by 1 (sizeof(double)), excepted impactcoords which is incremented by 16.

Properties& Gyoto::Astrobj::Properties::operator+= ( ptrdiff_t  offset  ) 

Increment pointers by offset.

All valid pointers are incremented by offset (sizeof(double)), excepted impactcoords which is incremented by 16*offset.

Member Data Documentation


I12, the integral of I over each spectral channel (i.e. what a spectrometer would measure)


Behaves like the square of the closest distance between Photon and Astrobj (but not exactly that). Initialize it to DBL_MAX from float.h.;


First local minimum in distance from object

Whether Properties::first_dmin was found.

Properties::first_dmin will be set to the first local minimum and Properties::first_dmin_found will be set to 1 if a local minimum in distance is found. Initialize it to 0.


Coordinates of the object and photon at impact

How to jump from one spectral element to the next.

Spectra elements are separated by offset doubles in memory. In other words, the ith spectral element is spectrum[i*offset].


Redshift factor obs/em (necessary for emission lines computation)


I () (observed specific intensity)

The documentation for this class was generated from the following file:

Generated on 6 May 2017 for Gyoto by  doxygen 1.6.1