hyperion.dust.BHDust

class hyperion.dust.BHDust(model)

This class should be used for dust properties that were computed using this dust calculation code which is a wrapper to the bhmie routine originally written by C.F. Bohren and D. Huffman and improved by B. Draine.

When using the bhmie code, you should set the output format to 2, which will create a number of files ending in .wav, .mu, .alb, etc. Then, instantiate this class with the name of the directory containing these output files along with the prefix used. For example, if you use directory/mydust as a prefix in bhmie, you can import this dust with:

>>> from hyperion.dust import BHDust
>>> d = BHDust('directory/mydust')

Method

set_sublimation_temperature(self, mode[, …])

Set the dust sublimation mode and temperature.

set_sublimation_specific_energy(self, mode)

Set the dust sublimation mode and specific energy.

set_lte_emissivities(self[, n_temp, …])

Calculate the emissivities assuming LTE

plot(self, filename)

read(self, filename)

Read in from a standard dust file

write(self, filename[, compression])

Write out to a standard dust file, including calculations of the mean opacities and optionally thermal emissivities.

temperature2specific_energy(self, temperature)

Convert a temperature to its corresponding specific energy value.

specific_energy2temperature(self, …)

Convert a specific energy value to its corresponding temperature.

chi_nu_temperature(self, temperature)

Compute the mean opacity to extinction for a blackbody at a given temperature.

kappa_nu_temperature(self, temperature)

Compute the mean opacity to absorption for a blackbody at a given temperature.

chi_nu_spectrum(self, nu, fnu)

Compute the mean opacity to extinction for a given spectrum.

kappa_nu_spectrum(self, nu, fnu)

Compute the mean opacity to absorption for a given spectrum.

Methods (detail)

set_sublimation_temperature(self, mode, temperature=0.0)

Set the dust sublimation mode and temperature.

Parameters
modestr
The dust sublimation mode, which can be:
  • ‘no’ - no sublimation

  • ‘fast’ - remove all dust in cells exceeding the

    sublimation temperature

  • ‘slow’ - reduce the dust in cells exceeding the

    sublimation temperature

  • ‘cap’ - any temperature exceeding the sublimation

    temperature is reset to the sublimation temperature.

temperaturefloat, optional

The dust sublimation temperature, in K

set_sublimation_specific_energy(self, mode, specific_energy=0.0)

Set the dust sublimation mode and specific energy.

Parameters
modestr
The dust sublimation mode, which can be:
  • ‘no’ - no sublimation

  • ‘fast’ - remove all dust in cells exceeding the

    sublimation specific energy

  • ‘slow’ - reduce the dust in cells exceeding the

    sublimation specific energy

  • ‘cap’ - any specific energy exceeding the sublimation

    specific energy is reset to the sublimation specific energy.

specific_energyfloat, optional

The dust sublimation specific energy, in cgs

set_lte_emissivities(self, n_temp=1200, temp_min=0.1, temp_max=100000.0)

Calculate the emissivities assuming LTE

Parameters
n_tempint, optional

The number of temperatures to calculate the emissivities for

temp_minfloat, optional

The minimum temperature to calculate the emissivities for

temp_maxfloat, optional

The maximum temperature to calculate the emissivities for

plot(self, filename)
read(self, filename)

Read in from a standard dust file

write(self, filename, compression=True)

Write out to a standard dust file, including calculations of the mean opacities and optionally thermal emissivities.

temperature2specific_energy(self, temperature)

Convert a temperature to its corresponding specific energy value.

Parameters
temperaturefloat or array_like

The temperature to convert

Returns
specific_energyfloat or array_like

The specific energy corresponding to the input temperature

specific_energy2temperature(self, specific_energy)

Convert a specific energy value to its corresponding temperature.

Parameters
specific_energyfloat or array_like

The specific energy to convert

Returns
temperaturefloat or array_like

The temperature corresponding to the input specific energy

chi_nu_temperature(self, temperature)

Compute the mean opacity to extinction for a blackbody at a given temperature.

Parameters
temperaturefloat

The temperature of the blackbody to use

Returns
chi_nu_meanfloat

The mean opacity to extinction

kappa_nu_temperature(self, temperature)

Compute the mean opacity to absorption for a blackbody at a given temperature.

Parameters
temperaturefloat

The temperature of the blackbody to use

Returns
kappa_nu_meanfloat

The mean opacity to absorption

chi_nu_spectrum(self, nu, fnu)

Compute the mean opacity to extinction for a given spectrum.

Parameters
nuarray_like

The frequencies, in Hz

fnuarray_like

The monochromatic fluxes per unit frequency. Units are unimportant since proportionality constants are cancelled out in the computation.

Returns
chi_nu_meanfloat

The mean opacity to extinction

kappa_nu_spectrum(self, nu, fnu)

Compute the mean opacity to absorption for a given spectrum.

Parameters
nuarray_like

The frequencies, in Hz

fnuarray_like

The monochromatic fluxes per unit frequency. Units are unimportant since proportionality constants are cancelled out in the computation.

Returns
kappa_nu_meanfloat

The mean opacity to absorption