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) |
| Monotonicity | __copy__ (self) |
| Monotonicity | __deepcopy__ (self, dict[int, Any]|None memo=None) |
Public Attributes | |
| np.ndarray|None | weights = None |
| np.ndarray|None | distance = None |
| tuple[int, int, int, int]|None | sizes = None |
| dtype = dtype | |
| auto_update = auto_update | |
| fit_radius = fit_radius | |
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.
| 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.
| Monotonicity lsst.scarlet.lite.operators.Monotonicity.__copy__ | ( | self | ) |
Create a shallow copy of the operator
Returns
-------
result:
A copy of the operator.
| Monotonicity lsst.scarlet.lite.operators.Monotonicity.__deepcopy__ | ( | self, | |
| dict[int, Any] | None | memo = None ) |
Create a deep copy of the operator
Parameters
----------
memo:
The memoization dictionary for deep copies.
Returns
-------
result:
A copy of the operator.
| tuple[int, int] lsst.scarlet.lite.operators.Monotonicity.center | ( | self | ) |
The center of the full operator
Returns
-------
result:
The center of the full operator.
| 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`.
| 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.
| lsst.scarlet.lite.operators.Monotonicity.update | ( | self, | |
| tuple[int, int] | shape ) |
Update the operator with a new shape
Parameters
----------
shape:
The new shape