lsst.scarlet.lite ge1c02a5578+b0138be388
 
Loading...
Searching...
No Matches
lsst.scarlet.lite.models.free_form.FreeFormComponent Class Reference
Inheritance diagram for lsst.scarlet.lite.models.free_form.FreeFormComponent:
lsst.scarlet.lite.component.Component

Public Member Functions

 __init__ (self, tuple bands, np.ndarray|Parameter model, Box model_bbox, float|None bg_thresh=None, np.ndarray|None bg_rms=None, float floor=1e-20, list[tuple[int, int]]|None peaks=None, float min_area=0)
 
np.ndarray model (self)
 
Image get_model (self)
 
tuple shape (self)
 
np.ndarray grad_model (self, np.ndarray input_grad, np.ndarray model)
 
np.ndarray prox_model (self, np.ndarray model)
 
bool resize (self, Box model_box)
 
 update (self, int it, np.ndarray grad_log_likelihood)
 
None parameterize (self, Callable parameterization)
 
 __str__ (self)
 
 __repr__ (self)
 
ScarletComponentBaseData to_data (self)
 
FreeFormComponent __getitem__ (self, Any indices)
 
FreeFormComponent __deepcopy__ (self, dict[int, Any] memo)
 
FreeFormComponent __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

 bg_rms = bg_rms
 
 bg_thresh = bg_thresh
 
 floor = floor
 
 peaks = peaks
 
 min_area = min_area
 
 model
 

Protected Attributes

 _model = parameter(model)
 
- Protected Attributes inherited from lsst.scarlet.lite.component.Component
tuple _bands = bands
 
Box _bbox = bbox
 

Detailed Description

Implements a component with no spectral or monotonicty constraints

This is a FreeFormComponent that is not factorized into a
spectrum and morphology with no monotonicity constraint.

Member Function Documentation

◆ __copy__()

FreeFormComponent lsst.scarlet.lite.models.free_form.FreeFormComponent.__copy__ ( self)
Create a copy of this component.

Returns
-------
component : FreeFormComponent
    A new component that is a copy of this one.

◆ __deepcopy__()

FreeFormComponent lsst.scarlet.lite.models.free_form.FreeFormComponent.__deepcopy__ ( self,
dict[int, Any] memo )
Create a deep copy of this component.

Parameters
----------
memo: dict[int, Any]
    A dictionary to keep track of already copied objects.

Returns
-------
component : FreeFormComponent
    A new component that is a deep copy of this one.

◆ __getitem__()

FreeFormComponent lsst.scarlet.lite.models.free_form.FreeFormComponent.__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: FreeFormComponent
    A new component that is a sub-component of this one.

Raises
------
IndexError :
    If the index includes a ``Box`` or spatial indices.

◆ get_model()

Image lsst.scarlet.lite.models.free_form.FreeFormComponent.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 from lsst.scarlet.lite.component.Component.

◆ parameterize()

None lsst.scarlet.lite.models.free_form.FreeFormComponent.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 from lsst.scarlet.lite.component.Component.

◆ resize()

bool lsst.scarlet.lite.models.free_form.FreeFormComponent.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 from lsst.scarlet.lite.component.Component.

◆ to_data()

ScarletComponentBaseData lsst.scarlet.lite.models.free_form.FreeFormComponent.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.

◆ update()

lsst.scarlet.lite.models.free_form.FreeFormComponent.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.


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