LsstBlend

class lsst.meas.extensions.scarlet.LsstBlend(sources, observations)

Bases: scarlet.blend.Blend

LSST Blend of sources

It is possible that LSST blends might require different funtionality than those in scarlet, which is being designed for multiresolution blends. So this class exists for any LSST specific changes.

Attributes Summary

K Number of components.
components Flattened tuple of all components in the tree.
converged Whether the full Blend has converged within e_rel.
coord The coordinate in tree.
frame Frame of the components.
it Number of iterations run in the fit method
n_components Number of components.
n_sources Number of initial sources or components.
sources Initial list of components or sources that generate the tree.

Methods Summary

display_model([observation, ax, filters, Q, …])
fit([max_iter, e_rel, approximate_L]) Fit the model for each source to the data
get_flux() Get the total flux for all the components in the tree
get_model([seds, morphs, observation]) Get the model this component tree
update() Update each component

Attributes Documentation

K

Number of components.

components

Flattened tuple of all components in the tree.

CAUTION: Each component in a tree can only be a leaf of a single node. While one can construct trees that hold the same component multiple times, this method will only return that component at its first encountered location

converged

Whether the full Blend has converged within e_rel.

For convergence tests of individual components, check its flags member.

coord

The coordinate in tree.

The coordinate can be used to traverse the tree and for __getitem__.

frame

Frame of the components.

it

Number of iterations run in the fit method

n_components

Number of components.

n_sources

Number of initial sources or components.

This can be different than self.n_components because sources can have multiple components.

Returns:
int: number of initial sources
sources

Initial list of components or sources that generate the tree.

This can be different than self.components because sources can have multiple components.

Returns:
The arguments of `__init__`

Methods Documentation

display_model(observation=None, ax=None, filters=None, Q=10, stretch=1, show=True)
fit(max_iter=200, e_rel=0.01, approximate_L=False)

Fit the model for each source to the data

Parameters:
max_iter: int

Maximum number of iterations if the algorithm doesn’t converge.

e_rel: float

Relative error for convergence of each component.

approximate_L: bool

Whether or not to use a rough approximation of the Lipschitz constants

get_flux()

Get the total flux for all the components in the tree

get_model(seds=None, morphs=None, observation=None)

Get the model this component tree

Parameters:
seds: list of arrays

Optional list of seds for each component in the tree. If seds is None then self.sed is used for each component.

morphs: list of arrays

Optional list of morphologies for each component in the tree. If morphs is None then self.morph is used for each component.

Returns:
model: array

(Bands, Height, Width) data cube

update()

Update each component

This method may be overwritten in inherited classes to perform updates on multiple components at once (for example separating a buldge and disk).