Gyoto
|
The camera with which the Astrobj is observed. More...
#include <GyotoScreen.h>
Public Member Functions | |
Screen () | |
Default constructor. | |
Screen (const Screen &) | |
Copy constructor. | |
Screen * | clone () const |
Cloner. | |
virtual | ~Screen () |
Destructor. | |
void | setProjection (const double paln, const double inclination, const double argument) |
Set inclination etc. | |
void | setProjection (const double distance, const double paln, const double inclination, const double argument) |
Set distance, inclination etc. | |
void | setDistance (double dist) |
Set distance from observer. More... | |
void | setDmax (double dist) |
Set ray-tracing maximum distance. More... | |
void | setDistance (double dist, const std::string unit) |
Set distance from observer. More... | |
void | setInclination (double) |
Set inclination relative to line-of-sight. More... | |
void | setInclination (double, const std::string &unit) |
Set inclination relative to line-of-sight. More... | |
void | setPALN (double) |
Set position angle of the line of nodes. | |
void | setPALN (double, const std::string &unit) |
Set position angle of the line of nodes. | |
void | setArgument (double) |
Set angle beetwen line of nodes and X axis of object. | |
void | setArgument (double, const std::string &unit) |
Set angle beetwen line of nodes and X axis of object. | |
void | setSpectrometer (SmartPointer< Spectrometer::Generic > spectro) |
Set Screen::spectro_. | |
SmartPointer < Spectrometer::Generic > | getSpectrometer () const |
Get Screen::spectro_. | |
void | setFreqObs (double fo) |
Set freq_obs_. More... | |
void | setFreqObs (double fo, const std::string &unit) |
Set freq_obs_. More... | |
double | getFreqObs () const |
Get freq_obs_. | |
double | getFreqObs (const std::string &unit) const |
Get freq_obs_. More... | |
void | setObserverPos (const double pos[4]) |
Alternative way to set projection. More... | |
void | setFourVel (const double coord[4]) |
Sets the observer's 4-velocity. | |
void | setScreen1 (const double coord[4]) |
Sets the screen vector e1. | |
void | setScreen2 (const double coord[4]) |
Sets the screen vector e2. | |
void | setScreen3 (const double coord[4]) |
Sets the screen vector e3 (normal) | |
int | getCoordKind () const |
Get coordinate kind. More... | |
double | getDistance () const |
Get distance from observer. More... | |
double | getDistance (const std::string &) const |
Get distance from observer. More... | |
double | getDmax () const |
Get maximum ray-tracing distance. More... | |
double | getInclination () const |
Get inclination relative to line-of-sight. More... | |
double | getInclination (const std::string &) const |
Get inclination relative to line-of-sight. More... | |
double | getPALN () const |
Get position angle of the line of nodes. | |
double | getPALN (const std::string &) const |
Get position angle of the line of nodes. | |
double | getArgument () const |
Get angle between line of nodes and X axis of object. | |
double | getArgument (const std::string &) const |
Get angle between line of nodes and X axis of object. | |
SmartPointer< Metric::Generic > | getMetric () const |
Get Screen::gg_. | |
void | setMetric (SmartPointer< Metric::Generic > gg) |
Set Screen::gg_. | |
double | getTime () |
Get observing date in seconds. | |
double | getTime (const std::string &) |
Get observing date in seconds. | |
void | setTime (double, const std::string &) |
Set observing date in specified unit. | |
void | setTime (double) |
Set observing date in seconds. | |
double | getFieldOfView () |
Get Screen::fov_ in radians. | |
double | getFieldOfView (std::string unit) |
Get Screen::fov_ in specified unit. | |
void | setFieldOfView (double) |
Set Screen::fov_ in radians. | |
void | setFieldOfView (double, const std::string &unit) |
Set Screen::fov_ in specified unit. | |
void | setAlpha0 (double) |
Set direction of the line-of-view. | |
void | setDelta0 (double) |
Set direction of the line-of-view. | |
void | setAnglekind (int) |
Set Screen::anglekind_. | |
size_t | getResolution () |
Get Screen::npix_. | |
void | setResolution (size_t) |
Set Screen::npix_. | |
void | getObserverPos (double coord[]) const |
4-Position of the observer relative to the metric More... | |
void | getFourVel (double fourvel[]) const |
Get copy of Screen::fourvel_. More... | |
void | getScreen1 (double output[]) const |
Get copy of Screen::screen1_. More... | |
void | getScreen2 (double output[]) const |
Get copy of Screen::screen2_. More... | |
void | getScreen3 (double output[]) const |
Get copy of Screen::screen3_. More... | |
void | getRayCoord (double x, double y, double coord[]) const |
Get 8-coordinate of Photon hitting screen from a given direction. More... | |
void | getRayCoord (const size_t i, const size_t j, double coord[]) const |
Get 8-coordinate of Photon hitting screen pixel. More... | |
void | coordToSky (const double pos[4], double skypos[3]) const |
Convert 4-position to 3-sky position. | |
void | coordToXYZ (const double pos[4], double xyz[3]) const |
Convert 4-position to 3-cartesian coordinates. | |
void | computeBaseVectors () |
Compute base vectors according to projection parameters. | |
std::ostream & | print (std::ostream &) const |
Display. More... | |
std::ostream & | printBaseVectors (std::ostream &) const |
Debug helper. | |
void | mapPixUnit () |
Map "pix" and "pixel" to angular pixel width in unit system. More... | |
void | unmapPixUnit () |
Unmap "pix" and "pixel" from unit system. More... | |
void | fillElement (FactoryMessenger *fmp) |
Static Public Member Functions | |
static SmartPointer< Screen > | Subcontractor (FactoryMessenger *fmp) |
Instanciate a Screen from XML entity. | |
Protected Types | |
typedef Gyoto::SmartPointer < Gyoto::SmartPointee > | Subcontractor_t (Gyoto::FactoryMessenger *) |
A subcontractor builds an object upon order from the Factory. More... | |
Protected Member Functions | |
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. | |
Private Attributes | |
double | tobs_ |
Observing date in s. | |
double | fov_ |
Field-of-view in rad. | |
size_t | npix_ |
Resolution in pixels. | |
double | distance_ |
Distance to the observer in m. | |
double | dmax_ |
Maximum distance from which the photons are launched (geometrical units) | |
int | anglekind_ |
Screen angles kind (0: equatorial, 1: spherical) | |
double | euler_ [3] |
Euler angles. More... | |
double | ex_ [3] |
Sky coordinate of base X vector. | |
double | ey_ [3] |
Sky coordinate of base Y vector. | |
double | ez_ [3] |
Sky coordinate of base Z vector. | |
double | fourvel_ [4] |
Observer's 4-velocity. | |
double | screen1_ [4] |
Screen e1 vector. | |
double | screen2_ [4] |
Screen e2 vector. | |
double | screen3_ [4] |
Screen e3 vector (normal) | |
double | alpha0_ |
Screen orientation (0,0) is right towards the BH. | |
double | delta0_ |
Screen orientation (0,0) is right towards the BH. | |
SmartPointer< Metric::Generic > | gg_ |
The Metric in this end of the Universe. | |
SmartPointer < Spectrometer::Generic > | spectro_ |
Gyoto::Spectrometer::Generic subclass instance used for quantities Spectrum and BinSpectrum. | |
double | freq_obs_ |
Frequency at which the observer observes. More... | |
Friends | |
class | Gyoto::SmartPointer< Gyoto::Screen > |
The camera with which the Astrobj is observed.
In the observer-centric point-of-view, the center of the Metric's coordinate system is positioned relatively to the observing Screen using three Euler angles and the distance (in meters). The three Euler angles are:
In addition, the Screen conveys:
The scalar FreqObs defines the observing frequency for Scenery quantity Intensity.
Likewise, a Gyoto::Spectrometer defines for which frequencies spectra are computed (when the Quantity Spectrum is requested in the Scenery).
For the sake of theoreticians, there is an alternate way of specifying the relative position of the Screen and Metric, by specifying the 4-coordinates of the Screen in the Metric's coordinate system (in that case, eerything is specified in geometrical units).
So an XML stanza for a Screen may look like that:
or like that:
Units can be specified using the unit attribute in the XML file, for instance:
Possible units are (with [] noting the default):
When the distance is really large and most of the ray-tracing would happen de facto in flat space, the camera is transported to a location at a reasonable distance from the metric and the images are scaled accordingly. The default value for this distance should be fine, but it can be customized using the "dmax" attribute of the "Distance" element. "dmax" is always expressed in geometrical units:
Symptoms when dmax is too large include pixelization of the image (neighbouring photons are numerically identical) and other numerical overflows. dmax is too small when it is apparent that changing it yields projection effects. dmax must be large compared to rmax in the Astrobj and ideally, changing it by an order of magnitude should not yield significant changes in the ray-traced image.
|
inherited |
A subcontractor builds an object upon order from the Factory.
Various classes need to provide a subcontractor to be able to instanciate 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().
void Gyoto::Screen::fillElement | ( | FactoryMessenger * | fmp | ) |
called from Factory
int Gyoto::Screen::getCoordKind | ( | ) | const |
Get coordinate kind.
From Screen::gg_.
double Gyoto::Screen::getDistance | ( | ) | const |
Get distance from observer.
In meters.
double Gyoto::Screen::getDistance | ( | const std::string & | ) | const |
Get distance from observer.
In specified unit.Get distance from observer
double Gyoto::Screen::getDmax | ( | ) | const |
Get maximum ray-tracing distance.
In geometrical units.
void Gyoto::Screen::getFourVel | ( | double | fourvel[] | ) | const |
Get copy of Screen::fourvel_.
[out] | fourvel | preallocated 4-element array |
double Gyoto::Screen::getFreqObs | ( | const std::string & | unit | ) | const |
Get freq_obs_.
unit | string: unit in which freq_obs_ should be returned is expressed, convertable to Herz or meters or energy. |
double Gyoto::Screen::getInclination | ( | ) | const |
Get inclination relative to line-of-sight.
Inclination of z-axis relative to line-of-sight, or inclination of equatorial plane relative to plane of the sky, in radians.
double Gyoto::Screen::getInclination | ( | const std::string & | ) | const |
Get inclination relative to line-of-sight.
Inclination of z-axis relative to line-of-sight, or inclination of equatorial plane relative to plane of the sky, in specified unit.
void Gyoto::Screen::getObserverPos | ( | double | coord[] | ) | const |
4-Position of the observer relative to the metric
A Screen is positioned relative to the observer with four elements: Screen::distance, Screen::inclination, Screen::paln and Screen::argument.
This function returns the position of the observer relative to the metric system in Screen::gg_, using these parameters. The output parameter is coord.
[out] | coord | position of the observer. Must be preallocated. |
void Gyoto::Screen::getRayCoord | ( | double | x, |
double | y, | ||
double | coord[] | ||
) | const |
Get 8-coordinate of Photon hitting screen from a given direction.
Similar to Screen::getObserverPos() but will return in addition the 4-velocity of a photon corresponding to the sky direction given by x and y.
[in] | x | RA (d_alpha*cos(delta)) offset in radians; |
[in] | y | Dec offset (d_delta) in radians; |
[out] | coord | position-velocity of the observer Photon. Preallocated. |
Get 8-coordinate of Photon hitting screen pixel.
Similar to Screen::getObserverPos() but will return in addition the 4-velocity of a photon corresponding to the sky direction given by x and y.
[in] | i,j | pixel coordinates |
[out] | coord | position-velocity of the Photon. Preallocated. |
void Gyoto::Screen::getScreen1 | ( | double | output[] | ) | const |
Get copy of Screen::screen1_.
[out] | output | preallocated 4-element array |
void Gyoto::Screen::getScreen2 | ( | double | output[] | ) | const |
Get copy of Screen::screen2_.
[out] | output | preallocated 4-element array |
void Gyoto::Screen::getScreen3 | ( | double | output[] | ) | const |
Get copy of Screen::screen3_.
[out] | output | preallocated 4-element array |
void Gyoto::Screen::mapPixUnit | ( | ) |
Map "pix" and "pixel" to angular pixel width in unit system.
"pix" or "pixel" can then be used in units.
There is only one unit system in Gyoto: "pix" can therefore be registered only for one Screen at a time. See Gyoto::Units.
The unit must later be unmapped with unmapPixUnit().
std::ostream& Gyoto::Screen::print | ( | std::ostream & | ) | const |
Display.
Debug helper
void Gyoto::Screen::setDistance | ( | double | dist | ) |
Set distance from observer.
dist | Distance in meters. |
void Gyoto::Screen::setDistance | ( | double | dist, |
const std::string | unit | ||
) |
Set distance from observer.
dist | the distance expressed in the specified unit; |
unit | convertible to meters |
void Gyoto::Screen::setDmax | ( | double | dist | ) |
Set ray-tracing maximum distance.
dist | Distance in geometrical units. |
void Gyoto::Screen::setFreqObs | ( | double | fo | ) |
Set freq_obs_.
fo | double: observing frequency in Hz |
void Gyoto::Screen::setFreqObs | ( | double | fo, |
const std::string & | unit | ||
) |
Set freq_obs_.
fo | double: observing frequency (or wavelength) in "unit" |
unit | string: unit in which fo is expressed, convertable to Herz or meters or energy. |
void Gyoto::Screen::setInclination | ( | double | ) |
Set inclination relative to line-of-sight.
Inclination of z-axis relative to line-of-sight, or inclination of equatorial plane relative to plane of the sky, in radians
void Gyoto::Screen::setInclination | ( | double | , |
const std::string & | unit | ||
) |
Set inclination relative to line-of-sight.
Inclination of z-axis relative to line-of-sight, or inclination of equatorial plane relative to plane of the sky, in specified unit.
void Gyoto::Screen::setObserverPos | ( | const double | pos[4] | ) |
Alternative way to set projection.
Beware : paln can not be set this way, setting later other parameters change the observer's coordinates. For observationnal ray-tracing purposes, prefer setProjection().
[in] | pos | position of observer in Screen's coordinate system. Content is copied. |
void Gyoto::Screen::unmapPixUnit | ( | ) |
Unmap "pix" and "pixel" from unit system.
See also mapPixUnit().
|
private |
Euler angles.
The angles are position angle of the line of nodes (North of East), inclination (0 = face-on), argument of X axis. We use the z-x-z convention. See http://en.wikipedia.org/wiki/Euler_angles
|
private |
Frequency at which the observer observes.
For the quantity Intensity