lsst.scarlet.lite ge1c02a5578+b0138be388
 
Loading...
Searching...
No Matches
lsst.scarlet.lite.component.Component Class Reference
Inheritance diagram for lsst.scarlet.lite.component.Component:
lsst.scarlet.lite.component.CubeComponent lsst.scarlet.lite.component.FactorizedComponent lsst.scarlet.lite.models.free_form.FreeFormComponent lsst.scarlet.lite.models.parametric.ParametricComponent lsst.scarlet.lite.io.cube_component.ComponentCube lsst.scarlet.lite.models.free_form.FactorizedFreeFormComponent lsst.scarlet.lite.models.parametric.EllipticalParametricComponent

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
 

Detailed Description

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.

Member Function Documentation

◆ __copy__()

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.

◆ __deepcopy__()

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.

◆ __getitem__()

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.

◆ bands()

tuple lsst.scarlet.lite.component.Component.bands ( self)
The bands in the component model

◆ bbox()

Box lsst.scarlet.lite.component.Component.bbox ( self)
The bounding box that contains the component in the full image

◆ copy()

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.

◆ get_model()

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.

◆ parameterize()

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.

◆ resize()

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.

◆ to_data()

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.

◆ update()

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.


The documentation for this class was generated from the following file: