Template Class SEDLib

Class Documentation

template<class T>
class SEDLib

class for a general SED (Star, QSO, or Galaxy) library

Public Functions

SEDLib(string config, string typ)

Build a SEDLib for a given config file and object type, without reading any keyword (used internally as a delegate constructor)

Parameters:
  • config – configuration file (arg -c), stored in #config

  • typ – object type (S/Q/G, case-insensitive), normalised and stored in #typ

SEDLib(keymap &key_analysed, string config, string typ)

Build a SEDLib and read the keywords needed to locate the input SED list and the output library (modList, libOut, fscale), then open the output files

Parameters:
  • key_analysed – map of keyword/value pairs

  • config – configuration file (arg -c), stored in #config

  • typ – object type (S/Q/G, case-insensitive), normalised and stored in #typ

virtual ~SEDLib()
virtual void print_info()

print config and type onscreen and in the doc file

virtual void open_output_files()

open the output files in $LEPHAREWORK/lib_bin

virtual void close_output_files()

close the output files (sdocOut, sbinOut, sphysOut)

void read_model_list()

Read every SED listed in modList into allSED, applying the age selection (ageFile/agemin/agemax/ageSel) for galaxies

void write_SED_lib()

Write resultSED to the output binary/doc (and, for galaxies, physical-parameters) files

virtual void readSED(string sedFile, string sedFormat, int nummod)

read content of one SED file into a SED vector

Parameters:
  • sedFile – the file to read the SED from

  • sedFormat – format of sedFile : can be B(C03), P or F for PEGASE type, or else plain ASCII

  • nummod – index of the SED; see SED !

SEDLib(keymap &key_analysed, string config, string t)

GalSED specialization of the keymap constructor: in addition to the generic behaviour, reads the age-selection keywords (SEL_AGE, AGE_RANGE) into ageFile/agemin/agemax/ageSel

Parameters:
  • key_analysed – map of keyword/value pairs

  • config – configuration file (arg -c), stored in #config

  • t – object type, normalised and stored in #typ (always “GAL” here)

void readSED(string sedFile, string sedFormat, int nummod)

GalSED specialization of readSED: additionally applies the age selection (ageFile/agemin/agemax/ageSel) and, if provided, only keeps the requested ages from a multi-age SED file.

Parameters:
  • sedFile – the file to read the SED from

  • sedFormat – format of sedFile : can be B(C03), P or F for PEGASE type, or else plain ASCII

  • nummod – index of the SED; see SED

Public Members

vector<T> allSED

SED templates read from modList.

vector<T> resultSED

SED templates actually written to the library (after any age selection)

string docFile

output file for the doc file

string binFile

output file for the binary SED library

string modList

list of input SED files to read (the “TYPE”_SED keyword, e.g. GAL_SED)

string libOut

base name of the output library (the “TYPE”_LIB keyword, e.g. GAL_LIB)

string path

$LEPHAREDIR-relative directory the SEDs live in (/sed/STAR, /sed/QSO or /sed/GAL)

double fscale

flux rescaling factor applied to every SED (the “TYPE”_FSCALE keyword, e.g. GAL_FSCALE)

Protected Attributes

ofstream sdocOut

output stream to store the doc in docFile

ofstream sbinOut

output stream to store the binary SED library in binFile

ofstream sphysOut

output stream to store the binary SED library in physFile (only for typ=GAL)

string ageFile

optional file providing the selection of ages to keep in the SED library;

double agemin

minimum age (yr) to keep, read from ageFile (GAL only)

double agemax

maximum age (yr) to keep, read from ageFile (GAL only)

vector<double> ageSel

explicit list of ages (yr) to keep, read from ageFile (GAL only)

string physFile

output file name, locate in $LEPHAREWORK/lib_bin/; used only for typ GAL