Package ComboCode :: Package cc :: Package modeling :: Package tools :: Module DustOpacity
[hide private]
[frames] | no frames]

Module DustOpacity

source code

Tools for making and managing opacity files.

Author: R. Lombaert

Classes [hide private]
  CustomOpacity
An interface for creating custom opacity files by taking the original and tinkering with it.
Functions [hide private]
[float,float,...]
massFractionGSD(acut, amin=0.01, amax=100.0, slope=-3.5)
Calculate the mass fraction of a subset of grain sizes from a grain size distribution.
source code
 
mergeOpacity(species, lowres='nom_res', highres='high_res')
Merge high-res opacities into a grid of low-res opacities.
source code
Variables [hide private]
  __package__ = 'ComboCode.cc.modeling.tools'
Function Details [hide private]

massFractionGSD(acut, amin=0.01, amax=100.0, slope=-3.5)

source code 

Calculate the mass fraction of a subset of grain sizes from a grain size distribution.

A minimum of two subsets is created, so two masses are returned. Can be anything higher than that, depending on how many cuts are requested.

Parameters:
  • acut (list(float)) - The grain size(s) at which the cuts are made. Can be a float or a list.
  • amin (float) - The minimum grain size in the distribution

    (default: 0.01)

  • amax (float) - The maximum grain size in the distribution

    (default: 100)

  • slope (float) - The slope of the a-dependence of the distribution. Default is the MRN value of -3.5

    (default: -3.5)

Returns: [float,float,...]
The mass fraction of the first slice, the second slice, etc, depending on how many cuts are requested. Minimum of two.

mergeOpacity(species, lowres='nom_res', highres='high_res')

source code 

Merge high-res opacities into a grid of low-res opacities.

The wavelength range of the inserted high res opacities is taken from the given high res grid.

Parameters:
  • species (string) - The dust species for which this is done. This is also the name of the folder in ~/MCMax/DustOpacities/ that contains the data files.
  • lowres (string) - The subfolder in ~/MCMax/DustOpacities/species containing the low resolution datafiles.

    (default: low_res)

  • highres (string) - The subfolder in ~/MCMax/DustOpacities/species containing the high resolution datafiles.

    (default: high_res)