Public Member Functions | |
| __init__ (self, dict[int, ScarletBlendBaseData]|None blends=None, dict[str, Any]|None metadata=None) | |
| dict | as_dict (self) |
| str | json (self) |
| ScarletModelData | from_dict (cls, dict data, DTypeLike dtype=np.float32, **dict[str, Any] kwargs) |
| ScarletModelData | parse_obj (cls, dict data) |
Static Public Attributes | |
| str | model_type = MODEL_TYPE |
| dict | blends [int, ScarletBlendBaseData] |
| dict | metadata [str, Any] | None |
| str | version = CURRENT_SCHEMA |
A container that propagates scarlet models for an entire catalog.
Attributes
----------
blends :
Map from parent IDs in the source catalog
to scarlet model data for each parent ID (blend).
metadata :
Metadata associated with the model,
for example the order of bands.
model_type :
The type of model being stored.
version :
The schema version of the ScarletModelData.
| lsst.scarlet.lite.io.model_data.ScarletModelData.__init__ | ( | self, | |
| dict[int, ScarletBlendBaseData] | None | blends = None, | ||
| dict[str, Any] | None | metadata = None ) |
Initialize an instance
| dict lsst.scarlet.lite.io.model_data.ScarletModelData.as_dict | ( | self | ) |
Return the object encoded into a dict for JSON serialization
Returns
-------
result :
The object encoded as a JSON compatible dict
| ScarletModelData lsst.scarlet.lite.io.model_data.ScarletModelData.from_dict | ( | cls, | |
| dict | data, | ||
| DTypeLike | dtype = np.float32, | ||
| **dict[str, Any] | kwargs ) |
Reconstruct `ScarletModelData` from JSON compatible dict.
Parameters
----------
data :
Dictionary representation of the object
dtype :
Datatype of the resulting model.
kwargs :
Additional keyword arguments.
Returns
-------
result :
The reconstructed object
| str lsst.scarlet.lite.io.model_data.ScarletModelData.json | ( | self | ) |
Serialize the data model to a JSON formatted string
Returns
-------
result : `str`
The result of the object converted into a JSON format
| ScarletModelData lsst.scarlet.lite.io.model_data.ScarletModelData.parse_obj | ( | cls, | |
| dict | data ) |
Construct a ScarletModelData from python decoded JSON object.
Parameters
----------
data :
The result of json.load(s) on a JSON persisted ScarletModelData
Returns
-------
result :
The `ScarletModelData` that was loaded the from the input object