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
40 T& operator[](
size_t c) {
return buf[c] ; }
194 enum anglekind_e { equatorial_angles=0, rectilinear=1, spherical_angles=2};
195 typedef int anglekind_t;
270 void dMax(
double dist);
277 void distance(
double dist,
const std::string &unit);
295 void PALN(
double,
const std::string &unit);
299 void argument(
double,
const std::string &unit);
319 void freqObs(
double fo,
const std::string &unit);
331 double freqObs(
const std::string &unit)
const;
343 void observerKind(
const std::string &kind);
344 std::string observerKind()
const;
373 double distance(
const std::string&)
const;
396 double PALN(
const std::string&)
const;
398 double argument(
const std::string&)
const;
407 double time(
const std::string &)
const;
410 void time(
double,
const std::string &);
430 void alpha0(
double,
const std::string &unit);
434 double alpha0(std::string
const &unit)
const;
438 void delta0(
double,
const std::string &unit);
442 double delta0(std::string
const &unit)
const;
462 double const *
mask()
const ;
463 void maskFile(std::string
const &fname);
464 std::string maskFile()
const;
465 # ifdef GYOTO_USE_CFITSIO
502 void fourVel(std::vector<double>
const &);
503 std::vector<double> fourVel()
const;
504 void screenVector1(std::vector<double>
const &);
505 std::vector<double> screenVector1()
const;
506 void screenVector2(std::vector<double>
const &);
507 std::vector<double> screenVector2()
const;
508 void screenVector3(std::vector<double>
const &);
509 std::vector<double> screenVector3()
const;
539 void getRayCoord(
double x,
double y,
double coord[])
const;
550 void getRayCoord(
const size_t i,
const size_t j,
double coord[])
const;
552 void coordToSky(
const double pos[4],
double skypos[3])
const;
555 void coordToXYZ(
const double pos[4],
double xyz[3])
const;
563 std::ostream&
print(std::ostream&)
const ;
587 #ifdef GYOTO_USE_XERCES
616 virtual void begin() =0;
618 virtual bool valid() =0;
620 virtual size_t size()=0;
624 virtual double angle()
const ;
650 virtual void begin() =0;
652 virtual bool valid() =0;
654 virtual size_t size()=0;
669 virtual void begin();
670 virtual bool valid();
671 virtual size_t size();
687 virtual void begin();
688 virtual bool valid();
689 virtual size_t size();
697 virtual void begin();
698 virtual bool valid();
699 virtual size_t size();
705 const size_t mi_, ma_, d_, sz_;
709 Range(
size_t mi,
size_t ma,
size_t d);
720 size_t const *
const indices_;
724 Indices (
size_t const*
const buf,
size_t sz);
735 double const *
const buf_;
739 Angles (
double const*
const buf,
size_t sz);
744 double angle()
const ;
759 double angle()
const ;
1D specifier for an angle that is repeated.
Definition: GyotoScreen.h:748
double tobs_
Observing date in s.
Definition: GyotoScreen.h:173
size_t size()
Number of values in this container.
double const * mask() const
Retrieve const pointer to mask_.
virtual ~Screen()
Destructor.
SmartPointer< Spectrometer::Generic > spectro_
Gyoto::Spectrometer::Generic subclass instance used for quantities Spectrum and BinSpectrum.
Definition: GyotoScreen.h:221
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:83
virtual GYOTO_ARRAY< double, 2 > angles() const
Get angle coordinates.
void unmapPixUnit()
Unmap "pix" and "pixel" from unit system.
void getFourVel(double fourvel[]) const
Get copy of Screen::fourvel_.
double ey_[3]
Sky coordinate of base Y vector.
Definition: GyotoScreen.h:206
virtual GYOTO_ARRAY< size_t, 2 > operator*() const
Get pixel coordinates.
void setObserverPos(const double pos[4])
Alternative way to set projection.
double alpha0() const
Get direction of the center of the field.
size_t size()
Number of values in this container.
virtual size_t size()=0
Number of values in this container.
size_t resolution() const
Get Screen::npix_.
void setScreen1(const double coord[4])
Sets the screen vector e1.
double screen3_[4]
Screen e3 vector (normal)
Definition: GyotoScreen.h:212
double distance_
Distance to the observer in m.
Definition: GyotoScreen.h:191
virtual void begin()
Reset pointer.
void setScreen3(const double coord[4])
Sets the screen vector e3 (normal)
double fourvel_[4]
Observer's 4-velocity.
Definition: GyotoScreen.h:209
std::ostream & print(std::ostream &) const
Display.
double freq_obs_
Frequency at which the observer observes.
Definition: GyotoScreen.h:228
std::ostream & printBaseVectors(std::ostream &) const
Debug helper.
int coordKind() const
Get coordinate kind.
Reference-counting pointers.
size_t size()
Number of values in this container.
double distance() const
Get distance from observer.
double angle() const
Get double value currently pointed to.
Screen * clone() const
Cloner.
void getRayCoord(double x, double y, double coord[]) const
Get 8-coordinate of Photon hitting screen from a given direction.
A dummy, empty 2D set.
Definition: GyotoScreen.h:693
bool valid()
True if pointing to something, false if end has been reached.
#define size_t
If not defined in .
Definition: GyotoConfig.h:366
virtual size_t size()=0
Number of positions contained.
virtual double angle() const
Get double value currently pointed to.
double screen2_[4]
Screen e2 vector.
Definition: GyotoScreen.h:211
virtual Coord1dSet & operator++()=0
Increment iterator (point to next value)
void anglekind(int)
Set Screen::anglekind_.
Coord2dSet(CoordType_e k)
Set kind at initialisation.
void coordToSky(const double pos[4], double skypos[3]) const
Convert 4-position to 3-sky position.
virtual size_t size()
Number of positions contained.
virtual Coord2dSet & operator++()
Increment pointer.
virtual GYOTO_ARRAY< size_t, 2 > operator*() const
Get pixel coordinates.
1D coordinated specifier for a range
Definition: GyotoScreen.h:703
virtual void begin()
Reset pointer.
double fov_
Field-of-view in rad.
Definition: GyotoScreen.h:174
double euler_[3]
Euler angles.
Definition: GyotoScreen.h:204
Definition: GyotoScreen.h:36
void getScreen1(double output[]) const
Get copy of Screen::screen1_.
The camera with which the Astrobj is observed.
Definition: GyotoScreen.h:166
Range(size_t mi, size_t ma, size_t d)
Specify min, max and step of this range.
virtual size_t operator*() const
Get size_t value crrently pointed to.
double dmax_
Maximum distance from which the photons are launched (geometrical units)
Definition: GyotoScreen.h:192
virtual Coord2dSet & operator++()
Increment pointer.
Coord1dSet & operator++()
Increment iterator (point to next value)
void setScreen2(const double coord[4])
Sets the screen vector e2.
virtual bool valid()=0
True if pointing to something, false if end has been reached.
virtual ~Coord2dSet()
Virtual destructor.
void mapPixUnit()
Map "pix" and "pixel" to angular pixel width in unit system.
std::string observerkind_
What kind of observer are we considering? (At infinity, ZAMO...)
Definition: GyotoScreen.h:234
std::string mask_filename_
Last read or written FITS file.
Definition: GyotoScreen.h:189
double freqObs() const
Get freq_obs_.
size_t npix_
Resolution in pixels.
Definition: GyotoScreen.h:176
void fitsWriteMask(std::string const &fname)
Save mask_ from FITS file.
Coord1dSet & operator++()
Increment iterator (point to next value)
CoordType_e
Enum to specify whether a coordinate set (Coord1dSet or Coord2dSet) holds pixel values or angles...
Definition: GyotoScreen.h:596
double argument() const
Get angle between line of nodes and X axis of object.
Gyoto ubiquitous macros and typedefs.
Base class for metric description.
Coord1dSet & operator++()
Increment iterator (point to next value)
double delta0() const
Get direction of the center of the field.
double ez_[3]
Sky coordinate of base Z vector.
Definition: GyotoScreen.h:207
double dMax() const
Get maximum ray-tracing distance.
void setProjection(const double paln, const double inclination, const double argument)
Set inclination etc.
double time() const
Get observing date in seconds.
Property that can be set and got using standard methods.
Definition: GyotoProperty.h:313
double PALN() const
Get position angle of the line of nodes.
virtual bool valid()
Whether the end has not been passed.
anglekind_t anglekind_
Screen angles kind (0: equatorial, 1: spherical)
Definition: GyotoScreen.h:197
virtual void begin()
Reset pointer.
virtual GYOTO_ARRAY< double, 2 > angles() const
Get angle coordinates.
void begin()
Reset specifier to point to the first value.
void coordToXYZ(const double pos[4], double xyz[3]) const
Convert 4-position to 3-cartesian coordinates.
Spectroscopic capabilities of a Screen.
void computeBaseVectors()
Compute base vectors according to projection parameters.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
virtual void begin()=0
Reset pointer.
double inclination() const
Get inclination relative to line-of-sight.
Screen()
Default constructor.
void fitsReadMask(std::string const &fname)
Read mask_ from FITS file.
SmartPointer< Metric::Generic > metric() const
Get Screen::gg_.
virtual GYOTO_ARRAY< size_t, 2 > operator*() const
Get pixel coordinates.
1D specifier for an arbitrary pixel coordinate set.
Definition: GyotoScreen.h:718
void getScreen2(double output[]) const
Get copy of Screen::screen2_.
Class containing arbitrary 2D-points.
Definition: GyotoScreen.h:678
Coord1dSet & operator++()
Increment iterator (point to next value)
Pointers performing reference counting.
Definition: GyotoProperty.h:41
Can be pointed to by a SmartPointer.
Definition: GyotoSmartPointer.h:78
virtual size_t size()
Number of positions contained.
double delta0_
Screen orientation (0,0) is right towards the BH.
Definition: GyotoScreen.h:215
virtual Coord2dSet & operator++()=0
Increment pointer.
bool operator()(size_t, size_t)
Whether this pixel should be ray-traced.
double ex_[3]
Sky coordinate of base X vector.
Definition: GyotoScreen.h:205
virtual ~Coord1dSet()
Virtual destructor.
void begin()
Reset specifier to point to the first value.
SmartPointer< Spectrometer::Generic > spectrometer() const
Get Screen::spectro_.
double screen1_[4]
Screen e1 vector.
Definition: GyotoScreen.h:210
void getScreen3(double output[]) const
Get copy of Screen::screen3_.
const char *const prefix_
If non-NULL, cout j each tims it is incremented.
Definition: GyotoScreen.h:662
size_t size()
Number of values in this container.
virtual Coord2dSet & operator++()
Increment pointer.
void fillProperty(Gyoto::FactoryMessenger *fmp, Property const &p) const
Output a single Property to XML.
virtual void begin()=0
Reset specifier to point to the first value.
double angle() const
Get double value currently pointed to.
void begin()
Reset specifier to point to the first value.
SmartPointer< Metric::Generic > gg_
The Metric in this end of the Universe.
Definition: GyotoScreen.h:216
virtual bool valid()=0
Whether the end has not been passed.
bool valid()
True if pointing to something, false if end has been reached.
virtual size_t size()
Number of positions contained.
Class to specify a set of points on the Screen.
Definition: GyotoScreen.h:635
Coord1dSet(CoordType_e k)
Set kind during initialization.
size_t operator*() const
Get size_t value crrently pointed to.
Object with properties.
Definition: GyotoObject.h:136
double alpha0_
Screen orientation (0,0) is right towards the BH.
Definition: GyotoScreen.h:214
1D specifier for an arbitrary angle coordinate set.
Definition: GyotoScreen.h:733
const CoordType_e kind
Whether this set holds pixels or angle specifications.
Definition: GyotoScreen.h:638
bool valid()
True if pointing to something, false if end has been reached.
void begin()
Reset specifier to point to the first value.
void setFourVel(const double coord[4])
Sets the observer's 4-velocity.
virtual bool valid()
Whether the end has not been passed.
double fieldOfView() const
Get Screen::fov_ in radians.
static SmartPointer< Screen > Subcontractor(FactoryMessenger *fmp)
Instanciate a Screen from XML entity.
size_t operator*() const
Get size_t value crrently pointed to.
Class containing 2D-points organized in a grid.
Definition: GyotoScreen.h:658
virtual bool valid()
Whether the end has not been passed.
double * mask_
Mask with 0 where the ray-tracing should not be performed.
Definition: GyotoScreen.h:181
void getObserverPos(double coord[]) const
4-Position of the observer relative to the metric
const CoordType_e kind
Whether this specifier represents angles or pixels.
Definition: GyotoScreen.h:609
Set of 1-d coordinates: indices or angles.
Definition: GyotoScreen.h:606
bool valid()
True if pointing to something, false if end has been reached.