Go to the documentation of this file.
26 #ifndef __GyotoScreen_H_
27 #define __GyotoScreen_H_
32 #if defined HAVE_BOOST_ARRAY_HPP
33 # include <boost/array.hpp>
34 # define GYOTO_ARRAY boost::array
36 # include <boost/version.hpp>
37 # if BOOST_VERSION >= 106400
38 # include <boost/serialization/boost_array.hpp>
39 # include <boost/serialization/array_wrapper.hpp>
47 T& operator[](
size_t c) {
return buf[c] ; }
202 enum anglekind_e { equatorial_angles=0, rectilinear=1, spherical_angles=2};
203 typedef int anglekind_t;
246 GYOTO_OBJECT_THREAD_SAFETY;
286 void distance(
double dist,
const std::string &unit);
304 void PALN(
double,
const std::string &unit);
328 void freqObs(
double fo,
const std::string &unit);
340 double freqObs(
const std::string &unit)
const;
352 void observerKind(
const std::string &kind);
353 std::string observerKind()
const;
405 double PALN(
const std::string&)
const;
416 double time(
const std::string &)
const;
419 void time(
double,
const std::string &);
445 void dangle1(
double,
const std::string &unit);
453 void dangle2(
double,
const std::string &unit);
478 void maskFile(std::string
const &fname);
479 std::string maskFile()
const;
480 # ifdef GYOTO_USE_CFITSIO
483 void fitsReadMask(std::string
const &fname);
486 void fitsWriteMask(std::string
const &fname);
517 void fourVel(std::vector<double>
const &);
518 std::vector<double> fourVel()
const;
519 void screenVector1(std::vector<double>
const &);
520 std::vector<double> screenVector1()
const;
521 void screenVector2(std::vector<double>
const &);
522 std::vector<double> screenVector2()
const;
523 void screenVector3(std::vector<double>
const &);
524 std::vector<double> screenVector3()
const;
566 double Ephi[4],
double Etheta[4])
const;
577 void getRayCoord(
const size_t i,
const size_t j,
double dest[8])
const;
590 std::ostream&
print(std::ostream&)
const ;
614 #ifdef GYOTO_USE_XERCES
740 const size_t mi_, ma_, d_, sz_;
744 Range(
size_t mi,
size_t ma,
size_t d);
760 Indices (
size_t const*
const buf,
size_t sz);
777 Angles (
double const*
const buf,
size_t sz);
Coord1dSet & operator++()
Increment iterator (point to next value)
Set of 1-d coordinates: indices or angles.
Definition: GyotoScreen.h:633
virtual size_t index() const
Get index of value currently pointed to.
void dangle1(double, const std::string &unit)
Set increment to first position angle in specified unit.
void PALN(double, const std::string &unit)
Set position angle of the line of nodes.
size_t size()
Number of values in this container.
virtual bool valid()
Whether the end has not been passed.
double tobs_
Observing date in s.
Definition: GyotoScreen.h:180
virtual bool valid()
Whether the end has not been passed.
void begin()
Reset specifier to point to the first value.
SmartPointer< Spectrometer::Generic > spectro_
Gyoto::Spectrometer::Generic subclass instance used for quantities Spectrum and BinSpectrum.
Definition: GyotoScreen.h:229
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:84
double const * mask() const
Retrieve const pointer to mask_.
virtual bool valid()=0
True if pointing to something, false if end has been reached.
void setScreen3(const double coord[4])
Sets the screen vector e3 (normal)
double dangle1() const
Get increment to first position angle.
int coordKind() const
Get coordinate kind.
double fourvel_[4]
Observer's 4-velocity.
Definition: GyotoScreen.h:217
double angle() const
Get double value currently pointed to.
Screen * clone() const
Cloner.
double ey_[3]
Sky coordinate of base Y vector.
Definition: GyotoScreen.h:214
#define size_t
If not defined in <sys/types.h>.
Definition: GyotoConfig.h:390
Reference-counting pointers.
Coord1dSet & operator++()
Increment iterator (point to next value)
void setObserverPos(const double pos[4])
Alternative way to set projection.
const CoordType_e kind
Whether this set holds pixels or angle specifications.
Definition: GyotoScreen.h:672
double distance(const std::string &) const
Get distance from observer.
size_t operator*() const
Get size_t value currently pointed to.
Object with properties.
Definition: GyotoObject.h:152
void setScreen1(const double coord[4])
Sets the screen vector e1.
virtual Coord1dSet & operator++()=0
Increment iterator (point to next value)
void distance(double dist)
Set distance from observer.
double screen3_[4]
Screen e3 vector (normal)
Definition: GyotoScreen.h:220
double distance_
Distance to the observer in m.
Definition: GyotoScreen.h:199
Factory / SmartPointee::Subcontractor_t interface.
Definition: GyotoFactoryMessenger.h:92
size_t size()
Number of values in this container.
void argument(double)
Set angle beetwen line of nodes and X axis of object.
A dummy, empty 2D set.
Definition: GyotoScreen.h:728
double distance() const
Get distance from observer.
void coordToSky(const double pos[4], double dest[3]) const
Convert 4-position to 3-sky position.
double dangle1_
Increment to first position angle of Screen; can be typically alpha if in Equatorial Angles,...
Definition: GyotoScreen.h:222
double freq_obs_
Frequency at which the observer observes.
Definition: GyotoScreen.h:236
virtual Coord2dSet & operator++()=0
Increment pointer.
virtual void begin()
Reset pointer.
void anglekind(int)
Set Screen::anglekind_.
void PALN(double)
Set position angle of the line of nodes.
void time(double, const std::string &)
Set observing date in specified unit.
virtual void begin()=0
Reset pointer.
double fov_
Field-of-view in rad.
Definition: GyotoScreen.h:181
double argument() const
Get angle between line of nodes and X axis of object.
obskind_t observerkind_
What kind of observer are we considering? (At infinity, ZAMO...)
Definition: GyotoScreen.h:242
void inclination(double, const std::string &unit)
Set inclination relative to line-of-sight.
double angle() const
Get double value currently pointed to.
virtual void begin()
Reset pointer.
double dmax_
Maximum distance from which the photons are launched (geometrical units)
Definition: GyotoScreen.h:200
void begin()
Reset specifier to point to the first value.
virtual bool valid()=0
Whether the end has not been passed.
double screen2_[4]
Screen e2 vector.
Definition: GyotoScreen.h:219
double azimuthalFieldOfView() const
Get Screen::azimuthal_fov_.
void getRayCoord(const size_t i, const size_t j, double dest[8]) const
Get 8-coordinate of Photon hitting screen pixel.
size_t npix_
Resolution in pixels.
Definition: GyotoScreen.h:184
virtual size_t index() const =0
Get index of value currently pointed to.
void fieldOfView(double)
Set Screen::fov_ in radians.
CoordType_e
Enum to specify whether a coordinate set (Coord1dSet or Coord2dSet) holds pixel values or angles.
Definition: GyotoScreen.h:623
void dMax(double dist)
Set ray-tracing maximum distance.
virtual GYOTO_ARRAY< size_t, 2 > operator*() const
Get pixel coordinates.
bool valid()
True if pointing to something, false if end has been reached.
1D coordinated specifier for a range
Definition: GyotoScreen.h:738
std::ostream & print(std::ostream &) const
Display.
void inclination(double)
Set inclination relative to line-of-sight.
Gyoto ubiquitous macros and typedefs.
double euler_[3]
Euler angles.
Definition: GyotoScreen.h:212
size_t size()
Number of values in this container.
void fieldOfView(double, const std::string &unit)
Set Screen::fov_ in specified unit.
virtual size_t size()=0
Number of values in this container.
Coord2dSet(CoordType_e k)
Set kind at initialisation.
virtual size_t operator*() const
Get size_t value currently pointed to.
double fieldOfView(std::string const &unit) const
Get Screen::fov_ in specified unit.
Range(size_t mi, size_t ma, size_t d)
Specify min, max and step of this range.
void setScreen2(const double coord[4])
Sets the screen vector e2.
void resolution(size_t)
Set Screen::npix_.
double PALN(const std::string &) const
Get position angle of the line of nodes.
double fieldOfView() const
Get Screen::fov_ in radians.
virtual ~Coord1dSet()
Virtual destructor.
std::string mask_filename_
Last read or written FITS file.
Definition: GyotoScreen.h:197
void begin()
Reset specifier to point to the first value.
void freqObs(double fo, const std::string &unit)
Set freq_obs_.
void metric(SmartPointer< Metric::Generic > gg)
Set Screen::gg_.
anglekind_t anglekind_
Screen angles kind (0: equatorial, 1: spherical)
Definition: GyotoScreen.h:205
Coord1dSet & operator++()
Increment iterator (point to next value)
Class containing 2D-points organized in a grid.
Definition: GyotoScreen.h:692
virtual size_t size()
Number of positions contained.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
1D specifier for an angle that is repeated.
Definition: GyotoScreen.h:788
virtual void begin()=0
Reset specifier to point to the first value.
Definition: GyotoScreen.h:43
Coord1dSet & operator++()
Increment iterator (point to next value)
bool valid()
True if pointing to something, false if end has been reached.
double ez_[3]
Sky coordinate of base Z vector.
Definition: GyotoScreen.h:215
void getRayCoord(double x, double y, double dest[8]) const
Get 8-coordinate of Photon hitting screen from a given direction.
1D specifier for an arbitrary pixel coordinate set.
Definition: GyotoScreen.h:754
double dangle2() const
Get increment to second position angle.
size_t operator*() const
Get size_t value currently pointed to.
void setProjection(const double paln, const double inclination, const double argument)
Set inclination etc.
void computeBaseVectors()
Compute base vectors according to projection parameters.
void getScreen1(double dest[4]) const
Get copy of Screen::screen1_.
double time() const
Get observing date in seconds.
Screen()
Default constructor.
Base class for metric description.
char * prefix_
If non-NULL, cout j each tims it is incremented.
Definition: GyotoScreen.h:696
virtual size_t size()=0
Number of positions contained.
void dangle1(double)
Set increment to first position angle.
double azimuthal_fov_
Azimuthal field-of-view for Spherical Angles images. Maximal extent of image in the azimuthal b-angle...
Definition: GyotoScreen.h:182
void getObserverPos(double dest[4]) const
4-Position of the observer relative to the metric
void time(double)
Set observing date in seconds.
void begin()
Reset specifier to point to the first value.
void getScreen3(double dest[4]) const
Get copy of Screen::screen3_.
double inclination(const std::string &) const
Get inclination relative to line-of-sight.
void mask(double const *const mm, size_t resolution=0)
Set mask_ from array.
bool valid()
True if pointing to something, false if end has been reached.
double time(const std::string &) const
Get observing date in seconds.
Pointers performing reference counting.
Definition: GyotoSmartPointer.h:135
virtual double angle() const
Get double value currently pointed to.
size_t size()
Number of values in this container.
const CoordType_e kind
Whether this specifier represents angles or pixels.
Definition: GyotoScreen.h:636
void getRayTriad(double coord[8], double Ephi[4], double Etheta[4]) const
Get polarization triad.
double ex_[3]
Sky coordinate of base X vector.
Definition: GyotoScreen.h:213
void getFourVel(double dest[4]) const
Get copy of Screen::fourvel_.
virtual size_t size()
Number of positions contained.
void dangle2(double, const std::string &unit)
Set increment to second position angle in specified unit.
The camera with which the Astrobj is observed.
Definition: GyotoScreen.h:176
void spectrometer(SmartPointer< Spectrometer::Generic > spectro)
Set Screen::spectro_.
virtual GYOTO_ARRAY< double, 2 > angles() const
Get angle coordinates.
virtual ~Coord2dSet()
Virtual destructor.
Spectroscopic capabilities of a Screen.
virtual bool valid()
Whether the end has not been passed.
SmartPointer< Metric::Generic > gg_
The Metric in this end of the Universe.
Definition: GyotoScreen.h:224
void getScreen2(double dest[4]) const
Get copy of Screen::screen2_.
SmartPointer< Metric::Generic > metric() const
Get Screen::gg_.
Property that can be set and got using standard methods.
Definition: GyotoProperty.h:608
Coord1dSet(CoordType_e k)
Set kind during initialization.
bool operator()(size_t, size_t)
Whether this pixel should be ray-traced.
size_t resolution() const
Get Screen::npix_.
void coordToXYZ(const double pos[4], double dest[3]) const
Convert 4-position to 3-cartesian coordinates.
void argument(double, const std::string &unit)
Set angle beetwen line of nodes and X axis of object.
double dangle1(std::string const &unit) const
Get increment to first position angle in specified unit.
virtual size_t index() const
Get index of value currently pointed to.
double inclination() const
Get inclination relative to line-of-sight.
double screen1_[4]
Screen e1 vector.
Definition: GyotoScreen.h:218
void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const
Output a single Property to XML.
void freqObs(double fo)
Set freq_obs_.
double freqObs(const std::string &unit) const
Get freq_obs_.
double freqObs() const
Get freq_obs_.
virtual Coord2dSet & operator++()
Increment pointer.
Class containing arbitrary 2D-points.
Definition: GyotoScreen.h:713
virtual Coord2dSet & operator++()
Increment pointer.
void setProjection(const double distance, const double paln, const double inclination, const double argument)
Set distance, inclination etc.
void setFourVel(const double coord[4])
Sets the observer's 4-velocity.
bool valid()
True if pointing to something, false if end has been reached.
double PALN() const
Get position angle of the line of nodes.
virtual GYOTO_ARRAY< size_t, 2 > operator*() const
Get pixel coordinates.
double argument(const std::string &) const
Get angle between line of nodes and X axis of object.
static SmartPointer< Screen > Subcontractor(FactoryMessenger *fmp)
Instanciate a Screen from XML entity.
Class to specify a set of points on the Screen.
Definition: GyotoScreen.h:669
double dangle2_
Increment to second position angle of Screen; can be typically delta if in Equatorial Angles,...
Definition: GyotoScreen.h:223
virtual size_t index() const
Get index of value currently pointed to.
virtual void begin()
Reset pointer.
SmartPointer< Spectrometer::Generic > spectrometer() const
Get Screen::spectro_.
Screen(const Screen &)
Copy constructor.
void distance(double dist, const std::string &unit)
Set distance from observer.
std::ostream & printBaseVectors(std::ostream &) const
Debug helper.
Can be pointed to by a SmartPointer.
Definition: GyotoSmartPointer.h:81
void azimuthalFieldOfView(double ff)
Set Screen::azimuthal_fov_.
virtual Coord2dSet & operator++()
Increment pointer.
double dangle2(std::string const &unit) const
Get increment to second position angle in specified unit.
#define obskind_t
Type for observer kind.
Definition: GyotoDefs.h:552
virtual size_t index() const
Get index of value currently pointed to.
virtual GYOTO_ARRAY< double, 2 > angles() const
Get angle coordinates.
1D specifier for an arbitrary angle coordinate set.
Definition: GyotoScreen.h:771
virtual ~Screen()
Destructor.
void dangle2(double)
Set increment to second position angle.
virtual GYOTO_ARRAY< size_t, 2 > operator*() const
Get pixel coordinates.
double * mask_
Mask with 0 where the ray-tracing should not be performed.
Definition: GyotoScreen.h:189
virtual size_t size()
Number of positions contained.
double dMax() const
Get maximum ray-tracing distance.