ScarletComponentData

class lsst.meas.extensions.scarlet.ScarletComponentData(xy0: tuple[int, int], extent: tuple[int, int], center: tuple[float, float], model: ndarray)

Bases: object

Data for a component expressed as a 3D data cube

For now this is used for scarlet main source models because their structure is too complex to persist in the same way that scarlet lite components can be persisted.

Note that both xy0 and extent use lsst (x, y) convention, not the scarlet/C++ (y, x) convention.

Attributes:
xy0tuple of int

The lower bound of the components bounding box.

extenttuple of int

The (width, height) of the component array.

centertuple of int

The center of the component.

modelnumpy.ndarray

The model for the component.

Methods Summary

asDict()

Return the object encoded into a dict for JSON serialization

fromDict(data)

Reconstruct ScarletComponentData from JSON compatible dict

Methods Documentation

asDict() dict

Return the object encoded into a dict for JSON serialization

Returns:
resultdict

The object encoded as a JSON compatible dict

classmethod fromDict(data: dict) ScarletComponentData

Reconstruct ScarletComponentData from JSON compatible dict

Parameters:
datadict

Dictionary representation of the object

Returns:
resultScarletComponentData

The reconstructed object