galapy.InterStellarMedium

The Inter-Stellar Medium module implements and wraps the absorbing and re-radiating media of the Galaxy.

Module Attributes

ism_tunables

Dictionary with the tunable parameters of the ISM phases

Functions

ism_build_params(phase, **kwargs)

Builds the parameters dictionary for given phase.

Classes

DD([T])

Class implementing the Diffuse-Dust medium.

ISM([TMC, TDD])

Class implementing the Inter-Stellar Medium.

MC([T])

Class implementing the Molecular-Cloud medium.

ismPhase(phase, builder[, T])

ISM phase base class.

galapy.InterStellarMedium.ism_tunables = {'dd': ['f_MC', 'norm_DD', 'Mdust', 'Rdust', 'f_PAH', 'dDDlow', 'dDDupp'], 'mc': ['f_MC', 'norm_MC', 'N_MC', 'R_MC', 'Zgas', 'tau_esc', 'Mgas', 'dMClow', 'dMCupp']}

Dictionary with the tunable parameters of the ISM phases

  1. mc : Molecular Clouds

  2. dd : Diffuse Dust

galapy.InterStellarMedium.ism_build_params(phase, **kwargs)

Builds the parameters dictionary for given phase.

class galapy.InterStellarMedium.ismPhase(phase, builder, T=None, **kwargs)

ISM phase base class.

set_parameters(**kwargs)

Function for setting the free parameters of the class.

It is implemented to take any number of keyword arguments and automathically ignores arguments that are not free-parameters of the class.

set_temperature(T)

Manually set the temperature of the ISM phase

Parameters:

T (float) – Temperature in Kelvin \([K]\)

set_slopes(lower, upper)

Manually set the slopes of the ISM phase extinction

Parameters:
  • lower (float) – slope of extinction at wavelengths <= 100 \(\mu m\)

  • lower – slope of extinction at wavelengths > 100 \(\mu m\)

temperature(Etot)

Computes the temperature of the ISM at given total energy.

With the assumption that the total energy density \(E_\text{abs}^\text{phase}\) absorbed by the ISM phase is re-radiated as a grey body with luminosity \(L_\lambda[\tau, T]\), the ISM temperature is computed by solving the integral

\[\int_0^\infty \text{d}\lambda L_\lambda^\text{phase}[\tau|T_\text{phase}(\tau)] = E_\text{abs}^\text{phase}(\tau)\]
Parameters:

Etot (scalar float) – Total energy absorbed by the ISM phase.

Returns:

T – Temperature in Kelvin \([K]\) of the given ISM phase.

Return type:

scalar float

emission(wavelength, T=None)

Computes the ISM emission at given wavelength.

We assume the ISM radiates as a gray body with emission spectrum

\[L_\lambda^\text{phase}(\tau) = \mathcal{N}_\text{phase}\; \bigl[1 - 10^{-0.4\,A_\lambda^\text{phase}(\tau)}\bigr]\; B_\lambda(T_\text{phase})\]

where \(\mathcal{N}_\text{phase}\) is a normalization depending on the model parameters, the factor \(1 - 10^{-0.4\,A_\lambda^\text{phase}(\tau)}\) is the optical depth of the ISM phase and \(B_\lambda(T_\text{phase})\) is the temperature of the medium.

Parameters:

wavelength (array or scala float) – wavelength in angstroms \([\mathring{A}]\)

Keyword Arguments:

T (float) – temperature in Kelvin \([K]\) of the ISM phase (optional, default = None)

Returns:

L_ISM – Luminosity at given wavelength

Return type:

float of array-like of floats

attenuation(wavelength)

Computes the ISM attenuation at given wavelength.

Parameters:

wavelength (array or scalar float) – wavelength in angstroms \([\mathring{A}]\)

Return type:

array or scalar float

extinction(wavelength)

Computes the ISM extinction at given wavelength.

Parameters:

wavelength (array or scalar float) – wavelength in angstroms \([\mathring{A}]\)

Return type:

array or scalar float

A_V()

Returns the extinction value in the visible band.

class galapy.InterStellarMedium.MC(T=None, **kwargs)

Class implementing the Molecular-Cloud medium.

Parameters:
  • T (float) – (optional, default = None) average temperature of Molecular Clouds

  • kwargs (dictionary) – (optional) can contain any parameter value (key-value pairs)

eta(tt)

Implements the function regulating the time-dependent evaporation of Molecular clouds:

\[\begin{split}\eta(\tau) = \begin{cases} 1 & \tau\leq \tau_\text{esc}\\ 2-\frac{\tau}{\tau_\text{esc}} & \tau_\text{esc}<\tau\leq 2\,\tau_\text{esc}\\ 0 & \tau>2\,\tau_\text{esc} \end{cases}\end{split}\]

where \(\tau_\text{esc}\) is a free parameter of the MC class and \(\tau\) is the age at which the hosting galaxy is being observed.

Parameters:

tt (array or scalar float) – age of the hosting galaxy (in years)

Returns:

value of the \(\eta(\tau)\) parameter at the input age(s)

Return type:

array or scalar float

time_attenuation(wavelength, tt)

Computes the time-dependent attenuation due to Molecular Clouds:

\[\mathcal{A}_\text{MC}(\lambda) = 1-\eta(\tau)\left[ 1 - 10^{-0.4\, A_\text{MC}(\lambda)} \right]\]

where \(\eta(\tau)\) is computed with MC.eta().

Parameters:
  • wavelength (array or scalar float) – wavelength in angstroms \([\mathring{A}]\)

  • tt (array or scalar float) – age of the hosting galaxy (in years)

Returns:

Output value of the time-dependent attenutation from MCs. The output shape depends on the inputs and is = (len(wavelength), len(tt))

Return type:

float or iterable

class galapy.InterStellarMedium.DD(T=None, **kwargs)

Class implementing the Diffuse-Dust medium.

Parameters:
  • T (float) – (optional, default = None) average temperature of Diffuse Dust

  • kwargs (dictionary) – (optional) can contain any parameter value (key-value pairs)

class galapy.InterStellarMedium.ISM(TMC=None, TDD=None, **kwargs)

Class implementing the Inter-Stellar Medium. Wraps up the combined effect of Molecular Clouds and Diffuse Dust.

Parameters:
  • TMC (float) – (optional, default = None) average temperature of Molecular Clouds

  • TDD (float) – (optional, default = None) average temperature of Diffuse Dust

  • kwargs (dictionary) – (optional) can contain any parameter value (key-value pairs) of both MCs and DD

set_parameters(**kwargs)

Change the value of the free parameters.

Keyword Arguments:
  • f_MC (float) – Fraction of the total dust mass in MCs

  • norm_MC (float) – Normalization of the attenuation law of MCs

  • N_MC (float) – Number of MCs within the hosting galaxy

  • R_MC (float) – Average radius of a MC

  • Zgas (float) – Average metallicity of the gas in the hosting galaxy

  • tau_esc (float) – Average escape time of SSPs from MCs

  • Mgas (float) – Total gas mass

  • dMClow (float) – spectral index of the MC extinction at short wavelengths

  • dMCupp (float) – spectral index of the MC extinction at long wavelengths

  • norm_DD (float) – Normalization of the attenuation law of DD

  • Mdust (float) – Total dust mass

  • Rdust (float) – Radius of the DD region

  • f_PAH (float) – fraction of the total emission from DD contributed by PAH

  • dDDlow (float) – spectral index of the DD extinction at short wavelengths

  • dDDupp (float) – spectral index of the DD extinction at long wavelengths

total_attenuation(wavelength, tt)

Function computing the total attenuation due to MCs and DD.

Note that the output is flattened and the total size depends on the size of the input arrays. Both output arrays (e.g. arr) can be reshaped to their original dimensions by calling

arr.reshape( wavelength.size, tt.size )

for the case when both wavelength and tt are arrays. If one of them is not, flattening the output does not have any effect.

Parameters:
  • wavelength (array or scalar float) – wavelength in angstroms \([\mathring{A}]\)

  • tt (array or scalar float) – age of the hosting galaxy (in years)

Returns:

  • 1d array – Total time attenuation due to MCs for each wavelength and age in the input grid. (uses function MC.time_attenuation and flattens the output array.

  • 1d array – Total time attenuation due to the combined effect of MCs first and, subsequently, DD. (the output array is flattened)