lsst.scarlet.lite gee10cc3b42+772f6ae910
|
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) |
![]() | |
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 | |
![]() | |
_bands | |
_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.
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 ) |
Reimplemented from lsst.scarlet.lite.component.Component.
|
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
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.