GLAMERDOC++
Gravitational Lensing Code Library
source.h
1 /*
2  * source.h
3  *
4  */
5 
6 #ifndef SOURCE_H_
7 #define SOURCE_H_
8 
9 #include <vector>
10 //#include "standard.h"
11 #include "utilities_slsim.h"
12 #include "InputParams.h"
13 #include "image_processing.h"
14 #include "point.h"
15 
16 double mag_to_jansky_AB(double);
17 double jansky_to_mag_AB(double flux);
18 
20 double mag_to_flux_AB(double);
22 double flux_to_mag_AB(double flux);
23 
24 template <typename T>
25 T flux_to_mag(T flux,T zeropoint){
26  if(flux <=0) return 100;
27  return -2.5 * log10(flux) + zeropoint;
28 }
29 
30 template <typename T>
31 T mag_to_flux(T m,T zeropoint){
32  if(m == 100) return 0;
33  return pow(10,-0.4*(m - zeropoint));
34 }
35 
36 //double mag_to_flux(double m,double zeropoint);
37 //double flux_to_mag(double flux,double zeropoint);
38 
39 
43 class Source
44 {
45 
46 public:
48  Source(PosType r
49  ,Point_2d x
50  ,PosType z
51  ,PosType SBlimit // surface brightness limit in mags per arcsecond
52  ,PosType zero_point // the magnitude zero point
53  ):source_r(r),source_x(x),zsource(z),sb_limit(SBlimit),mag_zero_point(zero_point)
54  {
55  //setSBlimit_magarcsec(SBlimit);
56  id=-1;
57  };
58 
59  virtual ~Source();
60 
61  Source(const Source &s):
62  source_r(s.source_r),
63  source_x(s.source_x),
64  zsource(s.zsource),
65  sb_limit(s.sb_limit),
66  id(s.id),
67  mag_zero_point(s.mag_zero_point){ }
68 
69  Source & operator=(const Source &s){
70  if(this == &s) return *this;
71  source_r = s.source_r;
72  source_x = s.source_x;
73  zsource = s.zsource;
74  sb_limit = s.sb_limit;
75  id = s.id;
76  mag_zero_point = s.mag_zero_point;
77 
78  return *this;
79  }
80 
81  // in lens.cpp
86  virtual PosType SurfaceBrightness(const PosType *y) const = 0;
87  virtual PosType getTotalFlux() const = 0;
88  virtual void printSource() = 0;
89 
91  double SBlimit_magarcsec(double limit) {return mag_to_flux(limit,mag_zero_point)*pow(180*60*60/PI,2);}
92 
94  PosType getSBlimit(){return sb_limit;}
96  PosType getSBlimit_magarcsec(){return SBlimit_magarcsec(sb_limit);}
97 
98  // accessor functions that will sometimes be over ridden in class derivatives
100  PosType getZ() const {return zsource;}
101  void setZ(PosType my_z){zsource = my_z;}
103  inline PosType getRadius() const {return source_r;}
105  void setRadius(PosType my_radius){source_r = my_radius;}
107  inline Point_2d getTheta() const {return source_x;}
109  inline void getTheta(PosType *x) const {x[0] = source_x.x[0]; x[1] = source_x.x[0];}
111  inline void getTheta(Point_2d &x) const {x = source_x;}
112 
114  void setTheta(PosType *xx){source_x[0] = xx[0]; source_x[1] = xx[1];}
115  void setTheta(PosType my_x,PosType my_y){source_x[0] = my_x; source_x[1] = my_y;}
116  void setTheta(const Point_2d &p){source_x = p;}
117 
119  void setSBlimit(float limit) {sb_limit = limit;}
120 
121  void setMagZeroPoint(float zeropoint){mag_zero_point=zeropoint;}
122  double getMagZeroPoint(){return mag_zero_point;}
123 
124  PosType changeFilter(std::string filter_in, std::string filter_out, std::string sed);
125  PosType integrateFilter(std::vector<PosType> wavel_fil, std::vector<PosType> fil);
126  PosType integrateFilterSED(std::vector<PosType> wavel_fil, std::vector<PosType> fil, std::vector<PosType> wavel_sed, std::vector<PosType> sed);
127 
128  static PosType *getx(Source &source){return source.source_x.x;}
129 
131  double TEST_surface_brightness(double res,int N){
132 
133  Point_2d x = source_x;
134  x[0] -= res*N/2.;
135  x[1] -= res*N/2.;
136  double total_flux = 0;
137 
138  for(size_t i=0 ; i<N ; ++i){
139  for(size_t j=0 ; j<N ; ++j){
140  total_flux += SurfaceBrightness(x.x);
141  x[1] += res;
142  }
143  x[0] += res;
144  x[1] = source_x[1] - res*N/2.;
145  }
146  total_flux *= res*res;
147 
148  std::cout << "------- check flux ----------" << std::endl;
149  std::cout << " total flux in pixels : " << total_flux << std::endl;
150  std::cout << " getTotalFlux() : " << getTotalFlux() << std::endl;
151  std::cout << " fractional difference : " << (total_flux - getTotalFlux()) / getTotalFlux() << std::endl;
152  std::cout << " magnitude from flux in pixels : " << flux_to_mag(total_flux) << std::endl;
153  std::cout << " mag from getTotalFlux() : " << flux_to_mag(getTotalFlux()) << std::endl;
154  std::cout << "-----------------------------" << std::endl;
155 
156  if(abs( (total_flux - getTotalFlux()) / getTotalFlux() ) > 0.1 ){
157  //assert( abs( (total_flux - getTotalFlux()) / getTotalFlux() ) < 0.1 );
158  }
159 
160  return total_flux;
161  }
162 
163  long getID() const {return id;}
164  void setID(long i){id=i;}
165 
166 protected:
167  virtual void assignParams(InputParams& params){};
168 
169  // source parameters
171  PosType source_r;
174 
176  PosType zsource;
177  PosType sb_limit;
178 
179  double flux_to_mag(double flux) const {
180  if(flux <=0) return 100;
181  return -2.5 * log10(flux) + mag_zero_point;
182  }
183 
184 // double mag_to_flux(double mag) const {
185 // if(mag == 100) return 0;
186 // return pow(10,-0.4*(mag - mag_zero_point));
187 // }
188 
189  long id;
190  double mag_zero_point;
191 };
192 
193 class SourceColored : public Source{
194 public:
195  SourceColored(PosType magnitude,PosType r,Point_2d x,PosType z
196  ,PosType SBlimit,Band band)
197  :Source(r,x,z,SBlimit,zeropoints.at(band))
198  {
199  if(zeropoints.find(band) == zeropoints.end()){
200  std::cerr << "SourceColored band " << to_string(band) << " zeropoint needs to be set." << std::endl;
201  throw std::runtime_error("unset zeropoint");
202  }
203  //zeropoints[Band::NoBand] = zero_point;
204  current_band = band;
205 
206  mag_map[current_band]=magnitude;
207  mag = magnitude;
208  flux_total = mag_to_flux(mag,zeropoints.at(band));
209  setID(-1);
210  }
211 
212  SourceColored(PosType magnitude,PosType r,Point_2d x,PosType z
213  ,PosType SBlimit,double zero_point,Band band)
214  :Source(r,x,z,SBlimit,zero_point)
215  {
216  zeropoints[band] = zero_point;
217  current_band = band;
218 
219  mag_map[current_band]=magnitude;
220  mag = magnitude;
221  flux_total = mag_to_flux(mag,zero_point);
222  setID(-1);
223  }
224 
225  SourceColored(const SourceColored &s):Source(s){
226  mag = s.mag;
227  mag_map = s.mag_map;
228  current_band = s.current_band;
229  sed_type = s.sed_type;
230  flux_total = s.flux_total;
231  }
232 
233  SourceColored & operator= (const SourceColored &s){
234  if(this == &s) return *this;
235 
236  Source::operator=(s);
237  mag = s.mag;
238  mag_map = s.mag_map;
239  current_band = s.current_band;
240  sed_type = s.sed_type;
241  flux_total = s.flux_total;
242 
243  return *this;
244  }
245 
247  SourceColored & copy_color(const SourceColored &s){
248  if(this == &s) return *this;
249 
250  Source::operator=(s);
251  mag = s.mag;
252  mag_map = s.mag_map;
253  current_band = s.current_band;
254  sed_type = s.sed_type;
255  flux_total = s.flux_total;
256 
257  return *this;
258  }
259 
260  virtual ~SourceColored(){};
261 
262  PosType getMag() const { assert(current_band != Band::NoBand); return mag;}
263  PosType getMag(Band band) const {return (mag_map.size() > 0) ? mag_map.at(band) : mag;}
264  Band getBand() const{return current_band;}
265  float getSEDtype() const {return sed_type;}
266  double getMagZeroPoint(Band band) const {return zeropoints.at(band);}
267 
268  void setSEDtype(float sed) {sed_type = sed;}
269  static void setMagZeroPoint(Band band,double zeropoint){zeropoints[band]=zeropoint;}
270  static void setMagZeroPoints(std::map<Band,PosType> &zero_points){
271  for(auto &p : zero_points){
272  zeropoints[p.first] = p.second;
273  }
274  }
275 
276  void setActiveBand(Band band);
277 
278  inline PosType getTotalFlux() const {return flux_total;}
279  void setMag(float magnitude,Band band,double zeropoint){
280  mag_map[band]=magnitude;
281  zeropoints[band]=zeropoint;
282  if(band==current_band) flux_total = mag_to_flux(mag,zeropoint);
283  }
284 
286  void setMag(float magnitude,Band band){
287  mag_map[band]=magnitude;
288  if(band==current_band) flux_total = mag_to_flux(mag,zeropoints.at(band));
289  }
290 
291  // rotate on the sky
292  virtual void rotate(PosType theta) = 0;
293 
295  void shiftmag(float delta_mag){
296  mag += delta_mag;
297  flux_total = mag_to_flux(mag,zeropoints[current_band]);
298  for(auto &b : mag_map){
299  b.second += delta_mag;
300  }
301  }
302 
303 
304 protected:
305  static std::map<Band,PosType> zeropoints;
306 
307  Band current_band;
308  float sed_type;
309  double mag;
310  double flux_total;
311 private:
312  std::map<Band,PosType> mag_map;
313 };
314 
315 
316 
322 class SourcePixelled: public SourceColored{
323 public:
324  SourcePixelled(PosType my_z, PosType* center
325  , int Npixels, PosType resolution, PosType* arr_val
326  ,PosType zero_point,Band my_band);
327  template <typename T>
328  SourcePixelled(const PixelMap<T>& gal_map
329  , PosType z,PosType factor, PosType zero_point,Band my_band);
330 
331 
332  ~SourcePixelled();
333  PosType SurfaceBrightness(const PosType *y) const;
334  void printSource();
335  inline PosType getTotalFlux() const {return flux;}
336  inline PosType getRadius() const {return source_r;}
337  inline PosType* getEll(){return ell;};
338  inline PosType getQuad(int i, int j){return quad[i][j];};
339  inline PosType getSize(){return size;};
340  inline PosType* getCentroid(){return centroid;};
341  inline PosType getMag(){return flux_to_mag(flux);};
342 private:
343  void assignParams(InputParams& params);
344  void calcEll();
345  void calcSize();
346  void calcCentroid();
347  void calcTotalFlux();
348  PosType resolution;
349  PosType range;
350  long Npixels;
351  PosType flux;
352  PosType quad[2][2];
353  PosType ell[2];
354  PosType size;
355  PosType centroid[2];
356  std::valarray<PosType> values;
357 };
358 
360 
368 class SourceShapelets: public SourceColored{
369 public:
370 
371  friend SourceMultiShapelets;
372  //SourceShapelets();
373  SourceShapelets(PosType my_z, PosType my_mag, PosType my_scale, std::valarray<PosType> my_coeff, PosType* my_center, PosType my_ang,PosType zero_point,Band band);
374  SourceShapelets(PosType my_z, PosType my_mag, std::string shap_file, PosType *my_center, PosType my_ang, PosType zero_point,Band band);
375  SourceShapelets(std::string shap_file, PosType my_ang, PosType zero_point,Band band);
376 
377  ~SourceShapelets(){--count;}
378 
379  SourceShapelets(const SourceShapelets &s):SourceColored(s){
380  coeff = s.coeff;
381  n1 = s.n1;
382  n2 = s.n2;
383  //ang = s.ang;
384  cos_sin[0] = s.cos_sin[0];
385  cos_sin[1] = s.cos_sin[1];
386  coeff_flux = s.coeff_flux;
387  ++count;
388  }
389 
390  SourceShapelets & operator= (const SourceShapelets &s){
391  if(this == &s) return *this;
392 
393  SourceColored::operator=(s);
394  coeff = s.coeff;
395  n1 = s.n1;
396  n2 = s.n2;
397  //ang = s.ang;
398  cos_sin[0] = s.cos_sin[0];
399  cos_sin[1] = s.cos_sin[1];
400  coeff_flux = s.coeff_flux;
401 
402  return *this;
403  }
404 
406  void rotate(PosType ang
407  ){
408  cos_sin[0] = cos(ang);
409  cos_sin[1] = sin(ang);
410  }
411 
412  PosType SurfaceBrightness(const PosType *y) const;
413  void printSource();
415  inline PosType getRadius() const {return source_r*10.;}
416 
417  void pepper(int n,double s,Utilities::RandomNumbers_NR &ran){
418 
419  double f = SurfaceBrightness(source_x.x);
420 
421  double t=0.9,t2=0.3;
422 
423  for(int i=0 ; i < n ; ++i){
424  double r = source_r*sqrt(ran());
425  double theta = 2*PI*ran();
426  double ff = f*( t - t2 * ran() );
427 
428  Point_2d x( r*cos(theta) , r*sin(theta) );
429 
430  grains.emplace_back(ff,s,x);
431  }
432  }
433 
434  double sub_structure_sb(double *x){
435 
436  double sum = 0;
437  for(auto &g : grains){
438  sum += g(x);
439  }
440 
441  return sum;
442  }
443 
444  class PepperCorn{
445  public:
446  PepperCorn(double f,double sig,Point_2d &x):
447  x(x),sigma(sig),fo(f){};
448 
449  double operator()(double *y){
450  return fo * exp(-( (x[0]-y[0])*(x[0]-y[0]) - (x[1]-y[1])*(x[1]-y[1]) ) /sigma/sigma);
451  }
452 
453  private:
454  Point_2d x;
455  double sigma;
456  double fo;
457  };
458 
459 private:
460 
461 
462  void assignParams(InputParams& params);
463  void Hermite(std::vector<PosType> &hg,int N, PosType x) const;
464 
465  void NormalizeFlux();
466  std::valarray<PosType> coeff;
467  int n1,n2;
468 
469  //PosType ang;
470  PosType cos_sin[2]; // [0] is cos(ang), [1] is sin(ang)
471  PosType coeff_flux;
472 
473  std::vector<SourceShapelets::PepperCorn> grains;
474 
475  static size_t count;
476 };
477 
479 class SourceUniform : public Source{
480 public:
481 
482  SourceUniform(Point_2d position
483  ,PosType z
484  ,PosType radius_in_radians
485  );
486  ~SourceUniform();
487 
488  PosType SurfaceBrightness(const PosType *y) const;
489  void assignParams(InputParams& params);
490  void printSource();
491  PosType getTotalFlux() const {return PI*source_r*source_r;}
492 };
493 
494 
496 class SourcePoint : public SourceColored{
497 public:
499  Point_2d position
500  ,PosType z
501  ,PosType magnitude
502  ,PosType radius_in_radians
503  ,double SBlimit
504  ,Band band
505 ):SourceColored(magnitude,radius_in_radians,position,z,SBlimit,band)
506 {
507  sed_type = 1;
508  };
509 
510  ~SourcePoint(){};
511 
512  virtual PosType SurfaceBrightness(const PosType *y)const {return 0.0;};
513  void printSource(){};
514  void assignParams(InputParams& params){}; // do nothing
515  void rotate(PosType t){}; // do nothing
516 };
517 
518 /*** \brief A source with a Gaussian surface brightness profile
519 
520  This is normalized so that it is equal to 1 at the center
521  */
522 class SourceGaussian : public Source{
523 public:
524  //SourceGaussian(InputParams& params);
525  SourceGaussian(
526  Point_2d position
527  ,double r_size
528  ,double z
529  ,double SBlimit
530  ,double zero_point
531  ):
532  Source(0,position,z,SBlimit,zero_point),source_gauss_r2(r_size*r_size)
533  {
534  zsource = z;
535  source_r = 5*sqrt(source_gauss_r2);
536  //setSBlimit_magarcsec(100.);
537  }
538 
539  ~SourceGaussian();
540 
542  PosType source_gauss_r2;
543 
544  PosType SurfaceBrightness(const PosType *y) const;
545  void assignParams(InputParams& params);
546  void printSource();
547  PosType getTotalFlux() const {return 2*PI*source_gauss_r2;/*std::cout << "No total flux in SourceGaussian yet" << std::endl; exit(1);*/}
548 };
549 
551 class SourceBLR : public Source{
552 public:
553  //SourceBLR(InputParams& params);
554  ~SourceBLR();
555 
556  void printSource();
557  PosType getTotalFlux() const {std::cout << "No total flux in SourceBLR yet" << std::endl; exit(1);}
558 
559  virtual inline PosType getRadius() const {return source_r_out;}
560 
562  PosType source_tau;
564  PosType source_nu;
565  float source_nuo;
567  float source_r_in;
572  float source_opening_angle;
573  float source_gamma;
574  float source_BHmass;
576  float source_fK;
579 
580  inline PosType getDlDs() const{return DlDs;}
581 
582 private:
583  PosType DlDs;
584 
585  void assignParams(InputParams& params);
586 };
587 
589 class SourceBLRDisk : public SourceBLR{
590 public:
591  PosType SurfaceBrightness(const PosType *y) const;
592  PosType getTotalFlux() const {std::cout << "No total flux in SourceBLRDisk yet" << std::endl; exit(1);}
593 
594  //SourceBLRDisk(InputParams&);
595  ~SourceBLRDisk();
596 };
597 
599 class SourceBLRSph1 : public SourceBLR{
600 public:
601  PosType SurfaceBrightness(const PosType *y) const;
602  PosType getTotalFlux() const {std::cout << "No total flux in SourceBLRSph1 yet" << std::endl; exit(1);}
603 
604  //SourceBLRSph1(InputParams&);
605  ~SourceBLRSph1();
606 };
607 
609 class SourceBLRSph2 : public SourceBLR{
610 public:
611  PosType SurfaceBrightness(const PosType *y) const;
612  PosType getTotalFlux() const {std::cout << "No total flux in SourceBLRSph2 yet" << std::endl; exit(1);}
613 
614  //SourceBLRSph2(InputParams&);
615  ~SourceBLRSph2();
616 };
617 
619 //PosType (Source::*SurfaceBrightness)(PosType *y);
620 
621 
628 class QuasarLF{
629  public:
630  //QuasarLF(PosType red, PosType mag_limit, InputParams &params);
631  ~QuasarLF();
632  // returns the integral of the luminosity function at redshift red
633  PosType getNorm() {return pow(10,log_phi)*norm;}; // in Mpc^(-3)
635  PosType getRandomFlux(Band band,Utilities::RandomNumbers_NR &rand);
636  PosType getColor(Band band);
637  PosType getFluxRatio(Band band);
638 
639  private:
640  PosType kcorr;
641  //PosType red;
642  //PosType mag_limit;
643  //PosType mstar;
644  PosType log_phi;
645  //PosType alpha;
646  //PosType beta;
647  PosType norm;
648  int arr_nbin;
649  PosType* mag_arr;
650  PosType* lf_arr;
651  PosType dl;
652  PosType colors[4];
653  PosType ave_colors[4];
654  PosType color_dev[4];
655 
656  std::string kcorr_file, colors_file;
657 
658  void assignParams(InputParams& params);
659 
660  //typedef PosType (QuasarLF::*pt2MemFunc)(PosType) const;
661  //PosType nintegrateQLF(pt2MemFunc func, PosType a,PosType b,PosType tols) const;
662  //PosType trapzQLFlocal(pt2MemFunc func, PosType a, PosType b, int n, PosType *s2) const;
663  //PosType lf_kernel (PosType mag) const;
664 
665  struct LF_kernel
666  {
667  LF_kernel(PosType alpha,PosType beta,PosType mstar)
668  : alpha(alpha),beta(beta),mstar(mstar){};
669 
670  PosType alpha;
671  PosType beta;
672  PosType mstar;
673 
674  double operator () (double mag) {
675  return 1.0/( pow(10,0.4*(alpha+1)*(mag-mstar)) + pow(10,0.4*(beta+1)*(mag-mstar)) );
676  }
677  };
678 
679 };
680 
683 {
684  SourceFunctor(Source& source) : source(source) {}
685 
686  double operator()(double x, double y)
687  {
688  // TODO: make const double[2] as soon as possible
689  double z[2] = {x, y};
690  return source.SurfaceBrightness(z);
691  }
692 
693  Source& source;
694 };
695 
696 
704 template <typename T>
706  const PixelMap<T>& gal_map
707  , PosType my_z
708  , PosType factor
709  , PosType my_zero_point
710  , Band band
711 )
712 :SourceColored(0,sqrt(gal_map.getRangeX()*gal_map.getRangeX() + gal_map.getRangeY()*gal_map.getRangeY())/2
713  ,Point_2d(0,0),my_z, -1.0e100,my_zero_point,band){
714  if(gal_map.getNx() != gal_map.getNy()){
715  std::cout << "SourcePixelled::SourcePixelled() Doesn't work on nonsquare maps" << std::endl;
716  throw std::runtime_error("nonsquare");
717  }
718 
719  zsource = my_z;
720  resolution = gal_map.getResolution();
721  Npixels = gal_map.getNx();
722  range = resolution*(Npixels-1);
723  source_x[0] = gal_map.getCenter()[0];
724  source_x[1] = gal_map.getCenter()[1];
725  source_r = range/sqrt(2.);
726  values.resize(Npixels*Npixels);
727 
728  double convertion = 1.0/resolution/resolution*factor;
729  for (int i = 0; i < Npixels*Npixels; i++)
730  values[i] = gal_map(i)*convertion;
731 
732  calcTotalFlux();
733  float mag = SourceColored::flux_to_mag(flux);
734 
735  setMag(mag,band);
736 
737  calcCentroid();
738  calcEll();
739  calcSize();
740 }
741 
742 
743 
744 #endif /* SOURCE_H_ */
to_string
std::string to_string(const Band &band)
convert a Band type to a string name.
Definition: InputParams.cpp:878
SourceUniform::SourceUniform
SourceUniform(Point_2d position, PosType z, PosType radius_in_radians)
Definition: source.cpp:43
SourceBLRDisk
A source representing a BLR with a Keplarian disk.
Definition: source.h:589
SourceBLRSph1
A source representing a BLR with a spherical symmetry and circular orbits.
Definition: source.h:599
SourceBLR::source_fK
float source_fK
fraction of Keplerian velocity in random motions
Definition: source.h:576
Source::integrateFilter
PosType integrateFilter(std::vector< PosType > wavel_fil, std::vector< PosType > fil)
Calculates the integral of the filter curve given as an array of (x,y) values.
Definition: source.cpp:424
Source
Base class for all sources.
Definition: source.h:44
SourcePoint::SourcePoint
SourcePoint(Point_2d position, PosType z, PosType magnitude, PosType radius_in_radians, double SBlimit, Band band)
Definition: source.h:498
Source::setRadius
void setRadius(PosType my_radius)
Reset the radius of the source in radians.
Definition: source.h:105
SourceShapelets::getRadius
PosType getRadius() const
maximum size
Definition: source.h:415
Source::getZ
PosType getZ() const
Redshift of source.
Definition: source.h:100
Source::getTheta
void getTheta(Point_2d &x) const
position of source in radians
Definition: source.h:111
Source::getTheta
Point_2d getTheta() const
position of source in radians
Definition: source.h:107
Source::SurfaceBrightness
virtual PosType SurfaceBrightness(const PosType *y) const =0
QuasarLF::getRandomMag
PosType getRandomMag(Utilities::RandomNumbers_NR &rand)
returns random apparent magnitude according to the luminosity function in I band
Definition: quasarLF.cpp:138
SourcePixelled::SurfaceBrightness
PosType SurfaceBrightness(const PosType *y) const
Definition: source.cpp:317
QuasarLF::getColor
PosType getColor(Band band)
Returns mean color (band - i) for a quasar at the redshift equal to QuasarLF::red.
Definition: quasarLF.cpp:183
SourceShapelets::SurfaceBrightness
PosType SurfaceBrightness(const PosType *y) const
Definition: source.cpp:641
QuasarLF
pointer to surface brightness function
Definition: source.h:628
SourceBLRSph1::SurfaceBrightness
PosType SurfaceBrightness(const PosType *y) const
Definition: source.cpp:220
SourceShapelets::rotate
void rotate(PosType ang)
rotate source
Definition: source.h:406
Band
Band
Photometric bands.
Definition: InputParams.h:79
Point_2d
Class for representing points or vectors in 2 dimensions. Not that the dereferencing operator is over...
Definition: point.h:48
Source::changeFilter
PosType changeFilter(std::string filter_in, std::string filter_out, std::string sed)
Calculates the difference in magnitude when changing the observing filter.
Definition: source.cpp:341
SourceMultiShapelets
Class for reading in and handling an array of SourceShapelets, made on the model of SourceMultiAnaGal...
Definition: sourceAnaGalaxy.h:184
SourceBLR
Base class for all sources representing the Broad Line Region (BLR) of a AGN/QSO.
Definition: source.h:551
Utilities::RandomNumbers_NR
This is a class for generating random numbers. It simplifies and fool proofs initialization and allow...
Definition: utilities_slsim.h:1068
SourceBLR::source_r_in
float source_r_in
inner radius of BLR
Definition: source.h:567
SourceBLR::source_inclination
float source_inclination
inclination of BLR in radians, face on is
Definition: source.h:571
Source::source_x
Point_2d source_x
center of source
Definition: source.h:173
SourcePoint
A uniform surface brightness circular source.
Definition: source.h:496
Source::getRadius
PosType getRadius() const
Radius of source in radians.
Definition: source.h:103
Source::zsource
PosType zsource
redshift of source
Definition: source.h:176
Source::setSBlimit
void setSBlimit(float limit)
Sets sb_limit in erg/cm^2/sec/rad^2/Hz.
Definition: source.h:119
QuasarLF::getFluxRatio
PosType getFluxRatio(Band band)
Returns flux ratio (F_band/F_i) for a quasar at the redshift equal to QuasarLF::red.
Definition: quasarLF.cpp:200
SourceShapelets::SourceShapelets
SourceShapelets(PosType my_z, PosType my_mag, PosType my_scale, std::valarray< PosType > my_coeff, PosType *my_center, PosType my_ang, PosType zero_point, Band band)
Definition: source.cpp:496
QuasarLF::getRandomFlux
PosType getRandomFlux(Band band, Utilities::RandomNumbers_NR &rand)
returns random flux according to the luminosity function must be divided by an angular area in rad^2 ...
Definition: quasarLF.cpp:175
SourceUniform
A uniform surface brightness circular source.
Definition: source.h:479
SourceFunctor
Functor to turn sources into binary functions.
Definition: source.h:683
SourceBLRDisk::SurfaceBrightness
PosType SurfaceBrightness(const PosType *y) const
Definition: source.cpp:215
SourceBLR::source_nu
PosType source_nu
frequency
Definition: source.h:564
SourceUniform::SurfaceBrightness
PosType SurfaceBrightness(const PosType *y) const
Definition: source.cpp:207
Source::setTheta
void setTheta(PosType *xx)
Reset the position of the source in radians.
Definition: source.h:114
SourceBLR::source_monocrome
bool source_monocrome
set to true to integrate over frequency
Definition: source.h:578
Source::source_r
PosType source_r
charactoristic source size
Definition: source.h:167
SourceBLR::source_r_out
float source_r_out
outer radius of BLR
Definition: source.h:569
SourcePoint::SurfaceBrightness
virtual PosType SurfaceBrightness(const PosType *y) const
Definition: source.h:512
Source::getTheta
void getTheta(PosType *x) const
position of source in radians
Definition: source.h:109
Source::getSBlimit
PosType getSBlimit()
Gets sb_limit in erg/cm^2/sec/rad^2/Hz.
Definition: source.h:94
Source::Source
Source(PosType r, Point_2d x, PosType z, PosType SBlimit, PosType zero_point)
shell constructor
Definition: source.h:48
Source::getSBlimit_magarcsec
PosType getSBlimit_magarcsec()
Gets sb_limit in mag/arcsec^2.
Definition: source.h:96
SourceBLRSph2::SurfaceBrightness
PosType SurfaceBrightness(const PosType *y) const
Definition: source.cpp:223
InputParams.h
SourceShapelets
Class for sources described by shapelets.
Definition: source.h:368
SourceBLRSph2
A source representing a BLR with a spherical symmetry and random velocity dispersion.
Definition: source.h:609
Source::integrateFilterSED
PosType integrateFilterSED(std::vector< PosType > wavel_fil, std::vector< PosType > fil, std::vector< PosType > wavel_sed, std::vector< PosType > sed)
Calculates the integral of the sed multiplied by the filter curve.
Definition: source.cpp:436
SourcePixelled
Class for sources described by an array of pixels.
Definition: source.h:322
PixelMap
Image structure that can be manipulated and exported to/from fits files.
Definition: pixelmap.h:42
SourceBLR::source_tau
PosType source_tau
lag time
Definition: source.h:562
SourcePixelled::SourcePixelled
SourcePixelled(PosType my_z, PosType *center, int Npixels, PosType resolution, PosType *arr_val, PosType zero_point, Band my_band)
Definition: source.cpp:227
Source::SBlimit_magarcsec
double SBlimit_magarcsec(double limit)
convert mag/arcsec^2 to flux units
Definition: source.h:91
Source::TEST_surface_brightness
double TEST_surface_brightness(double res, int N)
test if flux in pixels matches total flux
Definition: source.h:131
InputParams
Structure for reading and writing parameters to and from a parameter file as well as a container for ...
Definition: InputParams.h:99