lsst.scarlet.lite ge1c02a5578+b0138be388
 
Loading...
Searching...
No Matches
lsst.scarlet.lite.source.Source Class Reference
Inheritance diagram for lsst.scarlet.lite.source.Source:
lsst.scarlet.lite.source.SourceBase

Public Member Functions

 __init__ (self, list[Component] components, dict|None metadata=None, Image|None flux_weighted_image=None)
 
int n_components (self)
 
tuple[int, int]|None center (self)
 
tuple[int, int]|None source_center (self)
 
bool is_null (self)
 
Box bbox (self)
 
tuple bands (self)
 
Image get_model (self, bool use_flux=False)
 
 parameterize (self, Callable parameterization)
 
ScarletSourceData to_data (self)
 
 __str__ (self)
 
 __repr__ (self)
 
Source __getitem__ (self, Any indices)
 
Source __deepcopy__ (self, dict[int, Any] memo)
 
Source __copy__ (self)
 
- Public Member Functions inherited from lsst.scarlet.lite.source.SourceBase
Self __getitem__ (self, Any indices)
 
Self __deepcopy__ (self, dict[int, Any] memo)
 
Self __copy__ (self)
 
Self copy (self, bool deep=False)
 

Public Attributes

 flux_weighted_image = flux_weighted_image
 
int n_components = 0
 
 is_null
 

Additional Inherited Members

- Static Public Attributes inherited from lsst.scarlet.lite.source.SourceBase
dict metadata = None
 
list components [Component]
 

Detailed Description

A container for components associated with the same astrophysical object

A source can have a single component, or multiple components,
and each can be contained in different bounding boxes.

Parameters
----------
components:
    The components contained in the source.

Member Function Documentation

◆ __copy__()

Source lsst.scarlet.lite.source.Source.__copy__ ( self)
Create a copy of this source.

Returns
-------
source : SourceBase
    A new source that is a copy of this one.

◆ __deepcopy__()

Source lsst.scarlet.lite.source.Source.__deepcopy__ ( self,
dict[int, Any] memo )
Create a deep copy of this source.

Parameters
----------
memo : dict[int, Any]
    A memoization dictionary used by `copy.deepcopy`.

Returns
-------
source : SourceBase
    A new source that is a deep copy of this one.

◆ __getitem__()

Source lsst.scarlet.lite.source.Source.__getitem__ ( self,
Any indices )
Get a sub-source corresponding to the given indices.

Parameters
----------
indices: Any
    The indices to use to slice the source model. Can be:
    - A single band
    - A slice with start/stop bands
    - A sequence of bands

Returns
-------
source: Source
    A new source that is a sub-source of this one.

Raises
------
IndexError :
    If the index includes a ``Box`` or spatial indices.

◆ bands()

tuple lsst.scarlet.lite.source.Source.bands ( self)
The bands in the full source model.

◆ bbox()

Box lsst.scarlet.lite.source.Source.bbox ( self)
The minimal bounding box to contain all of this sources components

Null sources have a bounding box with shape `(0,0,0)`

◆ center()

tuple[int, int] | None lsst.scarlet.lite.source.Source.center ( self)
The center of the source in the full Blend.

◆ get_model()

Image lsst.scarlet.lite.source.Source.get_model ( self,
bool use_flux = False )
Build the model for the source

This is never called during optimization and is only used
to generate a model of the source for investigative purposes.

Parameters
----------
use_flux:
    Whether to use the re-distributed flux associated with the source
    instead of the component models.

Returns
-------
model:
    The full-color model.

◆ is_null()

bool lsst.scarlet.lite.source.Source.is_null ( self)
True if the source does not have any components

◆ n_components()

int lsst.scarlet.lite.source.Source.n_components ( self)
The number of components in this source

◆ parameterize()

lsst.scarlet.lite.source.Source.parameterize ( self,
Callable parameterization )
Convert the component parameter arrays into Parameter instances

Parameters
----------
parameterization:
    A function to use to convert parameters of a given type into
    a `Parameter` in place. It should take a single argument that
    is the `Component` or `Source` that is to be parameterized.

◆ source_center()

tuple[int, int] | None lsst.scarlet.lite.source.Source.source_center ( self)
The center of the source in its local bounding box.

◆ to_data()

ScarletSourceData lsst.scarlet.lite.source.Source.to_data ( self)
Convert to a `ScarletSourceData` for serialization

Returns
-------
source_data:
    The `ScarletSourceData` representation of this source.

Reimplemented from lsst.scarlet.lite.source.SourceBase.


The documentation for this class was generated from the following file: