Gyoto
GyotoScreen.h
Go to the documentation of this file.
1 
7 /*
8  Copyright 2011-2013 Thibaut Paumard, Frederic Vincent
9 
10  This file is part of Gyoto.
11 
12  Gyoto is free software: you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation, either version 3 of the License, or
15  (at your option) any later version.
16 
17  Gyoto is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
24  */
25 
26 #ifndef __GyotoScreen_H_
27 #define __GyotoScreen_H_
28 
29 #include <iostream>
30 #include <fstream>
31 #include <string>
32 
33 namespace Gyoto {
34  class Screen;
35 }
36 
37 #include <GyotoDefs.h>
38 #include <GyotoUtils.h>
39 #include <GyotoSmartPointer.h>
40 #include <GyotoMetric.h>
41 #include <GyotoSpectrometer.h>
42 
140  friend class Gyoto::SmartPointer<Gyoto::Screen>;
141 
142  private:
143  double tobs_;
144  double fov_;
145  // double tmin_;
147 
148  double distance_;
149  double dmax_;
150 
152 
158  double euler_[3];
159  double ex_[3];
160  double ey_[3];
161  double ez_[3];
162 
163  double fourvel_[4];
164  double screen1_[4];
165  double screen2_[4];
166  double screen3_[4];
167 
168  double alpha0_;
169  double delta0_;
170  SmartPointer<Metric::Generic> gg_;
171 
175  SmartPointer<Spectrometer::Generic> spectro_;
176 
182  double freq_obs_;
183 
184  public:
185 
186  // Constructors - Destructor
187  // -------------------------
188  Screen() ;
189  Screen(const Screen& ) ;
190  Screen * clone() const;
191 
192  virtual ~Screen() ;
193 
194  // Mutators / assignment
195  // ---------------------
196 
198  void setProjection(const double paln,
199  const double inclination,
200  const double argument);
202  void setProjection(const double distance,
203  const double paln,
204  const double inclination,
205  const double argument);
206 
208 
211  void setDistance(double dist);
212 
214 
217  void setDmax(double dist);
218 
220 
224  void setDistance(double dist, const std::string unit);
225 
227 
231  void setInclination(double);
232 
234 
238  void setInclination(double, const std::string &unit);
239 
240  void setPALN(double);
242  void setPALN(double, const std::string &unit);
244  void setArgument(double);
246  void setArgument(double, const std::string &unit);
248  void setSpectrometer(SmartPointer<Spectrometer::Generic> spectro);
250  SmartPointer<Spectrometer::Generic> getSpectrometer() const ;
252 
257  void setFreqObs(double fo);
258 
259 
266  void setFreqObs(double fo, const std::string &unit);
267 
271  double getFreqObs() const ;
272 
278  double getFreqObs(const std::string &unit) const;
279 
281 
289  void setObserverPos(const double pos[4]);
290 
291  void setFourVel(const double coord[4]);
293  void setScreen1(const double coord[4]);
295  void setScreen2(const double coord[4]);
297  void setScreen3(const double coord[4]);
299 
300  // Accessors
301  // ---------
302 
304 
307  int getCoordKind() const;
308 
310 
313  double getDistance() const;
314 
316 
319  double getDistance(const std::string&) const;
320 
322 
325  double getDmax() const;
326 
328 
332  double getInclination() const;
333 
335 
339  double getInclination(const std::string&) const;
340 
341  double getPALN() const;
342  double getPALN(const std::string&) const;
343  double getArgument() const;
344  double getArgument(const std::string&) const;
345 
346  SmartPointer<Metric::Generic> getMetric() const;
347  void setMetric(SmartPointer<Metric::Generic> gg);
348 
350  double getTime();
351 
353  double getTime(const std::string &);
354 
356  void setTime(double, const std::string &);
357 
359  void setTime(double);
360 
362  double getFieldOfView();
363 
365  double getFieldOfView(std::string unit);
366 
368  void setFieldOfView(double);
369 
371  void setFieldOfView(double, const std::string &unit);
372 
374  void setAlpha0(double);
376  void setDelta0(double);
377 
379  void setAnglekind(int);
380 
384  void setResolution(size_t);
385 
387 
398  void getObserverPos(double coord[]) const;
399 
401 
404  void getFourVel(double fourvel[]) const;
405 
407 
410  void getScreen1(double output[]) const;
411 
413 
416  void getScreen2(double output[]) const;
417 
419 
422  void getScreen3(double output[]) const;
423 
425 
434  void getRayCoord(double x, double y, double coord[]) const;
435 
437 
445  void getRayCoord(const size_t i, const size_t j, double coord[]) const;
446 
447  void coordToSky(const double pos[4], double skypos[3]) const;
449 
450  void coordToXYZ(const double pos[4], double xyz[3]) const;
452 
453  void computeBaseVectors() ;
455 
457  // friend std::ostream& operator<<(std::ostream& , const Screen& ) ;
458  std::ostream& print(std::ostream&) const ;
459  std::ostream& printBaseVectors(std::ostream&) const ;
460 
461  // UDUNITS
462 # ifdef HAVE_UDUNITS
463 
472  void mapPixUnit();
473 
475 
478  void unmapPixUnit();
479 # endif
480 
481 
482 #ifdef GYOTO_USE_XERCES
483  public:
484  void fillElement(FactoryMessenger *fmp);
485  static SmartPointer<Screen> Subcontractor(FactoryMessenger* fmp);
487 #endif
488 
489 
490 };
491 
492 #endif
double tobs_
Observing date in s.
Definition: GyotoScreen.h:143
void setPALN(double)
Set position angle of the line of nodes.
SmartPointer< Spectrometer::Generic > spectro_
Gyoto::Spectrometer::Generic subclass instance used for quantities Spectrum and BinSpectrum.
Definition: GyotoScreen.h:175
void unmapPixUnit()
Unmap &quot;pix&quot; and &quot;pixel&quot; from unit system.
void setInclination(double)
Set inclination relative to line-of-sight.
void getFourVel(double fourvel[]) const
Get copy of Screen::fourvel_.
double ey_[3]
Sky coordinate of base Y vector.
Definition: GyotoScreen.h:160
void setObserverPos(const double pos[4])
Alternative way to set projection.
void setScreen1(const double coord[4])
Sets the screen vector e1.
double screen3_[4]
Screen e3 vector (normal)
Definition: GyotoScreen.h:166
double distance_
Distance to the observer in m.
Definition: GyotoScreen.h:148
void setTime(double, const std::string &)
Set observing date in specified unit.
void setScreen3(const double coord[4])
Sets the screen vector e3 (normal)
double fourvel_[4]
Observer&#39;s 4-velocity.
Definition: GyotoScreen.h:163
std::ostream & print(std::ostream &) const
Display.
double freq_obs_
Frequency at which the observer observes.
Definition: GyotoScreen.h:182
std::ostream & printBaseVectors(std::ostream &) const
Debug helper.
Reference-counting pointers.
Screen * clone() const
Cloner.
void getRayCoord(double x, double y, double coord[]) const
Get 8-coordinate of Photon hitting screen from a given direction.
void setDelta0(double)
Set direction of the line-of-view.
void setArgument(double)
Set angle beetwen line of nodes and X axis of object.
#define size_t
If not defined in &lt;sys/types.h&gt;.
Definition: GyotoConfig.h:293
double screen2_[4]
Screen e2 vector.
Definition: GyotoScreen.h:165
void coordToSky(const double pos[4], double skypos[3]) const
Convert 4-position to 3-sky position.
double getFreqObs() const
Get freq_obs_.
SmartPointer< Metric::Generic > getMetric() const
Get Screen::gg_.
double fov_
Field-of-view in rad.
Definition: GyotoScreen.h:144
double euler_[3]
Euler angles.
Definition: GyotoScreen.h:158
void getScreen1(double output[]) const
Get copy of Screen::screen1_.
void setMetric(SmartPointer< Metric::Generic > gg)
Set Screen::gg_.
The camera with which the Astrobj is observed.
Definition: GyotoScreen.h:139
double dmax_
Maximum distance from which the photons are launched (geometrical units)
Definition: GyotoScreen.h:149
void setDmax(double dist)
Set ray-tracing maximum distance.
int anglekind_
Screen angles kind (0: equatorial, 1: spherical)
Definition: GyotoScreen.h:151
void setScreen2(const double coord[4])
Sets the screen vector e2.
void mapPixUnit()
Map &quot;pix&quot; and &quot;pixel&quot; to angular pixel width in unit system.
double getArgument() const
Get angle between line of nodes and X axis of object.
size_t npix_
Resolution in pixels.
Definition: GyotoScreen.h:146
double getPALN() const
Get position angle of the line of nodes.
Gyoto ubiquitous macros and typedefs.
Base class for metric description.
double ez_[3]
Sky coordinate of base Z vector.
Definition: GyotoScreen.h:161
void setAnglekind(int)
Set Screen::anglekind_.
void setProjection(const double paln, const double inclination, const double argument)
Set inclination etc.
double getFieldOfView()
Get Screen::fov_ in radians.
void setDistance(double dist)
Set distance from observer.
double getInclination() const
Get inclination relative to line-of-sight.
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.
int getCoordKind() const
Get coordinate kind.
void setFieldOfView(double)
Set Screen::fov_ in radians.
void setFreqObs(double fo)
Set freq_obs_.
void getScreen2(double output[]) const
Get copy of Screen::screen2_.
Pointers performing reference counting.
Definition: GyotoSmartPointer.h:51
Can be pointed to by a SmartPointer.
Definition: GyotoSmartPointer.h:79
double delta0_
Screen orientation (0,0) is right towards the BH.
Definition: GyotoScreen.h:169
GYOTO utilities.
double getDmax() const
Get maximum ray-tracing distance.
double ex_[3]
Sky coordinate of base X vector.
Definition: GyotoScreen.h:159
double getTime()
Get observing date in seconds.
double screen1_[4]
Screen e1 vector.
Definition: GyotoScreen.h:164
void getScreen3(double output[]) const
Get copy of Screen::screen3_.
void fillElement(FactoryMessenger *fmp)
void setSpectrometer(SmartPointer< Spectrometer::Generic > spectro)
Set Screen::spectro_.
void setResolution(size_t)
Set Screen::npix_.
SmartPointer< Metric::Generic > gg_
The Metric in this end of the Universe.
Definition: GyotoScreen.h:170
double getDistance() const
Get distance from observer.
size_t getResolution()
Get Screen::npix_.
void setAlpha0(double)
Set direction of the line-of-view.
double alpha0_
Screen orientation (0,0) is right towards the BH.
Definition: GyotoScreen.h:168
void setFourVel(const double coord[4])
Sets the observer&#39;s 4-velocity.
static SmartPointer< Screen > Subcontractor(FactoryMessenger *fmp)
Instanciate a Screen from XML entity.
void getObserverPos(double coord[]) const
4-Position of the observer relative to the metric
SmartPointer< Spectrometer::Generic > getSpectrometer() const
Get Screen::spectro_.