Package ComboCode :: Package cc :: Package data :: Module Sed
[hide private]
[frames] | no frames]

Module Sed

source code

Toolbox for reading spectra and spectrum manipulation.

Author: R. Lombaert

Classes [hide private]
  Sed
Tools for:
Functions [hide private]
(array[float],array[float])
getCFlux(wav, seds=[], star_grid=[], nans=1, deredden=[], law='Fitz2004Chiar2006', lawtype='ism', map='marshall')
Retrieve the continuum flux at a given wavelength from either a model spectrum or an observation.
source code
array
calcPhotometry(w, f, photbands)
Calculate the (model) photometry for a given set of photometric bands.
source code
 
buildPhotometry(star_name, fn='Photometric_IvS', remove=[])
Retrieve the photometry of a star through the IvS repo's SED builder.
source code
 
normalizeSed(sed)
Normalize an SED by division by integrated energy.
source code
Variables [hide private]
  __package__ = 'ComboCode.cc.data'
Function Details [hide private]

getCFlux(wav, seds=[], star_grid=[], nans=1, deredden=[], law='Fitz2004Chiar2006', lawtype='ism', map='marshall')

source code 

Retrieve the continuum flux at a given wavelength from either a model spectrum or an observation. If both seds and star_grid are given, values from the seds are returned first in the array, then the models.

For now assumes the observation is either an ISO SWS spectrum OR that the continuum point is given in a dictionary that is property of the Sed() object (sed.cflux) with wavelengths as keys.

star_grid are all models! Works also when seds or star_grid are empty.

Reddening is taken into account when requested in the models and parameters are taken from the model objects. However, this is only allowed if only one data object is given (otherwise model reddening doesn't make sense)

Dereddening of data is also possible (and extra arguments can be passed to the reddening law), in which case distances have to be given for the seds. If any model reddening is requested and only sed is given, sed dereddening is always turned off.

Parameters:
  • wav (float) - The continuum wavelength point
  • seds (list(Sed())) - The SEDs of the data objects. Number of SEDs sets the amount of Star() objects represent data versus number of models.

    (default: [])

  • star_grid (list(Star())) - The data + model objects

    (default: [])

  • nans (bool) - Set undefined line strengths as nans. Errors are set as a nan if it concerns mode==dint. Otherwise, they are not set.

    (default: 1)

  • deredden (list) - Deredden the SEDs with distances given here. This option is turned off automatically if any reddening is requested in the models and only one sed is given to avoid double correction. Number of distances given must be equal to number of SEDs given. If not, it is also turned off.

    (default: [])

  • law (str) - The reddening law for DEREDDENING

    (default: 'Fitz2004Chiar2006')

  • lawtype (str) - The type of Chiar & Tielens reddening law (either ism or gc) for DEREDDENING

    (default: 'ism')

  • map (str) - The galactic 3d extinction model for DEREDDENING.

    (default: 'marshall')

Returns: (array[float],array[float])
The continuum fluxes in W/m2/Hz with length that of star_grid, as well as errors if applicable. If a combo mode is requested, errors are given when available, and listed as None/nan if not available (Plotting2 module knows how to deal with this).

calcPhotometry(w, f, photbands)

source code 

Calculate the (model) photometry for a given set of photometric bands.

Reddening is assumed to have been done before this.

Parameters:
  • w (array()) - the wavelengths in micron
  • f (array()) - Flux grid in Jy
  • photbands (array(str)) - the photometric bands
Returns: array
The photometry in Jy

buildPhotometry(star_name, fn='Photometric_IvS', remove=[])

source code 

Retrieve the photometry of a star through the IvS repo's SED builder.

Save the photometry in a target location.

Parameters:
  • star_name (str) - Name of the star (cc name from Star.dat)
  • fn (str) - Output filename of the photometry file. Always appends '_STAR.dat' where STAR is star_name. The file is saved in dp.

    (default: 'Photometric_IvS')

  • remove (list[str]) - Photometry to be removed from the output file. e.g. ['WISE','DENIS']

    (default: [])

normalizeSed(sed)

source code 

Normalize an SED by division by integrated energy.

Input is given by F_nu, integration of the SED is done for nu*F_nu.

Parameters:
  • sed ((list,list)) - The input SED wavelenth and F_nu.