lsst.scarlet.lite ge1c02a5578+b0138be388
 
Loading...
Searching...
No Matches
lsst.scarlet.lite.initialization.FactorizedInitialization Class Reference
Inheritance diagram for lsst.scarlet.lite.initialization.FactorizedInitialization:
lsst.scarlet.lite.initialization.FactorizedChi2Initialization lsst.scarlet.lite.initialization.FactorizedWaveletInitialization

Public Member Functions

 __init__ (self, Observation observation, Sequence[tuple[int, int]] centers, np.ndarray|None detect=None, float min_snr=50, Monotonicity|None monotonicity=None, float disk_percentile=25, float initial_bg_thresh=0.5, float bg_thresh=0.25, float|None thresh=None, int padding=2, bool use_sparse_init=True, int max_components=2, Image|None convolved=None, bool is_symmetric=False)
 
 thresh (self)
 
float get_snr (self, tuple[int, int] center)
 
FactorizedComponent get_psf_component (self, tuple[int, int] center)
 
FactorizedComponent|None get_single_component (self, tuple[int, int] center, np.ndarray detect, float thresh, int padding)
 
Source init_source (self, tuple[int, int] center)
 

Public Attributes

 detect = detect
 
 observation = observation
 
 convolved = convolved
 
 centers = centers
 
 min_snr = min_snr
 
 monotonicity = monotonicity
 
 use_sparse_init = use_sparse_init
 
 is_symmetric = is_symmetric
 
 convolved_psf = observation.convolve(convolved_psf, mode="real").data
 
int py = model_psf.shape[0] // 2
 
int px = model_psf.shape[1] // 2
 
 psf_spectrum = self.convolved_psf[:, self.py, self.px]
 
 max_components = max_components
 
 initial_bg_thresh = initial_bg_thresh
 
 bg_thresh = bg_thresh
 
 padding = padding
 
 disk_percentile = disk_percentile
 
 sources = sources
 

Static Public Attributes

str reason = "This class is replaced by FactorizedInitialization and will be removed after v29.0",
 
str version = "v29.0",
 
 category = FutureWarning,
 

Detailed Description

Common variables and methods for both Factorized Component schemes

There are a large number of parameters that are universal for all of the
sources being initialized from the same set of observed images.
To simplify the API those parameters are all initialized by this class
and passed to `init_source` for each source.
It also creates temporary objects that only need to be created once for
all of the sources in a blend.

Parameters
----------
observation:
    The observation containing the blend
centers:
    The center of each source to initialize.
detect:
    The array that contains a 2D image used for detection.
min_snr:
    The minimum SNR required per component.
    So a 2-component source requires at least `2*min_snr` while sources
    with SNR < `min_snr` will be initialized with the PSF.
monotonicity:
    When `monotonicity` is `None`,
    the component is initialized with only the
    monotonic pixels, otherwise the monotonicity operator is used to
    project the morphology to a monotonic solution.
disk_percentile:
    The percentage of the overall flux to attribute to the disk.
bg_thresh:
    The fraction of the background RMS to use as a threshold for the
    morphology (in other words the threshold is set at
    `bg_thresh * noise_rms`).
initital_bg_thresh:
    The same as bg_thresh, but this allows a different background
    threshold to be used for initialization.
thresh:
    Deprecated. Use `initial_bg_thresh` instead.
padding:
    The amount to pad the morphology to allow for extra flux
    in the first few iterations before resizing.
use_sparse_init:
    Use a monotonic mask to prevent initial source models from growing
    too large.
max_components:
    The maximum number of components in the source.
    This should be one or two.
convolved:
    Deprecated. This is now calculated in __init__, but the
    old API is supported until v29.0.
is_symmetric:
    Whether or not the sources are symmetric.
    This is used to determine whether to use the symmetry operator
    for initialization.

Member Function Documentation

◆ get_psf_component()

FactorizedComponent lsst.scarlet.lite.initialization.FactorizedInitialization.get_psf_component ( self,
tuple[int, int] center )
Create a factorized component with a PSF morphology

Parameters
----------
center:
    The center of the component.

Returns
-------
component:
    A `FactorizedComponent` with a PSF-like morphology.

◆ get_single_component()

FactorizedComponent | None lsst.scarlet.lite.initialization.FactorizedInitialization.get_single_component ( self,
tuple[int, int] center,
np.ndarray detect,
float thresh,
int padding )
Initialize parameters for a `FactorizedComponent`

Parameters
----------
center:
    The location of the center of the source to detect in the
    full image.
detect:
    The image used for detection of the morphology.
thresh:
    The lower cutoff threshold to use for the morphology.
padding:
    The amount to pad the morphology to allow for extra flux
    in the first few iterations before resizing.

Returns
-------
component:
    A `FactorizedComponent` created from the detection image.

◆ get_snr()

float lsst.scarlet.lite.initialization.FactorizedInitialization.get_snr ( self,
tuple[int, int] center )
Get the SNR at the center of a component

Parameters
----------
center:
    The location of the center of the source.

Returns
-------
result:
    The SNR at the center of the component.

◆ init_source()

Source lsst.scarlet.lite.initialization.FactorizedInitialization.init_source ( self,
tuple[int, int] center )
Initialize a source from a chi^2 detection.

Parameter
---------
center:
    The center of the source.
init:
    The initialization parameters common to all of the sources.
max_components:
    The maximum number of components in the source.

Reimplemented in lsst.scarlet.lite.initialization.FactorizedWaveletInitialization.


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