7#ifndef OVERZIER_SOURCE_H_
8#define OVERZIER_SOURCE_H_
11#include "sersic_source.h"
15#define PI 3.141592653589793238462643383279502884
26 SourceOverzier(PosType mag,PosType mag_bulge,
Band band,
double zero_point,PosType Reff,PosType Rdisk,PosType PA,PosType inclination,
unsigned long my_id,PosType my_z,
const PosType *theta);
32 void setInternals(PosType mag,PosType mag_bulge,
Band band,PosType Reff,PosType Rdisk,PosType PA,PosType inclination,
unsigned long my_id,PosType my_z,
const PosType *my_theta);
34 PosType getTotalFlux()
const;
38 PosType
getMag()
const {
return current.mag; }
40 PosType getMagBulge()
const {
return current.mag_bulge; }
41 PosType getMagBulge(
Band band)
const;
45 void setUMag(PosType m) { mag_u = m; }
47 void setGMag(PosType m) { mag_g = m; }
49 void setRMag(PosType m) { mag_r = m; }
51 void setIMag(PosType m) { mag_i = m; }
53 void setZMag(PosType m) { mag_z = m; }
55 void setJMag(PosType m) { mag_J = m; }
57 void setHMag(PosType m) { mag_H = m; }
59 void setKMag(PosType m) { mag_Ks = m; }
63 virtual void setMag(PosType my_mag,
Band band,PosType zero_point){
64 current.mag_map[band] = my_mag;
65 zeropoints[band] = zero_point;
69 current.bulge_mag_map[band] = my_mag;
70 zeropoints[band] = zero_point;
74 PosType
getReff()
const {
return current.Reff/arcsecTOradians; }
76 PosType
getRdisk()
const {
return current.Rdisk/arcsecTOradians; }
79 PosType
getBtoT()
const {
return pow(10,(-current.mag_bulge + current.mag)/2.5); }
81 PosType
getPA()
const {
return current.PA; }
84 float getSEDtype()
const {
return sedtype;}
85 void setSEDtype(
float s){ sedtype = s;}
93 inline PosType
getMinSize(PosType f) {
return std::min(1.678*current.Reff*fabs(cos(current.inclination))*pow(-log (f)/7.67,4),current.Rdisk*(-log (f)/1.67));}
99 SourceSersic spheroid;
100 static std::map<Band,PosType> zeropoints;
104 void renormalize_current();
105 void assignParams(InputParams& params);
116 PosType inclination=0;
127 std::map<Band,double> mag_map;
128 std::map<Band,double> bulge_mag_map;
133 std::cout <<
"Reff :" << Reff/arcsecTOradians <<
" arcsec ";
134 std::cout <<
"Rdisk :" << Rdisk/arcsecTOradians <<
" arcsec ";
135 std::cout <<
"PA :" << PA <<
" ";
136 std::cout <<
"inclination :" << inclination <<
" radians";
137 std::cout <<
"sbDo :" << sbDo <<
" ";
138 std::cout <<
"mag :" << mag <<
" ";
139 std::cout <<
"mag_bulge :" << mag_bulge <<
" ";
141 std::cout <<
"BtoT :" << pow(10,(-mag_bulge + mag)/2.5) << std::endl;
160 ,PosType my_mag_bulge
162 ,PosType mag_zero_point
165 ,PosType my_bulge_index
171 ,
const PosType *theta
178 ,PosType my_mag_bulge
180 ,PosType mag_zero_point
187 ,
const PosType *theta
188 ,PosType my_sersic_index_max
189 ,PosType my_sersic_index_min
207 current.mag_map[band] = my_mag;
208 original.mag_map[band] = my_mag;
209 zeropoints[band] = zeropoint;
213 current.bulge_mag_map[band] = my_mag;
214 original.bulge_mag_map[band] = my_mag;
215 zeropoints[band] = zeropoint;
216 spheroid.setMag(my_mag,band,zeropoint);
220 PosType
getPA()
const {
return PA; }
221 void setPA(
double pa);
223 int getNarms()
const {
return Narms;}
224 PosType getArmAmplitude()
const {
return Ad;}
225 PosType getArmAlpha()
const {
return arm_alpha;}
226 PosType getSphIndex()
const {
return spheroid.getSersicIndex();}
227 PosType getSphAxisRatio()
const {
return spheroid.getAxesRatio();}
238 virtual void setTheta(PosType my_x,PosType my_y){
242 virtual void setTheta(
const Point_2d &p){
245 void setBulgeAxisRatio(PosType q){
246 spheroid.setAxesRatio(q);
248 void setBulgeSersicIndex(
double index){
249 spheroid.setSersicIndex(index);
252 void randomize(Utilities::RandomNumbers_NR &ran);
255 PosType Ad,mctalpha,arm_alpha;
256 SourceSersic spheroid;
257 std::vector<PosType> modes;
259 PosType cosPA,sinPA,cosi,PA;
261 SourceOverzier::Params original;
263 PosType sersic_index_max;
264 PosType sersic_index_min;
Point_2d source_x
center of source
Definition source.h:173
Source(PosType r, Point_2d x, PosType z, PosType SBlimit, PosType zero_point)
shell constructor
Definition source.h:48
Structure for holding parameters for one or more galaxy images according to the Overzier model.
Definition overzier_source.h:23
PosType getPA() const
position angle in radians
Definition overzier_source.h:81
virtual void setMag(PosType my_mag, Band band, PosType zero_point)
magnitude in specific band
Definition overzier_source.h:63
PosType getMinSize(PosType f)
Definition overzier_source.h:93
void setInternals(PosType mag, PosType mag_bulge, Band band, PosType Reff, PosType Rdisk, PosType PA, PosType inclination, unsigned long my_id, PosType my_z, const PosType *my_theta)
Sets internal variables. If default constructor is used this must be called before the surface bright...
Definition overzier.cpp:69
SourceOverzier(PosType mag, PosType mag_bulge, Band band, double zero_point, PosType Reff, PosType Rdisk, PosType PA, PosType inclination, unsigned long my_id, PosType my_z, const PosType *theta)
Definition overzier.cpp:14
PosType getInclination() const
inclination in radians
Definition overzier_source.h:83
PosType getReff() const
bulge half light radius in arcseconds
Definition overzier_source.h:74
virtual void setMagBulge(PosType my_mag, Band band, PosType zero_point)
magnitude in specific band
Definition overzier_source.h:68
virtual void changeBand(Band band)
change the working band
Definition overzier.cpp:160
PosType getMag() const
get magnitude of whole galaxy. Which band this is in depends on which was passed in the constructor
Definition overzier_source.h:38
PosType getRdisk() const
disk scale height in arcseconds
Definition overzier_source.h:76
PosType getBtoT() const
the bulge to total flux ratio
Definition overzier_source.h:79
virtual PosType SurfaceBrightness(const PosType *x) const
Surface brightness in erg/cm^2/sec/rad^2/Hz.
Definition overzier.cpp:113
void randomize(Utilities::RandomNumbers_NR &ran)
Randomly change some of the internal paramters and angles of the source.
Definition overzier.cpp:413
void setMagBulge(PosType my_mag, Band band, double zeropoint)
magnitude in specific band
Definition overzier_source.h:212
virtual void setTheta(PosType *xx)
Reset the position of the source in radians.
Definition overzier_source.h:234
PosType getPA() const
position angle in radians
Definition overzier_source.h:220
SourceOverzierPlus(PosType my_mag, PosType my_mag_bulge, Band band, PosType mag_zero_point, PosType my_Reff, PosType my_bulge_q, PosType my_bulge_index, PosType my_Rdisk, PosType my_PA, PosType inclination, unsigned long my_id, PosType my_z, const PosType *theta, Utilities::RandomNumbers_NR &ran)
Definition overzier.cpp:232
void changeBand(Band band)
change the working band
Definition overzier.cpp:400
void setMag(PosType my_mag, Band band, double zeropoint)
magnitude in specific band
Definition overzier_source.h:206
PosType SurfaceBrightness(const PosType *y) const
Surface brightness in erg/cm^2/sec/rad^2/Hz.
Definition overzier.cpp:336
This is a class for generating random numbers. It simplifies and fool proofs initialization and allow...
Definition utilities_slsim.h:1059