protoRT.compute_opacities
Created on Fri Nov 29 12:01:01 2024
@author: daniel
Module Contents
Functions
|
Compute dust absorption and scattering opacities using the DSHARP model. |
- protoRT.compute_opacities.dsharp_model(p, wavelength, grain_sizes, bin_approx=False)[source]
Compute dust absorption and scattering opacities using the DSHARP model.
This function supports both monodisperse and polydisperse grain size distributions, allowing for either a full grain size integration or a binned approximation (bin_approx).
Opacities are computed using the DSHARP dust opacity tables (Birnstiel et al. 2018) and are valid for wavelengths in the range 1e-5 to 10 cm and grain sizes from 1e-5 to 100 cm. It assumes a constant internal density across all grain sizes of 1.675 (g/cm³), as per the adopted dust model.
Notes
When bin_approx=True, the grain size distribution is discretized into bins such that: - The first bin always starts at 1e-5 cm (minimum DSHARP grain size). - Each bin’s a_max is given by the input grain_sizes. - Each subsequent bin begins slightly above the previous bin edge (offset by 1e-10 cm) to avoid overlap and mass overestimation.
If bin_approx=False, a single grain size is assumed (monodisperse case).
Warning
Opacities cannot be computed for exactly 1e-5 cm unless a small positive offset is applied (e.g., 1e-5 + 1e-10 cm), due to our binning strategy.
- Parameters:
p (float) – Power-law index of the grain size distribution; n(a) ∝ a^(-p).
wavelength (float) – Wavelength at which to evaluate the opacities [cm].
grain_sizes (list or ndarray) – Array of maximum grain sizes for each bin [cm].
bin_approx (bool, optional) – If True, enables the binned approximation for polydisperse models. Default is False (monodisperse case).
- Returns:
absorption_opacities (np.ndarray) – Absorption opacities (cm²/g) for each grain bin.
scattering_opacities (np.ndarray) – Scattering opacities (cm²/g) for each grain bin.
grain_size_bins (np.ndarray) – Array of (a_min, a_max) tuples for each grain size bin [cm].