Rosseland Model

class rapoc.Rosseland(input_data)[source]

Rosseland model class. This class implements the Rosseland Opacity model:

\[\frac{1}{k} = \frac{\int_{\nu_1}^{\nu_2} k_{\nu}^{-1} u(\nu, T) d\nu} {\int_{\nu_1}^{\nu_2} u(\nu, T) d\nu}\]

where \(\nu_1\) and \(\nu_2\) are the investigated frequency band edges, \(k_{\nu}\) is the input data opacity at a given frequency, and \(u(\nu,T)\) is the black body temperature derivative:

\[u(\nu, T) = \frac{\partial B(\nu, T)}{\partial T} = 2 \frac{h^2 \nu^4}{c^2 k_b} \frac{1}{T^2} \frac{e^{\frac{h \nu}{k_b T}}}{(e^{\frac{h \nu}{k_b T}} -1)^2}\]
Variables:
  • input_data (str or dict) – data file name or data dictionary

  • model_name (str) – model name

  • band (tuple) – investigated band. Is initialised only after the use of map()

  • selected_grid (astropy.units.Quantity) – investigated grid. Is initialised only after the use of map()

  • mol (str) – molecule name

  • mol_mass (astropy.units.Quantity) – molecular mass

  • pressure_grid (astropy.units.Quantity) – data pressure grid in si units

  • temperature_grid (astropy.units.Quantity) – data temperature grid in si units

  • wavenumber_grid (astropy.units.Quantity) – data wavenumber grid

  • opacities (astropy.units.Quantity) – data opacities grid in si units

  • frequency_grid (astropy.units.Quantity) – data frequency grid

  • wavelength_grid (astropy.units.Quantity) – data wavelength grid

Parameters:

input_data (str or dict) – data file name or input_data dictionary. If the input is a str, the correspondent loader is used (ExoMolFileLoader) if the file format is supported. If is dict, then DictLoader is used.

Raises:

IOError – if data format is not supported:

Examples

Let’s build the Rosseland method using an Exomol file as input

>>> from rapoc import Rosseland
>>> exomolFile = 'example.TauREx.h5'
>>> model = Rosseland(input_data=exomolFile)

Now the model is ready to be used

opacity_model(opacities, nu, T_input)[source]

This function computes the Rosseland Opacity model:

\[\frac{1}{k} = \frac{\int_{\nu_1}^{\nu_2} k_{\nu}^{-1} u(\nu, T) d\nu} {\int_{\nu_1}^{\nu_2} u(\nu, T) d\nu}\]

where \(\nu_1\) and \(\nu_2\) are the investigated frequency band edges, \(k_{\nu}\) is the input data opacity at a given frequency, and \(u(\nu,T)\) is the black body temperature derivative:

\[u(\nu, T) = \frac{\partial B(\nu, T)}{\partial T} = 2 \frac{h^2 \nu^4}{c^2 k_b} \frac{1}{T^2} \frac{e^{\frac{h \nu}{k_b T}}}{(e^{\frac{h \nu}{k_b T}} -1)^2}\]
Parameters:
  • opacities (np.array) – opacity array. Has the same dimension of the frequency grid nu

  • nu (np.array) – frequency grid

  • T_input (float) – temperature

Returns:

mean opacity computed from the model

Return type:

float