Base Model Classes¶
All the extinction models are based on either provided in dust_extinction
or an astropy.modeling FittableModel
.
For examples of how all the classes in dust_extinction
are used, see the
implemented models.
All¶
All dust extinction models have at least the following:
A member variable
x_range
that that define the valid range of wavelengths. These are defined in inverse microns as is common for extinction curve research.A member function
evaluate
that computes the extinction at a givenx
and any model parameter values. Thex
values are checked to be within the validx_range
. Thex
values should have astropy.units. If they do not, then they are assumed to be in inverse microns and a warning is issued stating such.
All of these classes used in dust_extinction
are based on the
Model astropy.modeling class.
See the astropy docs for the full details of all that is possible with this class.
FittableModel¶
The dust_extinction
shape
models are based on the astropy FittableModel
.
One general use case for these models is to fit observed dust extinction curves.
See Fit Extinction Curves. These models follow the standard astropy setup for such
models. This includes defining the parameters to be fit with the astropy Parameter
function.
Thus all shape
models have:
The member variable
x_range
and functionevaluate
are set in eachshape
model explicitly.Member parameters are explicitly defined with the astropy
Parameter
function. This includes default starting values and any standard bounds on the parameters. The number and name of the paramaeters varies byshape
model.The
evaluate
function that calculates the extinction curve based on the input parameters. This is explicitly defined in eachshape
model.
BaseExtModel¶
The BaseExtModel
provides the base model for all
the rest of the dust_extinction
models. This model provides the
extinguish
member function (see Extinguish or Unextinguish Data).
All of the average
models are based on BaseExtModel
directly. Thus
all the average
models have:
The member variable
x_range
and functionevaluate
(see All). These are set explicitly for eachaverage
model. Theevaluate
function may interpolate the observed average extinction curve or it may be based on ashape
fit to the observed data.The member function
extinguish
inherited from theBaseExtModel
.A member parameter
Rv
that gives the ratio of absolute to selective extinction (i.e., R(V) = A(V)/E(B-V)). This is not set with the astropyParameter
function as is included mainly for reference.Member variables that give the tabulated observed extinction curve as a function of wavelength. The variables for this information are
obsdata_x
andobsdata_axav
. The accuracy of this tabulated information is given asobsdata_tolerance
and this is used for the automated testing and in plotting. Some models also have anobsdata_azav_unc
if such is available from the literature.
BaseExtRvModel¶
The BaseExtRvModel
provides the base model for all
the dust_extinction
models that are depending on Rv
only. Rv
is the
ratio of absolute to selective extinction (i.e., R(V) = A(V)/E(B-V)). This model defines
the member variable Rv
that is defined using the astropy Parameter
function and a validator
member function Rv
that validates the input Rv
is in the Rv_range
. This model is based
on the BaseExtModel
, hence inherits the extinguish
member functionf
These are the majority of the parameter_average
models and they have:
The member variable
x_range
and functionevaluate
(see All) are explicitly defined for eachparamter_average
model. Theevaluate
function calculates the extinction curve based on theRv
value.The member function
extinguish
inherited from theBasedExtRvModel
.A member variable
Rv
inherited from theBaseExtRvModel
.A member variable
Rv_range
that provides the valid range ofRv
values.A validator member function called
Rv
tagged with@Rv.validator
that validates the inputRv
based on theRv_range
. This is inherited from theBaseExtRvModel
BaseExtRvAfAModel¶
The BaseExtRvAfAModel
provides the base model for all
the dust_extinction
models that are depending on RvA
and fA
.
These models are a mixture of two dust_extinction
models where the A component
is dependent on Rv
and the B component is not.
The RvA
gives the R(V) value of component A and fA
gives the fraction of the A
component and (1 - fA) gives the fraction of the B component.
This model defines
the member variables RvA
and fA
that are defined using the astropy Parameter
function and validator
member functions RvA
and fA
that validate the input RvA
and fA
are in the Rv_range
and fA_range
.
This model is based on the BaseExtModel
, hence inherits the extinguish
member function.
These parameter_average
models have:
The member variable
x_range
and functionevaluate
(see All). Theevaluate
function that calculates the extinction curve based on theRvA
andfA
values.The member function
extinguish
inherited from theBasedExtRvAfAModel
.Member variables
RvA
andfA
defined using the astropyParameter
function inherited from theBasedExtRvAfAModel
.A member variable
RvA_range
that provides the valid range ofRvA
values inherited from theBasedExtRvAfAModel
.A member variable
fA_range
that provides the valid range offA
values inherited from theBasedExtRvAfAModel
.A validator member function called
RvA
tagged with@RvA.validator
that validates the inputRv
based on theRv_range
inherited from theBasedExtRvAfAModel
.A validator member function called
fA
tagged with@fA.validator
that validates the inputfA
based on thefA_range
inherited from theBasedExtRvAfAModel
.
BaseExtGrainModel¶
The BaseExtGrainModel
provides the base model for all
the dust_extinction
models that are based on dust grain models. All these
models are provided as tabulated data tables.
This model defines a member function evaluate
thats interpolates the model extinction curve.
This model is based on the BaseExtModel
, hence inherits the extinguish
member function.
These grain_model
models have:
The member variable
x_range
and functionevaluate
(see All). Theevaluate
function is inherited from theBaseExtGrainModel
.The member function
extinguish
inherited from theBaseExtGrainModel
.A member parameter
possnames
that is a dictionary with a key that is a tag for the model (e.g.,MWRV31
) and a tuple that is (filename, Rv). This key is used when initialized agrain_model
.The member function
__init__
that reads in the tabular data into member functionsdata_x
anddata_axav
.