Public Member Functions | |
| __init__ (self, np.ndarray|Image images, np.ndarray|Image variance, np.ndarray|Image weights, np.ndarray psfs, np.ndarray|None model_psf=None, np.ndarray|None noise_rms=None, Box|None bbox=None, tuple|None bands=None, int padding=3, str convolution_mode="fft", tuple[int, int]|None shape=None) | |
| np.ndarray | grad_fit_kernel (self, np.ndarray input_grad, np.ndarray psf, np.ndarray model) |
| np.ndarray | prox_kernel (self, np.ndarray kernel) |
| np.ndarray | fitted_kernel (self) |
| cached_kernel (self) | |
| Image | convolve (self, Image image, str|None mode=None, bool grad=False) |
| update (self, int it, np.ndarray input_grad, np.ndarray model) | |
| None | parameterize (self, Callable parameterization) |
Public Member Functions inherited from lsst.scarlet.lite.observation.Observation | |
| __init__ (self, np.ndarray|Image images, np.ndarray|Image variance, np.ndarray|Image weights, np.ndarray psfs, np.ndarray|None model_psf=None, np.ndarray|None noise_rms=None, Box|None bbox=None, tuple|None bands=None, int padding=3, str convolution_mode="fft") | |
| tuple | bands (self) |
| Box | bbox (self) |
| float | log_likelihood (self, Image model) |
| Observation | __getitem__ (self, Any indices) |
| Observation | __copy__ (self) |
| Observation | __deepcopy__ (self, dict[int, Any] memo) |
| Observation | copy (self, bool deep=False) |
| tuple[int, int, int] | shape (self) |
| int | n_bands (self) |
| npt.DTypeLike | dtype (self) |
| tuple[int, int, int, int] | convolution_bounds (self) |
Public Attributes | |
| tuple | axes = (-2, -1) |
Public Attributes inherited from lsst.scarlet.lite.observation.Observation | |
| images = images | |
| variance = _set_image_like(variance, bands, bbox) | |
| weights = _set_image_like(weights, bands, bbox) | |
| psfs = psfs | |
| mode = convolution_mode | |
| noise_rms = noise_rms | |
| model_psf = model_psf | |
| padding = padding | |
| Fourier|None | diff_kernel = cast(Fourier, match_kernel(psfs, model_psf, padding=padding)) |
| Fourier|None | grad_kernel = Fourier(diff_img[:, ::-1, ::-1]) |
| bands | |
Protected Attributes | |
| _fitted_kernel = parameter(cast(Fourier, self.diff_kernel).image) | |
Protected Attributes inherited from lsst.scarlet.lite.observation.Observation | |
| tuple[int, int, int, int]|None | _convolution_bounds = None |
Additional Inherited Members | |
Static Public Member Functions inherited from lsst.scarlet.lite.observation.Observation | |
| Observation | empty (tuple[Any] bands, np.ndarray psfs, np.ndarray model_psf, Box bbox, npt.DTypeLike dtype) |
An observation that fits the PSF used to convolve the model.
| lsst.scarlet.lite.models.fit_psf.FittedPsfObservation.__init__ | ( | self, | |
| np.ndarray | Image | images, | ||
| np.ndarray | Image | variance, | ||
| np.ndarray | Image | weights, | ||
| np.ndarray | psfs, | ||
| np.ndarray | None | model_psf = None, | ||
| np.ndarray | None | noise_rms = None, | ||
| Box | None | bbox = None, | ||
| tuple | None | bands = None, | ||
| int | padding = 3, | ||
| str | convolution_mode = "fft", | ||
| tuple[int, int] | None | shape = None ) |
Initialize a `FitPsfObservation` See `Observation` for a description of the parameters.
| Image lsst.scarlet.lite.models.fit_psf.FittedPsfObservation.convolve | ( | self, | |
| Image | image, | ||
| str | None | mode = None, | ||
| bool | grad = False ) |
Convolve the model into the observed seeing in each band.
Parameters
----------
image:
The image to convolve
mode:
The convolution mode to use.
This should be "real" or "fft" or `None`,
where `None` will use the default `convolution_mode`
specified during init.
grad:
Whether this is a backward gradient convolution
(`grad==True`) or a pure convolution with the PSF.
Reimplemented from lsst.scarlet.lite.observation.Observation.
| np.ndarray lsst.scarlet.lite.models.fit_psf.FittedPsfObservation.grad_fit_kernel | ( | self, | |
| np.ndarray | input_grad, | ||
| np.ndarray | psf, | ||
| np.ndarray | model ) |
Gradient of the loss wrt the PSF
This is just the cross correlation of the input gradient
with the model.
Parameters
----------
input_grad:
The gradient of the loss wrt the model
psf:
The PSF of the model.
model:
The deconvolved model.
| None lsst.scarlet.lite.models.fit_psf.FittedPsfObservation.parameterize | ( | self, | |
| Callable | parameterization ) |
Convert the component parameter arrays into Parameter instances
Parameters
----------
parameterization: Callable
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.
| lsst.scarlet.lite.models.fit_psf.FittedPsfObservation.update | ( | self, | |
| int | it, | ||
| np.ndarray | input_grad, | ||
| np.ndarray | model ) |
Update the PSF given the gradient of the loss
Parameters
----------
it: int
The current iteration
input_grad: np.ndarray
The gradient of the loss wrt the model
model: np.ndarray
The deconvolved model.