4.5. sed_physics Documentation
- class twinkle.utils.sed_physics.PhysModels[source]
Bases:
object- blackbody(lambda_, p0, su2ea1=1, bands=None, units='angstrom', bulk=False, **kwargs)[source]
Calculates the blackbody irradiance in cgs units (erg s⁻¹ cm⁻² Å⁻¹).
This function computes the blackbody radiation spectrum for a dust source with specified temperature and radius, assuming projected emission with a solid angle of π. The input wavelength is converted to centimeters for calculations, and the physical constants are used accordingly.
- Parameters:
lambda (array-like) – Wavelength array at which the blackbody flux is calculated. Units can be specified using the units parameter.
p0 (list or array-like) – System parameters [Td, Rd]: - Td (float): Dust temperature in Kelvin. - Rd (float): Dust radius in astronomical units (AU).
su2ea1 (float, optional) – Partial flux normalization factor. It accounts for the distance to the star and assumes a 1 AU radius: [(Rd[AU] / dist[pc]) in natural units: ((AU to cm) / (distance in pc x pc to cm))²] Default is 1.
bands (array-like, optional) – Spectral bands over which to integrate the blackbody spectrum. Default is None.
units (str, optional) – Units of the input wavelength. Supported values are: - ‘angstrom’ (default) - ‘micron’ - ‘meters’ - ‘cm’
bulk (bool, optional) – If True, performs bulk processing for efficiency. Default is False.
kwargs (dict) – Additional keyword arguments passed to internal calculations.
- Returns:
The blackbody flux at each wavelength in units of erg s⁻¹ cm⁻² Å⁻¹.
- Return type:
numpy.ndarray
Notes
The function assumes a projected emission with a solid angle of π.
The input wavelength is internally converted to centimeters to carry out calculations.
This module is designed for dust emission calculations, particularly useful in astrophysical contexts.
- wienTEMP(lambda_, units='micron')[source]
To calculate maximum temperature of a blackbody at a given wavelength using Wien’s law.
- Parameters:
lambda_ – (float or numpy array) reference wavelength(s) to calculate blackbody temperature
units – (string) describes reference wavelength unit. All values in lambda_ have to be the same. Allowed units are ‘angstrom’, ‘microns’,’cm’, ‘meters’. Units will be converted to cm for ease of calculation.
- Returns:
(float or np.array) Temperature in Kelvin.
- Return type:
Temp