|
LSST Applications g013ef56533+63812263fb,g083dd6704c+a047e97985,g199a45376c+0ba108daf9,g1fd858c14a+fde7a7a78c,g210f2d0738+db0c280453,g262e1987ae+abed931625,g29ae962dfc+058d1915d8,g2cef7863aa+aef1011c0b,g35bb328faa+8c5ae1fdc5,g3fd5ace14f+64337f1634,g47891489e3+f459a6810c,g53246c7159+8c5ae1fdc5,g54cd7ddccb+890c8e1e5d,g5a60e81ecd+d9e514a434,g64539dfbff+db0c280453,g67b6fd64d1+f459a6810c,g6ebf1fc0d4+8c5ae1fdc5,g7382096ae9+36d16ea71a,g74acd417e5+c70e70fbf6,g786e29fd12+668abc6043,g87389fa792+8856018cbb,g89139ef638+f459a6810c,g8d7436a09f+1b779678e3,g8ea07a8fe4+81eaaadc04,g90f42f885a+34c0557caf,g97be763408+9583a964dd,g98a1a72a9c+028271c396,g98df359435+530b675b85,gb8cb2b794d+4e54f68785,gbf99507273+8c5ae1fdc5,gc2a301910b+db0c280453,gca7fc764a6+f459a6810c,gd7ef33dd92+f459a6810c,gdab6d2f7ff+c70e70fbf6,ge410e46f29+f459a6810c,ge41e95a9f2+db0c280453,geaed405ab2+e3b4b2a692,gf9a733ac38+8c5ae1fdc5,w.2025.43
LSST Data Management Base Package
|
Public Member Functions | |
| __init__ (self, Sequence[Source] sources, Observation observation, dict|None metadata=None) | |
| Image | get_model (self, bool convolve=False, bool use_flux=False) |
| float | log_likelihood (self) |
| Blend | fit_spectra (self, bool clip=False) |
| tuple[int, float] | fit (self, int max_iter, float e_rel=1e-4, int min_iter=15, int resize=10) |
| parameterize (self, Callable parameterization) | |
| None | conserve_flux (self, bool mask_footprint=True, Image|None weight_image=None) |
| ScarletBlendData | to_data (self) |
| tuple[int, int, int] | shape (self) |
| Box | bbox (self) |
| list[Component] | components (self) |
Public Attributes | |
| observation = observation | |
| int | it = 0 |
| list | loss = [] |
Static Public Attributes | |
| list | sources [Source] |
| dict | metadata | None |
Protected Member Functions | |
| tuple[Image, np.ndarray] | _grad_log_likelihood (self) |
A single blend.
This class holds all of the sources and observation that are to be fit,
as well as performing fitting and joint initialization of the
spectral components (when applicable).
Parameters
----------
sources:
The sources to fit.
observation:
The observation that contains the images,
PSF, etc. that are being fit.
metadata:
Additional metadata to store with the blend.
| lsst.scarlet.lite.blend.Blend.__init__ | ( | self, | |
| Sequence[Source] | sources, | ||
| Observation | observation, | ||
| dict | None | metadata = None ) |
Definition at line 131 of file blend.py.
|
protected |
Gradient of the likelihood wrt the unconvolved model
Returns
-------
result:
The gradient of the likelihood wrt the model
model_data:
The convol model data used to calculate the gradient.
This can be useful for debugging but is not used in
production.
Reimplemented in lsst.scarlet.lite.models.fit_psf.FittedPsfBlend.
Definition at line 178 of file blend.py.
|
inherited |
|
inherited |
The list of all components in the blend. Since the list of sources might change, this is always built on the fly.
Definition at line 75 of file blend.py.
| None lsst.scarlet.lite.blend.Blend.conserve_flux | ( | self, | |
| bool | mask_footprint = True, | ||
| Image | None | weight_image = None ) |
Use the source models as templates to re-distribute flux
from the data
The source models are used as approximations to the data,
which redistribute the flux in the data according to the
ratio of the models for each source.
There is no return value for this function,
instead it adds (or modifies) a ``flux_weighted_image``
attribute to each the sources with the flux attributed to
that source.
Parameters
----------
blend:
The blend that is being fit
mask_footprint:
Whether or not to apply a mask for pixels with zero weight.
weight_image:
The weight image to use for the redistribution.
If `None` then the observation image is used.
Definition at line 342 of file blend.py.
| tuple[int, float] lsst.scarlet.lite.blend.Blend.fit | ( | self, | |
| int | max_iter, | ||
| float | e_rel = 1e-4, | ||
| int | min_iter = 15, | ||
| int | resize = 10 ) |
Fit all of the parameters
Parameters
----------
max_iter:
The maximum number of iterations
e_rel:
The relative error to use for determining convergence.
min_iter:
The minimum number of iterations.
resize:
Number of iterations before attempting to resize the
resizable components. If `resize` is `None` then
no resizing is ever attempted.
Returns
-------
it:
Number of iterations.
loss:
Loss for the last solution
Reimplemented in lsst.scarlet.lite.models.fit_psf.FittedPsfBlend.
Definition at line 280 of file blend.py.
| Blend lsst.scarlet.lite.blend.Blend.fit_spectra | ( | self, | |
| bool | clip = False ) |
Fit all of the spectra given their current morphologies with a
linear least squares algorithm.
Parameters
----------
clip:
Whether or not to clip components that were not
assigned any flux during the fit.
Returns
-------
blend:
The blend with updated components is returned.
Definition at line 207 of file blend.py.
| Image lsst.scarlet.lite.blend.Blend.get_model | ( | self, | |
| bool | convolve = False, | ||
| bool | use_flux = False ) |
Generate a model of the entire blend.
Parameters
----------
convolve:
Whether to convolve the model with the observed PSF in each band.
use_flux:
Whether to use the re-distributed flux associated with the sources
instead of the component models.
Returns
-------
model:
The model created by combining all of the source models.
Reimplemented from lsst.scarlet.lite.blend.BlendBase.
Definition at line 142 of file blend.py.
| float lsst.scarlet.lite.blend.Blend.log_likelihood | ( | self | ) |
The current log-likelihood This is calculated on the fly to ensure that it is always up to date with the current model parameters.
Definition at line 199 of file blend.py.
| lsst.scarlet.lite.blend.Blend.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.
Reimplemented in lsst.scarlet.lite.models.fit_psf.FittedPsfBlend.
Definition at line 329 of file blend.py.
|
inherited |
| ScarletBlendData lsst.scarlet.lite.blend.Blend.to_data | ( | self | ) |
Convert the Blend into a persistable data object
Parameters
----------
blend :
The blend that is being persisted.
Returns
-------
blend_data :
The data model for a single blend.
Reimplemented from lsst.scarlet.lite.blend.BlendBase.
Definition at line 405 of file blend.py.
|
staticinherited |
|
staticinherited |