BlackBody1D¶
- class synphot.blackbody.BlackBody1D(temperature=<Quantity 5000. K>, bolometric_flux=<Quantity 1. erg / (s cm2)>, **kwargs)[source]¶
Bases:
Fittable1DModel
One dimensional blackbody model.
- Parameters:
Notes
Model formula:
\[f(x) = \pi B_{\nu} f_{\text{bolometric}} / (\sigma T^{4})\]Examples
>>> from astropy import units as u >>> from synphot.blackbody import BlackBody1D >>> bb = BlackBody1D() >>> bb(6000 * u.AA) <Quantity 1.35853828e-15 erg / (Hz s cm2)>
import numpy as np import matplotlib.pyplot as plt from astropy import units as u from astropy.visualization import quantity_support from synphot.blackbody import BlackBody1D from synphot.units import FLAM bb = BlackBody1D(temperature=5778*u.K) wav = np.arange(1000, 110000) * u.AA flux = bb(wav).to(FLAM, u.spectral_density(wav)) with quantity_support(): plt.figure() plt.semilogx(wav, flux) plt.axvline(bb.lambda_max.to_value(u.AA), ls='--') plt.show()
(
Source code
,png
,hires.png
,pdf
)Attributes Summary
This property is used to indicate what units or sets of units the evaluate method expects, and returns a dictionary mapping inputs to units (or
None
if any units are accepted).Peak wavelength when the curve is expressed as power density.
Names of the parameters that describe models of this type.
Methods Summary
evaluate
(x, temperature, bolometric_flux)Evaluate the model.
Attributes Documentation
- bolometric_flux = Parameter('bolometric_flux', value=1.0, unit=erg / (s cm2), bounds=(0, None))¶
- input_units¶
- input_units_equivalencies = {'x': [(Unit("m"), Unit("Hz"), <function spectral.<locals>.<lambda>>), (Unit("m"), Unit("J"), <function spectral.<locals>.<lambda>>), (Unit("Hz"), Unit("J"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>), (Unit("m"), Unit("1 / m"), <function spectral.<locals>.<lambda>>), (Unit("Hz"), Unit("1 / m"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>), (Unit("J"), Unit("1 / m"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>), (Unit("1 / m"), Unit("rad / m"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>), (Unit("m"), Unit("rad / m"), <function spectral.<locals>.<lambda>>), (Unit("Hz"), Unit("rad / m"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>), (Unit("J"), Unit("rad / m"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>)]}¶
- lambda_max¶
Peak wavelength when the curve is expressed as power density.
- param_names = ('temperature', 'bolometric_flux')¶
Names of the parameters that describe models of this type.
The parameters in this tuple are in the same order they should be passed in when initializing a model of a specific type. Some types of models, such as polynomial models, have a different number of parameters depending on some other property of the model, such as the degree.
When defining a custom model class the value of this attribute is automatically set by the
Parameter
attributes defined in the class body.
- temperature = Parameter('temperature', value=5000.0, unit=K, bounds=(0, None))¶
Methods Documentation
- evaluate(x, temperature, bolometric_flux)[source]¶
Evaluate the model.
- Parameters:
- xfloat,
ndarray
, orQuantity
Frequency at which to compute the blackbody. If no units are given, this defaults to Hz.
- temperaturefloat,
ndarray
, orQuantity
Temperature of the blackbody. If no units are given, this defaults to Kelvin.
- bolometric_fluxfloat,
ndarray
, orQuantity
Desired integral for the blackbody.
- xfloat,
- Returns:
- ynumber or ndarray
Blackbody spectrum. The units are determined from the units of
bolometric_flux
.