lsst.pipe.tasks gd5638573c2+392ae78cd2
Loading...
Searching...
No Matches
lsst.pipe.tasks.prettyPictureMaker._plugins.PluginsRegistry Class Reference

Public Member Functions

None __init__ (self)
Generator[PLUGIN_TYPE, None, None] channel (self)
Generator[PLUGIN_TYPE, None, None] partial (self)
Generator[PLUGIN_TYPE, None, None] full (self)
Callable register (self, float order, PluginType kind)

Protected Attributes

list _full_values = []
list _partial_values = []
list _channel_values = []

Detailed Description

A class to serve as a registry for all pretty picture manipulation
plugins.

This class should not be instantiated directly other than the one
instantiation in this module.

Examples
--------
Using this registry to create a plugin would look somehting like the
following.

>>> @plugins.register(1, PluginType.PARTIAL)
>>> def fixNoData(
>>>     image: NDArray,
>>>     mask: NDArray,
>>>     maskDict: Mapping[str, int]
>>>     ) -> NDArray:
>>>     m = (mask & 2 ** maskDict["NO_DATA"]).astype(bool)
>>>     for i in range(3):
>>>         image[:, :, i] = cv2.inpaint(
>>>             image[:, :, i].astype(np.float32),
>>>             m.astype(np.uint8),
>>>             3,
>>>             cv2.INPAINT_TELEA
>>>         ).astype(image.dtype)
>>>     return image

Parameters
----------
None

Member Function Documentation

◆ channel()

Generator[PLUGIN_TYPE, None, None] lsst.pipe.tasks.prettyPictureMaker._plugins.PluginsRegistry.channel ( self)
Yield generators of channel plugins.

Returns
-------
gen : `~collections.abc.Iterator`
    Generator of channel plugins.

◆ full()

Generator[PLUGIN_TYPE, None, None] lsst.pipe.tasks.prettyPictureMaker._plugins.PluginsRegistry.full ( self)
Yield generators of full plugins.

Returns
-------
gen : `~collections.abc.Iterator`
    Generator of full plugins.

◆ partial()

Generator[PLUGIN_TYPE, None, None] lsst.pipe.tasks.prettyPictureMaker._plugins.PluginsRegistry.partial ( self)
Yield generators of partial plugins.

Returns
-------
gen : `~collections.abc.Iterator`
    Generator of partial plugins.

◆ register()

Callable lsst.pipe.tasks.prettyPictureMaker._plugins.PluginsRegistry.register ( self,
float order,
PluginType kind )
Register a plugin which is to be run when producing a
pretty picture.

Parameters
----------
order : `float`
    This determines in what order plugins will be run. For
    example, if plugin A specifies order 2, and plugin B
    specifies order 1, and both are the same ``kind`` of
    plugin type, plugin B will be run before plugin A.
kind : `PluginType`
    This specifies what data the registered plugin expects
    to run on, a channel, a partial image, or a full mosaic.

Returns
-------
wrapper : `Callable`
    Decorator function for registering the plugin.

The documentation for this class was generated from the following file:
  • python/lsst/pipe/tasks/prettyPictureMaker/_plugins.py