Public Member Functions | |
| __init__ (self, tuple bands, Box bbox, Parameter|np.ndarray spectrum, Parameter|np.ndarray morph_params, Callable morph_func, Callable morph_grad, Callable morph_prox, Callable|np.ndarray morph_step, Callable|None prox_spectrum=None, float floor=1e-20) | |
| tuple[float, float] | peak (self) |
| float | y0 (self) |
| float | x0 (self) |
| np.ndarray | spectrum (self) |
| CartesianFrame | frame (self) |
| np.ndarray | radial_params (self) |
| np.ndarray | morph (self, CartesianFrame|None frame=None) |
| Callable | prox_morph (self) |
| Callable | grad_morph (self) |
| Callable | morph_step (self) |
| Image | get_model (self, CartesianFrame|None frame=None) |
| np.ndarray | prox_spectrum (self, np.ndarray spectrum) |
| np.ndarray | grad_spectrum (self, np.ndarray input_grad, np.ndarray spectrum, np.ndarray morph) |
| update (self, int it, np.ndarray input_grad) | |
| bool | resize (self, Box model_box) |
| None | parameterize (self, Callable parameterization) |
| ScarletComponentBaseData | to_data (self) |
| ParametricComponent | __getitem__ (self, Any indices) |
| ParametricComponent | __deepcopy__ (self, dict[int, Any] memo) |
| ParametricComponent | __copy__ (self) |
Public Member Functions inherited from lsst.scarlet.lite.component.Component | |
| __init__ (self, tuple bands, Box bbox) | |
| Box | bbox (self) |
| tuple | bands (self) |
| Component | __getitem__ (self, Any indices) |
| Component | __copy__ (self) |
| Component | __deepcopy__ (self, dict[int, Any] memo) |
| Component | copy (self, bool deep=False) |
Public Attributes | |
| floor = floor | |
| y0 | |
| radial_params | |
| frame | |
Protected Member Functions | |
| np.ndarray | _get_morph (self, CartesianFrame|None frame=None) |
Protected Attributes | |
| _spectrum = parameter(spectrum) | |
| _params = parameter(morph_params) | |
| _func = morph_func | |
| _morph_grad = morph_grad | |
| _morph_prox = morph_prox | |
| Callable | _morph_step = morph_step |
| Callable | _prox_spectrum = self.prox_spectrum |
Protected Attributes inherited from lsst.scarlet.lite.component.Component | |
| tuple | _bands = bands |
| Box | _bbox = bbox |
A parametric model of an astrophysical source
Parameters
----------
bands:
The bands used in the model.
bbox:
The bounding box that holds the model.
spectrum:
The spectrum of the component.
morph_params:
The parameters of the morphology.
morph_func:
The function to generate the 2D morphology image
based on `morphParams`.
morph_grad:
The function to calculate the gradient of the
likelihood wrt the morphological parameters.
morph_prox:
The proximal operator for the morphology parameters.
morph_step:
The function that calculates the gradient of the
morphological model.
prox_spectrum:
Proximal operator for the spectrum.
If `prox_spectrum` is `None` then the default proximal
operator `self.prox_spectrum` is used.
floor:
The minimum value of the spectrum, used to prevent
divergences in the gradients.
| ParametricComponent lsst.scarlet.lite.models.parametric.ParametricComponent.__copy__ | ( | self | ) |
Create a copy of this component
Returns
-------
component : ParametricComponent
A new component that is a shallow copy of this one.
| ParametricComponent lsst.scarlet.lite.models.parametric.ParametricComponent.__deepcopy__ | ( | self, | |
| dict[int, Any] | memo ) |
Create a deep copy of this component
Parameters
----------
memo:
The memoization dictionary used by `copy.deepcopy`.
Returns
-------
component : ParametricComponent
A new component that is a deep copy of this one.
| ParametricComponent lsst.scarlet.lite.models.parametric.ParametricComponent.__getitem__ | ( | self, | |
| Any | indices ) |
Get a sub-component corresponding to the given indices.
Parameters
----------
indices: Any
The indices to use to slice the component model.
Returns
-------
component: ParametricComponent
A new component that is a sub-component of this one.
Raises
------
IndexError :
If the index includes a ``Box`` or spatial indices.
|
protected |
The 2D image of the morphology
This callable generates an image of the morphology
in the given frame.
Parameters
----------
frame:
The frame (bounding box, pixel grid) that the image is
placed in.
Returns
-------
result:
The image of the morphology in the `frame`.
| CartesianFrame lsst.scarlet.lite.models.parametric.ParametricComponent.frame | ( | self | ) |
The coordinate system that contains the model
Reimplemented in lsst.scarlet.lite.models.parametric.EllipticalParametricComponent.
| Image lsst.scarlet.lite.models.parametric.ParametricComponent.get_model | ( | self, | |
| CartesianFrame | None | frame = None ) |
Generate the full model for this component
Reimplemented from lsst.scarlet.lite.component.Component.
| Callable lsst.scarlet.lite.models.parametric.ParametricComponent.grad_morph | ( | self | ) |
The function that calculates the gradient of the morphological model
| np.ndarray lsst.scarlet.lite.models.parametric.ParametricComponent.grad_spectrum | ( | self, | |
| np.ndarray | input_grad, | ||
| np.ndarray | spectrum, | ||
| np.ndarray | morph ) |
Gradient of the spectrum wrt. the component model
Parameters
----------
input_grad:
Gradient of the likelihood wrt the component model
spectrum:
The model of the spectrum.
morph:
The model of the morphology.
Returns
-------
result:
The gradient of the likelihood wrt. the spectrum.
| np.ndarray lsst.scarlet.lite.models.parametric.ParametricComponent.morph | ( | self, | |
| CartesianFrame | None | frame = None ) |
The morphological model
| Callable lsst.scarlet.lite.models.parametric.ParametricComponent.morph_step | ( | self | ) |
The function that calculates the gradient of the morphological model
| None lsst.scarlet.lite.models.parametric.ParametricComponent.parameterize | ( | self, | |
| Callable | parameterization ) |
Convert the component parameter arrays into Parameter instances
Reimplemented from lsst.scarlet.lite.component.Component.
| tuple[float, float] lsst.scarlet.lite.models.parametric.ParametricComponent.peak | ( | self | ) |
The center of the component
| Callable lsst.scarlet.lite.models.parametric.ParametricComponent.prox_morph | ( | self | ) |
The function used to constrain the morphological model
| np.ndarray lsst.scarlet.lite.models.parametric.ParametricComponent.prox_spectrum | ( | self, | |
| np.ndarray | spectrum ) |
Apply a prox-like update to the spectrum
Parameters
----------
spectrum:
The spectrum of the model.
| np.ndarray lsst.scarlet.lite.models.parametric.ParametricComponent.radial_params | ( | self | ) |
The parameters used to model the radial function
Reimplemented in lsst.scarlet.lite.models.parametric.EllipticalParametricComponent.
| bool lsst.scarlet.lite.models.parametric.ParametricComponent.resize | ( | self, | |
| Box | model_box ) |
Resize the box that contains the model Not yet implemented, so for now the model box does not grow. If this is ever implemented in production, in the long run this will be based on a cutoff value for the model.
Reimplemented from lsst.scarlet.lite.component.Component.
| np.ndarray lsst.scarlet.lite.models.parametric.ParametricComponent.spectrum | ( | self | ) |
The array of spectrum values
| ScarletComponentBaseData lsst.scarlet.lite.models.parametric.ParametricComponent.to_data | ( | self | ) |
Convert the component to persistable ScarletComponentBaseData
Returns
-------
component_data: ScarletComponentBaseData
The data object containing the component information
Reimplemented from lsst.scarlet.lite.component.Component.
| lsst.scarlet.lite.models.parametric.ParametricComponent.update | ( | self, | |
| int | it, | ||
| np.ndarray | input_grad ) |
Update the component parameters from an input gradient
Parameters
----------
it:
The current iteration of the optimizer.
input_grad:
Gradient of the likelihood wrt the component model
Reimplemented from lsst.scarlet.lite.component.Component.
Reimplemented in lsst.scarlet.lite.models.parametric.EllipticalParametricComponent.
| float lsst.scarlet.lite.models.parametric.ParametricComponent.x0 | ( | self | ) |
The x-center of the component
| float lsst.scarlet.lite.models.parametric.ParametricComponent.y0 | ( | self | ) |
The y-center of the component
| lsst.scarlet.lite.models.parametric.ParametricComponent.frame |
Reimplemented in lsst.scarlet.lite.models.parametric.EllipticalParametricComponent.
| lsst.scarlet.lite.models.parametric.ParametricComponent.radial_params |
Reimplemented in lsst.scarlet.lite.models.parametric.EllipticalParametricComponent.