lsst.scarlet.lite gee10cc3b42+90ebb246c7
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
lsst.scarlet.lite.operators.Monotonicity Class Reference

Public Member Functions

 __init__ (self, tuple[int, int] shape, npt.DTypeLike dtype=float, bool auto_update=True, int fit_radius=1)
 
tuple[int, int] shape (self)
 
tuple[int, int] center (self)
 
 update (self, tuple[int, int] shape)
 
 check_size (self, tuple[int, int] shape, tuple[int, int] center, bool update=True)
 
np.ndarray __call__ (self, np.ndarray image, tuple[int, int] center)
 

Public Attributes

 dtype
 
 auto_update
 
 fit_radius
 
 weights
 
 distance
 
 sizes
 

Detailed Description

Class to implement Monotonicity

Callable class that applies monotonicity as a pseudo proximal
operator (actually a projection operator) to *a* radially
monotonic solution.

Notes
-----
This differs from monotonicity in the main scarlet branch because
this stores a single monotonicity operator to set the weights for all
of the pixels up to the size of the largest shape expected,
and only needs to be created once _per blend_, as opposed to
once _per source_..
This class is then called with the source morphology
to make monotonic and the location of the "center" of the image,
and the full weight matrix is sliced accordingly.

Parameters
----------
shape:
    The shape of the full operator.
    This must be larger than the largest possible object size
    in the blend.
dtype:
    The numpy ``dtype`` of the output image.
auto_update:
    If ``True`` the operator will update its shape if a image is
    too big to fit in the current operator.
fit_radius:
    Pixels within `fit_radius` of the center of the array to make
    monotonic are checked to see if they have more flux than the center
    pixel. If they do, the pixel with larger flux is used as the center.

Member Function Documentation

◆ __call__()

np.ndarray lsst.scarlet.lite.operators.Monotonicity.__call__ ( self,
np.ndarray image,
tuple[int, int] center )
Make an input image monotonic about a center pixel

Parameters
----------
image:
    The image to make monotonic.
center:
    The ``(y, x)`` location _in image coordinates_ to make the
    center of the monotonic region.

Returns
-------
result:
    The input image is updated in place, but also returned from this
    method.

◆ center()

tuple[int, int] lsst.scarlet.lite.operators.Monotonicity.center ( self)
The center of the full operator

Returns
-------
result:
    The center of the full operator.

◆ check_size()

lsst.scarlet.lite.operators.Monotonicity.check_size ( self,
tuple[int, int] shape,
tuple[int, int] center,
bool update = True )
Check to see if the operator can be applied

Parameters
----------
shape:
    The shape of the image to apply monotonicity.
center:
    The location (in `shape`) of the point where the monotonicity will
    be taken from.
update:
    When ``True`` the operator will update itself so that an image
    with shape `shape` can be made monotonic about the `center`.

Raises
------
ValueError:
    Raised when an array with shape `shape` does not fit in the
    current operator and `update` is `False`.

◆ shape()

tuple[int, int] lsst.scarlet.lite.operators.Monotonicity.shape ( self)
The 2D shape of the largest component that can be made monotonic

Returns
-------
result:
    The shape of the oeprator.

◆ update()

lsst.scarlet.lite.operators.Monotonicity.update ( self,
tuple[int, int] shape )
Update the operator with a new shape

Parameters
----------
shape:
    The new shape

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