NonParametricModel¶
- class paintbox.NonParametricModel(wave, templates, names=None)[source] [edit on github]¶
Bases:
paintbox.sed.PaintboxBaseWeighted linear combination of SED models.
This class allows the combination of a set of templates based on different weights.
- Attributes
- parnames: list
Name of the templates.
- Parameters
- wave: ndarray, Quantity
Common wavelenght array of all templates.
- templates: 2D ndarray
SED models with dimensions (N, len(wave)), where N=number of templates.
- names: list
Name of the templates. Defaults to [temp, …, tempN]
Attributes Summary
List with names of the parameters of the model.
Methods Summary
__call__(theta)Returns the dot product of a vector theta with the templates.
Constrain the parameters with the same name to have the same value during calling.
fix(fixed_vals)Fix a set of parameters in parnames using a dictionary.
gradient(theta)Gradient of the dot product with weights theta.
plot(theta[, ax, plottype])Plot the model for a given set of parameters.
Attributes Documentation
- parnames¶
List with names of the parameters of the model.
Methods Documentation
- __call__(theta)[source] [edit on github]¶
Returns the dot product of a vector theta with the templates.
- Parameters
- theta: ndarray
Vector with weights of the templates.
- Returns
Dot product of theta with templates.
- constrain_duplicates() [edit on github]¶
Constrain the parameters with the same name to have the same value during calling.
- fix(fixed_vals) [edit on github]¶
Fix a set of parameters in parnames using a dictionary.
- gradient(theta)[source] [edit on github]¶
Gradient of the dot product with weights theta.
This routine returns simply the templates, but it has an argument theta only to keep calls consistently across different SED components.
- plot(theta, ax=None, plottype=None, **kwargs) [edit on github]¶
Plot the model for a given set of parameters.