ParametricModel¶
- class paintbox.ParametricModel(wave, params, templates)[source] [edit on github]¶
Bases:
paintbox.sed.PaintboxBaseInterpolation of SED model templates parametrically.
This class allows the linear interpolation of SED templates, such as SSP models, based on a table of parameters and their SEDs.
Warning: The linear interpolation is currently based on scipy.RegularGridInterpolator for better performance with large number of input models, thus the input data must be in the form of a regular grid.
- Parameters
- wave: ndarray, astropy.units.Quantity
Wavelenght array of the model.
- params: astropy.table.Table
Table with parameters of the models.
- templates: 2D ndarray
The SED templates with dimensions (len(params), len(wave))
Attributes Summary
Lower and upper limits of the parameters.
Methods Summary
__call__(theta)Call for interpolated model at a given point theta.
gradient(theta)Gradient of models at a given point theta.
Attributes Documentation
- limits¶
Lower and upper limits of the parameters.
Methods Documentation
- __call__(theta)[source] [edit on github]¶
Call for interpolated model at a given point theta.
- Parameters
- theta: ndarray
Point where the model is computed, with parameters in the same order of parnames. Points outside of the convex hull of the models (as defined in the limits) are set to zero.
- Returns
- SED model at location theta.
- gradient(theta)[source] [edit on github]¶
Gradient of models at a given point theta.
Gradients are computed with simple finite difference. If the input point is among the points used for interpolation, the gradient is not defined, returning zero instead.
- Parameters
- theta: ndarray
Point where the gradient of the model is computed, with parameters in the same order of parnames. Points outside of the convex hull of the models are set to zero.
- eps: float or ndarray, optional
Step used in the finite difference calculation. Default is 1e-6.