Class SED

Inheritance Relationships

Derived Types

Class Documentation

class SED

SED base class.

The SED class is in charge of representing a template and performing all the necessary computation on it.

Subclassed by GalSED, QSOSED, StarSED

Public Functions

SED(const string name, int nummod = 0, string type = "G")

Generic constructor

Parameters:
  • name – Arbitrary name for the SED object

  • nummod – Identification number of the SED object

  • type – One of g/G, q/Q or s/S for GAL, QSO, or Star type objects

SED(const string nameC, double tauC, double ageC, int nummodC, string typeC, int idAgeC)
inline SED(SED const &p)
inline object_type get_object_type() const

Return the object type.

inline bool is_gal()

Return true if SED is of object_type GAL, false if not.

inline bool is_qso()

Return true if SED is of object_type QSO, false if not.

inline bool is_star()

Return true if SED is of object_type STAR, false if not.

virtual ~SED()
void read(const string &sedFile)

Read sedFile assumed to be ASCII and build the lamb_flux vector of oneElLambda elements.

Negative flux values are set to 0, oneElLambda::ori=1 to indicate that it is a SED. The lamb_flux vector is filled iteratively with each line of the file, and is finally sorted by ascending lambda. More complex input types are treated in inherited class methods.

void warning_integrateSED(const vector<flt> &filters, bool verbose = false)
vector<double> integrateSED(const flt &filter)
void generateCalib(double lmin, double lmax, int Nsteps, int calib)

Generate a calibration SED based on the argument calib.

Parameters:
  • lmin – start of the lambda vector

  • lmax – end of the lambda vector

  • Nsteps – number of intervals between $lambda values (hence there are Nsteps+1 values of \(\lambda\))

  • calib – parameter FILTER_CALIB passed as argument to define the calibration function \(C(\lambda)\)

    • calib=0 : \(C(\lambda)=\lambda^{-2}\)

    • calib=1 : \(C(\lambda)=\lambda^{-1}\)

    • calib=2 : \(C(\lambda)=\lambda^{-3}\)

    • calib=3 : \(C(\lambda)=Blackbody(\lambda, T=10000K)\)

    • calib=4 : \(C(\lambda)=Blackbody(\lambda, T=10000K)\)

    • calib=5 : \(C(\lambda)=\lambda^{-3}\)

inline int size()

return the size of the internal vector lamb_flux

void rescale(double scaleFac)

rescale the lamb_flux.val as val *= scaleFac

void compute_magnitudes(const vector<flt> &filters)

compute magnitude from filters

vector<double> compute_fluxes(const vector<flt> &filters)

compute fluxed from filters

double trapzd()
void sumSpectra(SED addSED, const double rescal)
void reduce_memory(vector<flt> allFlt)
virtual void writeSED(ofstream &ofs, ofstream &ofsPhys, ofstream &ofsDoc)
inline void writeSED(const string &binFile, const string &physFile, const string &docFile)
inline virtual void writeMag(bool outasc, ofstream &ofsBin, ofstream &ofsDat, vector<flt> allFilters, string magtyp)
inline void readSEDBin(const string &fname)
virtual void readSEDBin(ifstream &ins)

read the SED library when it is in binary format

inline virtual void readMagBin(ifstream &ins)
inline virtual void sumEmLines()
inline virtual void kcorrec(const vector<double> &magz0)

for each magnitude mag[k] compute kcorr = mag[k] - mag_z0[k] - distMod

inline virtual void add_neb_cont()
inline virtual void calc_ph()

Compute the number flux of photons able to ionize HeII, HeI, H, and H2 For a given SED, this amounts to compute the integral \(\int_0^{w_i} SED(\lambda)\cdot \frac{\lambda}{hc}\,d\lambda\quad,\) where \(w_i\)=54.42, 24.52, 13.60, and 1108.7 A for HeII, HeI, H, and H2 respectively, and where \(hc\) is in ergs.A. This normalization assumes that the SED are provided in args/cm2/s/A. In practice the integral is approximated by : \(\sum_{\lambda_{min}}^{w_k}\frac{SED_{j-1}+SED_j}{2}\cdot(\lambda_j-\lambda_{j-1})\cdot\frac{\lambda_j}{hc}\).

Results are stored in the q_i array member of size 4 of the SED instance.

inline virtual void SEDproperties()

Compute some integrals to be stored in the object This computes variables SED::luv, SED::lopt, SED::lnir, and SED::ltir luv, lopt, lnir, are monochromatic equivalent luminosities, for a source at 10 parsecs. As the SED unit is taken as erg/cm2/s/Hz, the monochromatic luminosity is obtained by integrating the SED in an interval [lmin, lmax], divided by (lmax-lmin) and multiplied by \(4\pi(10pc)^2\). Note that given the units of an SED, it is defined as dF/dnu for F the corresponding flux. As a result the integral shows a \(\lambda^2/c\) term so that \(\frac{dF}{d\nu} = \frac{dF}{d\lambda} \frac{\lambda^2}{c}\) can be integrated in \(\lambda\). For the variables computed here, in order to speed computation, \(\lambda^2/c\) is evaluated at the center of the interval and taken out of the integral.

void generate_spectra(double zin = 0.0, double dmin = 1.0, vector<opa> opaAll = {})

clean content of base class

Generate spectrum at given redshift, with given normalization, and adding emission lines and extragalactic extinction

Parameters:
  • zin – Redshift of the SED

  • dmin – Scale normalization of the SED

  • opaAll – Vector of opacities to compute extinction along the line of sight

inline virtual void clean()
void fit_normalization(const onesource &source, const int imagm)
inline bool is_same_model(const SED &other)

Check if the SED is identical to another one

Parameters:

other – the SED to compare to equality of the following attributes are compared: nummod, ebv, and age !

pair<vector<double>, vector<double>> get_data_vector(double minl, double maxl, bool mag, double offset = 0.0)

Return the pair of vectors [lambdas, vals] of wavelength and spectrum values

Parameters:
  • minl – Minimum \(\lambda\) of the vector

  • maxl – Maximum \(\lambda\) of the vector

  • mag – If true, return magnitudes as vals instead of fluxes

  • offset – offset of the mag system to be used in case mag is true.

void redshift()

Apply transformation of the sed based on the redshift (stored in variable red) \(val\rightarrow val/(1+z)\) and \(\lambda\rightarrow \lambda(1+z)\)

void applyExt(const double ebv, const ext &obj)

Apply dust extinction to the SED (GAL and GSO only)

Parameters:
  • ebv – value of E(B-V)

  • obj – instance of class ext

void applyExtLines(const ext &obj)

Apply dust extinction to the emission lines (stored in fac_line) Only for galaxies and QSO

Parameters:

obj – instance of class ext

void applyOpa(const vector<opa> &opaAll)

Apply extinction due to intergalactic medium (only for GAL and QSO)

Parameters:

opaAll – Vector of opacities to compute extinction along the line of sight

inline void emplace_back(const double lambda, const double value)

Helper function to append the oneElLambda(lambda, value) object to the sed vector

inline void set_vector(const vector<double> &x, const vector<double> &y)

Helper function to set the sed vector as lambda=x and val = y

Parameters:
  • x – vector of lambda value

  • y – vector of SED values at each lambda of x

Public Members

vector<oneElLambda> lamb_flux

vector of oneElLambda elements, capturing the SED template

vector<double> kcorr

k-correction term

vector<double> mag_z0

magnitude at z=0

vector<double> mag

magnitude and flux of the model

string name
bool has_emlines

True if the emission lines have been computed, false if not

object_type nlib

object type of the SED

int nummod

index in the initial list of rest frame SEDs

int index

index in the full list of SED, redshifted, and modified by extinction, etc…

int index_z0

index in the full list of SEDs corresponding to the z=0 version of the current SED.

double red

redshift of this SED

double chi2 = HIGH_CHI2

best fit chi2 associated with this SED

double dm

normalization of the SED

double luv

monochromatic UV luminosity \(\int_{0.21\,\mu m}^{0.25\,\mu m} L_{\lambda}\;d\lambda\) (in Log unit of erg/s/Hz)

double lopt

optical luminosity \(\int_{0.55\,\mu m}^{0.65\,\mu m} L_{\lambda}\;d\lambda\) (in Log unit of erg/s/Hz)

double lnir

NIR luminosity \(\int_{2.1\,\mu m}^{2.3\,\mu m} L_{\lambda}\;d\lambda\) (in Log unit of erg/s/Hz)

double ltir

IR luminosity \(\int_{8\,\mu m}^{1000\,\mu m} L_\lambda\; < d\lambda\) in Log unit of \(L_\odot\)

double mass

mass in \(M_\odot\)

double age

age in year (yr)

double sfr

Star Formation Rate in \(M_\odot\)/yr.

double ssfr

Specific SFR, defined as sfr / mass.

double ebv

E(B-V) extinction value applied to the SED.

double mag0
double distMod

Distance modulus of the SED object.

int extlawId

index of the extinction law when dust attenuation has been applied

double qi[4]

Store the number flux (phot/cm \(^{-2}\)s \(^{-1}\)) of ionizing photons for HeII, HeI, H, and H2. See SED::calc_ph. In practice, qi[2] only is used, and only for the physical modeling of emission lines (EM_LINES=”PHYS”, see GalMag::read_SED)

vector<oneElLambda> fac_line

oneElLambda vector storing emission lines

Public Static Functions

static inline object_type string_to_object(const string &type)

Convert string to object_type.

Parameters:

type – String starting with either g, q, or s, in either lower or upper case. If it is not the case, throw invalid argument exception.

Returns:

object_type corresponding to input, if valid.

static void resample(vector<oneElLambda> &lamb_all, vector<oneElLambda> &lamb_new, const int origine, const double lmin, const double lmax)

Protected Attributes

int idAge

index of the age for this SED object