lsst.scarlet.lite gae0086650b+585e252eca
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
lsst.scarlet.lite.models.parametric.ParametricComponent Class Reference
Inheritance diagram for lsst.scarlet.lite.models.parametric.ParametricComponent:
lsst.scarlet.lite.component.Component lsst.scarlet.lite.models.parametric.EllipticalParametricComponent

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)
 
- Public Member Functions inherited from lsst.scarlet.lite.component.Component
Box bbox (self)
 
tuple bands (self)
 

Public Attributes

 floor
 
 y0
 
 radial_params
 
 frame
 

Protected Member Functions

np.ndarray _get_morph (self, CartesianFrame|None frame=None)
 

Protected Attributes

 _spectrum
 
 _params
 
 _func
 
 _morph_grad
 
 _morph_prox
 
 _morph_step
 
 _bbox
 
 _prox_spectrum
 
- Protected Attributes inherited from lsst.scarlet.lite.component.Component
 _bands
 
 _bbox
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

lsst.scarlet.lite.models.parametric.ParametricComponent.__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 )

Member Function Documentation

◆ _get_morph()

np.ndarray lsst.scarlet.lite.models.parametric.ParametricComponent._get_morph ( self,
CartesianFrame | None frame = None )
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`.

◆ 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.

◆ get_model()

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.

◆ grad_morph()

Callable lsst.scarlet.lite.models.parametric.ParametricComponent.grad_morph ( self)
The function that calculates the gradient of the
morphological model

◆ grad_spectrum()

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.

◆ morph()

np.ndarray lsst.scarlet.lite.models.parametric.ParametricComponent.morph ( self,
CartesianFrame | None frame = None )
The morphological model

◆ morph_step()

Callable lsst.scarlet.lite.models.parametric.ParametricComponent.morph_step ( self)
The function that calculates the gradient of the
morphological model

◆ parameterize()

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.

◆ peak()

tuple[float, float] lsst.scarlet.lite.models.parametric.ParametricComponent.peak ( self)
The center of the component

◆ prox_morph()

Callable lsst.scarlet.lite.models.parametric.ParametricComponent.prox_morph ( self)
The function used to constrain the morphological model

◆ prox_spectrum()

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.

◆ radial_params()

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.

◆ resize()

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.

◆ spectrum()

np.ndarray lsst.scarlet.lite.models.parametric.ParametricComponent.spectrum ( self)
The array of spectrum values

◆ update()

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.

◆ x0()

float lsst.scarlet.lite.models.parametric.ParametricComponent.x0 ( self)
The x-center of the component

◆ y0()

float lsst.scarlet.lite.models.parametric.ParametricComponent.y0 ( self)
The y-center of the component

Member Data Documentation

◆ frame

lsst.scarlet.lite.models.parametric.ParametricComponent.frame

◆ radial_params

lsst.scarlet.lite.models.parametric.ParametricComponent.radial_params

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