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_rangethat that define the valid range of wavelengths. These are defined in inverse microns as is common for extinction curve research.A member function
evaluatethat computes the extinction at a givenxand any model parameter values. Thexvalues are checked to be within the validx_range. Thexvalues passed to theevaluatemethod have no units; the base classBaseExtModelwill automatically convert whatever units the user provided to inverse microns prior to calling theevaulatemethod. Theevaluatemethod should not be called directly.
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_rangeand functionevaluateare set in eachshapemodel explicitly.Member parameters are explicitly defined with the astropy
Parameterfunction. This includes default starting values and any standard bounds on the parameters. The number and name of the paramaeters varies byshapemodel.The
evaluatefunction that calculates the extinction curve based on the input parameters. This is explicitly defined in eachshapemodel.
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_rangeand functionevaluate(see All). These are set explicitly for eachaveragemodel. Theevaluatefunction may interpolate the observed average extinction curve or it may be based on ashapefit to the observed data.The member function
extinguishinherited from theBaseExtModel.A member parameter
Rvthat gives the ratio of absolute to selective extinction (i.e., R(V) = A(V)/E(B-V)). This is not set with the astropyParameterfunction 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_xandobsdata_axav. The accuracy of this tabulated information is given asobsdata_toleranceand this is used for the automated testing and in plotting. Some models also have anobsdata_azav_uncif 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_rangeand functionevaluate(see All) are explicitly defined for eachparamter_averagemodel. Theevaluatefunction calculates the extinction curve based on theRvvalue.The member function
extinguishinherited from theBasedExtRvModel.A member variable
Rvinherited from theBaseExtRvModel.A member variable
Rv_rangethat provides the valid range ofRvvalues.A validator member function called
Rvtagged with@Rv.validatorthat validates the inputRvbased 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_rangeand functionevaluate(see All). Theevaluatefunction that calculates the extinction curve based on theRvAandfAvalues.The member function
extinguishinherited from theBasedExtRvAfAModel.Member variables
RvAandfAdefined using the astropyParameterfunction inherited from theBasedExtRvAfAModel.A member variable
RvA_rangethat provides the valid range ofRvAvalues inherited from theBasedExtRvAfAModel.A member variable
fA_rangethat provides the valid range offAvalues inherited from theBasedExtRvAfAModel.A validator member function called
RvAtagged with@RvA.validatorthat validates the inputRvbased on theRv_rangeinherited from theBasedExtRvAfAModel.A validator member function called
fAtagged with@fA.validatorthat validates the inputfAbased on thefA_rangeinherited 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_rangeand functionevaluate(see All). Theevaluatefunction is inherited from theBaseExtGrainModel.The member function
extinguishinherited from theBaseExtGrainModel.A member parameter
possnamesthat 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_xanddata_axav.