Public Member Functions | |
| __init__ (self, tuple bands, Box bbox) | |
| Box | bbox (self) |
| tuple | bands (self) |
| bool | resize (self, Box model_box) |
| None | update (self, int it, np.ndarray input_grad) |
| Image | get_model (self) |
| None | parameterize (self, Callable parameterization) |
| ScarletComponentBaseData | to_data (self) |
| Component | __getitem__ (self, Any indices) |
| Component | __copy__ (self) |
| Component | __deepcopy__ (self, dict[int, Any] memo) |
| Component | copy (self, bool deep=False) |
Protected Attributes | |
| tuple | _bands = bands |
| Box | _bbox = bbox |
A base component in scarlet lite.
Parameters
----------
bands:
The bands used when the component model is created.
bbox: Box
The bounding box for this component.
| Component lsst.scarlet.lite.component.Component.__copy__ | ( | self | ) |
Create a copy of this component.
Returns
-------
component : Component
A new component that is a copy of this one.
| Component lsst.scarlet.lite.component.Component.__deepcopy__ | ( | self, | |
| dict[int, Any] | memo ) |
Create a deep copy of this component.
Returns
-------
component : Component
A new component that is a deep copy of this one.
| Component lsst.scarlet.lite.component.Component.__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
-------
sub_component: Component
A new component that is a sub-component of this one.
Raises
------
IndexError :
If the index includes a ``Box`` or spatial indices.
| tuple lsst.scarlet.lite.component.Component.bands | ( | self | ) |
The bands in the component model
| Box lsst.scarlet.lite.component.Component.bbox | ( | self | ) |
The bounding box that contains the component in the full image
| Component lsst.scarlet.lite.component.Component.copy | ( | self, | |
| bool | deep = False ) |
Create a copy of this component.
Parameters
----------
deep : bool, optional
If `True`, a deep copy is made. If `False`, a shallow copy is made.
Default is `False`.
Returns
-------
component : Component
A new component that is a copy of this one.
| Image lsst.scarlet.lite.component.Component.get_model | ( | self | ) |
Generate a model for the component
This must be implemented in inherited classes.
Returns
-------
model: Image
The image of the component model.
Reimplemented in lsst.scarlet.lite.component.CubeComponent, lsst.scarlet.lite.component.FactorizedComponent, lsst.scarlet.lite.models.free_form.FreeFormComponent, and lsst.scarlet.lite.models.parametric.ParametricComponent.
| None lsst.scarlet.lite.component.Component.parameterize | ( | self, | |
| Callable | parameterization ) |
Convert the component parameter arrays into Parameter instances
Parameters
----------
parameterization: Callable
A function to use to convert parameters of a given type into
a `Parameter` in place. It should take a single argument that
is the `Component` or `Source` that is to be parameterized.
Reimplemented in lsst.scarlet.lite.component.CubeComponent, lsst.scarlet.lite.component.FactorizedComponent, lsst.scarlet.lite.models.free_form.FreeFormComponent, and lsst.scarlet.lite.models.parametric.ParametricComponent.
| bool lsst.scarlet.lite.component.Component.resize | ( | self, | |
| Box | model_box ) |
Test whether or not the component needs to be resized This should be overriden in inherited classes and return `True` if the component needs to be resized.
Reimplemented in lsst.scarlet.lite.component.CubeComponent, lsst.scarlet.lite.component.FactorizedComponent, lsst.scarlet.lite.models.free_form.FactorizedFreeFormComponent, lsst.scarlet.lite.models.free_form.FreeFormComponent, and lsst.scarlet.lite.models.parametric.ParametricComponent.
| ScarletComponentBaseData lsst.scarlet.lite.component.Component.to_data | ( | self | ) |
Convert the component to persistable ScarletComponentBaseData
Returns
-------
component_data: ScarletComponentBaseData
The data object containing the component information
Reimplemented in lsst.scarlet.lite.component.CubeComponent, lsst.scarlet.lite.component.FactorizedComponent, lsst.scarlet.lite.models.free_form.FreeFormComponent, and lsst.scarlet.lite.models.parametric.ParametricComponent.
| None lsst.scarlet.lite.component.Component.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 in lsst.scarlet.lite.component.CubeComponent, lsst.scarlet.lite.component.FactorizedComponent, lsst.scarlet.lite.models.free_form.FreeFormComponent, lsst.scarlet.lite.models.parametric.EllipticalParametricComponent, and lsst.scarlet.lite.models.parametric.ParametricComponent.