Package ComboCode :: Package cc :: Package tools :: Package readers :: Module KappaReader :: Class KappaReader
[hide private]
[frames] | no frames]

Class KappaReader

source code


An interface for reading opacities of multiple dust species.

Does not inherit from the Reader object, because the files are structured too differently from common input/output data.

Instance Methods [hide private]
 
__init__(self)
Initiating an instance of the KappaReader.
source code
 
readKappas(self, species)
Read kappas (cm2/g) and Q_ext/a (cm-1) for a dust species from the MCMax INPUT files.
source code
array
getWavelength(self, species, unit='micron')
Return the wavelength grid for a given species.
source code
array
getKappas(self, species, index=0)
Return the kappas for given species.
source code
array
getExtEff(self, species, index=0)
Return the extinction efficiencies per grain size for given species.
source code
spline1d
interpolate(self, species, index=0, unit='micron', *args, **kwargs)
Create an interpolation object for the mass extinction/absorption/ scattering coefficients.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Initiating an instance of the KappaReader.

Overrides: object.__init__

readKappas(self, species)

source code 

Read kappas (cm2/g) and Q_ext/a (cm-1) for a dust species from the MCMax INPUT files.

This also reads the absorption and scattering kappas separately.

Parameters:
  • species (string) - The dust species (from Dust.dat)

getWavelength(self, species, unit='micron')

source code 

Return the wavelength grid for a given species.

Parameters:
  • species (string) - The dust species (from Dust.dat)
  • unit (str/u.Unit()) - The unit of the wavelength. Can be given as u.Unit() object or as a string representation of those objects. Can range from length, to frequency, and energy

    (default: micron)

Returns: array
wavelength (given unit)

getKappas(self, species, index=0)

source code 

Return the kappas for given species.

The index determines if you want extinction, absorption or scattering.

Parameters:
  • species (string) - The dust species (from Dust.dat)
  • index (int) - The index of the kappas in the .opacity/.particle file. 0: extinction, 1: absorption, 2: scattering

    (default: 0)

Returns: array
kappas (cm2/g)

getExtEff(self, species, index=0)

source code 

Return the extinction efficiencies per grain size for given species.

The index determines if you want extinction, scattering or absorption.

Parameters:
  • species (string) - The dust species (from Dust.dat)
  • index (int) - The index of the kappas in the .opacity/.particle file. 0: extinction, 1: absorption, 2: scattering

    (default: 0)

Returns: array
q_ext/a [micron,cm-1]

interpolate(self, species, index=0, unit='micron', *args, **kwargs)

source code 

Create an interpolation object for the mass extinction/absorption/ scattering coefficients.

Additional arguments can be passed to the interpolation object.

The unit of the wavelength for the interpolation can be chosen.

Parameters:
  • species (string) - The dust species (from Dust.dat)
  • index (int) - The index of the kappas in the .opacity/.particle file. 0: extinction, 1: absorption, 2: scattering

    (default: 0)

  • unit (str/u.Unit()) - The unit of the wavelength. Can be given as u.Unit() object or as a string representation of those objects. Can range from length, to frequency, and energy

    (default: micron)

Returns: spline1d
The interpolator for the mass extinction/absorption/scattering coefficients.