|
LSST Applications g00d0e8bbd7+edbf708997,g03191d30f7+9ce8016dbd,g1955dfad08+0bd186d245,g199a45376c+5137f08352,g1fd858c14a+a888a50aa2,g262e1987ae+45f9aba685,g29ae962dfc+1c7d47a24f,g2cef7863aa+73c82f25e4,g35bb328faa+edbf708997,g3fd5ace14f+eed17d2c67,g47891489e3+6dc8069a4c,g53246c7159+edbf708997,g64539dfbff+c4107e45b5,g67b6fd64d1+6dc8069a4c,g74acd417e5+f452e9c21a,g786e29fd12+af89c03590,g7ae74a0b1c+a25e60b391,g7aefaa3e3d+2025e9ce17,g7cc15d900a+2d158402f9,g87389fa792+a4172ec7da,g89139ef638+6dc8069a4c,g8d4809ba88+c4107e45b5,g8d7436a09f+e96c132b44,g8ea07a8fe4+db21c37724,g98df359435+aae6d409c1,ga2180abaac+edbf708997,gac66b60396+966efe6077,gb632fb1845+88945a90f8,gbaa8f7a6c5+38b34f4976,gbf99507273+edbf708997,gca7fc764a6+6dc8069a4c,gd7ef33dd92+6dc8069a4c,gda68eeecaf+7d1e613a8d,gdab6d2f7ff+f452e9c21a,gdbb4c4dda9+c4107e45b5,ge410e46f29+6dc8069a4c,ge41e95a9f2+c4107e45b5,geaed405ab2+e194be0d2b,w.2025.47
LSST Data Management Base Package
|
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 | bands (self) |
| Box | bbox (self) |
| Image | convolve (self, Image image, str|None mode=None, bool grad=False) |
| float | log_likelihood (self, Image model) |
| Observation | __getitem__ (self, Any indices) |
| Observation | __copy__ (self, bool deep=False) |
| 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) |
Static Public Member Functions | |
| Observation | empty (tuple[Any] bands, np.ndarray psfs, np.ndarray model_psf, Box bbox, npt.DTypeLike dtype) |
Public Attributes | |
| 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]) |
Protected Attributes | |
| tuple[int, int, int, int]|None | _convolution_bounds = None |
A single observation
This class contains all of the observed images and derived
properties, like PSFs, variance map, and weight maps,
required for most optimizers.
This includes methods to match a scarlet model PSF to the oberved PSF
in each band.
Notes
-----
This is effectively a combination of the `Observation` and
`Renderer` class from scarlet main, greatly simplified due
to the assumptions that the observations are all resampled
onto the same pixel grid and that the `images` contain all
of the information for all of the model bands.
Parameters
----------
images:
(bands, y, x) array of observed images.
variance:
(bands, y, x) array of variance for each image pixel.
weights:
(bands, y, x) array of weights to use when calculate the
likelihood of each pixel.
psfs:
(bands, y, x) array of the PSF image in each band.
model_psf:
(bands, y, x) array of the model PSF image in each band.
If `model_psf` is `None` then convolution is performed,
which should only be done when the observation is a
PSF matched coadd, and the scarlet model has the same PSF.
noise_rms:
Per-band average noise RMS. If `noise_rms` is `None` then the mean
of the sqrt of the variance is used.
bbox:
The bounding box containing the model. If `bbox` is `None` then
a `Box` is created that is the shape of `images` with an origin
at `(0, 0)`.
padding:
Padding to use when performing an FFT convolution.
convolution_mode:
The method of convolution. This should be either "fft" or "real".
Definition at line 166 of file observation.py.
| 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" ) |
Definition at line 212 of file observation.py.
| Observation lsst.scarlet.lite.observation.Observation.__copy__ | ( | self, | |
| bool | deep = False ) |
Create a copy of the observation
Parameters
----------
deep:
Whether to perform a deep copy or not.
Returns
-------
result:
The copy of the observation.
Definition at line 393 of file observation.py.
| Observation lsst.scarlet.lite.observation.Observation.__getitem__ | ( | self, | |
| Any | indices ) |
Get a view for the subset of an image
Parameters
----------
indices:
The indices to select a subsection of the image.
Returns
-------
result:
The resulting image obtained by selecting subsets of the iamge
based on the `indices`.
Definition at line 351 of file observation.py.
| tuple lsst.scarlet.lite.observation.Observation.bands | ( | self | ) |
The bands in the observations.
Definition at line 267 of file observation.py.
| Box lsst.scarlet.lite.observation.Observation.bbox | ( | self | ) |
The bounding box for the full observation.
Definition at line 272 of file observation.py.
| tuple[int, int, int, int] lsst.scarlet.lite.observation.Observation.convolution_bounds | ( | self | ) |
Build the slices needed for convolution in real space
Definition at line 469 of file observation.py.
| Image lsst.scarlet.lite.observation.Observation.convolve | ( | self, | |
| Image | image, | ||
| str | None | mode = None, | ||
| bool | grad = False ) |
Convolve the model into the observed seeing in each band.
Parameters
----------
image:
The 3D 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.
Returns
-------
result:
The convolved image.
Reimplemented in lsst.scarlet.lite.models.fit_psf.FittedPsfObservation.
Definition at line 276 of file observation.py.
| Observation lsst.scarlet.lite.observation.Observation.copy | ( | self, | |
| bool | deep = False ) |
Create a copy of the observation
Parameters
----------
deep:
Whether to perform a deep copy or not.
Returns
-------
result:
The copy of the observation.
Definition at line 438 of file observation.py.
| npt.DTypeLike lsst.scarlet.lite.observation.Observation.dtype | ( | self | ) |
The dtype of the observation is the dtype of the images
Definition at line 464 of file observation.py.
|
static |
Definition at line 477 of file observation.py.
| float lsst.scarlet.lite.observation.Observation.log_likelihood | ( | self, | |
| Image | model ) |
Calculate the log likelihood of the given model
Parameters
----------
model:
Model to compare with the observed images.
Returns
-------
result:
The log-likelihood of the given model.
Definition at line 335 of file observation.py.
| int lsst.scarlet.lite.observation.Observation.n_bands | ( | self | ) |
The number of bands in the observation
Definition at line 459 of file observation.py.
| tuple[int, int, int] lsst.scarlet.lite.observation.Observation.shape | ( | self | ) |
The shape of the images, variance, etc.
Definition at line 454 of file observation.py.
|
protected |
Definition at line 264 of file observation.py.
| Fourier | None lsst.scarlet.lite.observation.Observation.diff_kernel = cast(Fourier, match_kernel(psfs, model_psf, padding=padding)) |
Definition at line 255 of file observation.py.
| Fourier | None lsst.scarlet.lite.observation.Observation.grad_kernel = Fourier(diff_img[:, ::-1, ::-1]) |
Definition at line 259 of file observation.py.
| lsst.scarlet.lite.observation.Observation.images = images |
Definition at line 230 of file observation.py.
| lsst.scarlet.lite.observation.Observation.mode = convolution_mode |
Definition at line 243 of file observation.py.
| lsst.scarlet.lite.observation.Observation.model_psf = model_psf |
Definition at line 250 of file observation.py.
| lsst.scarlet.lite.observation.Observation.noise_rms = noise_rms |
Definition at line 246 of file observation.py.
| lsst.scarlet.lite.observation.Observation.padding = padding |
Definition at line 251 of file observation.py.
| lsst.scarlet.lite.observation.Observation.psfs = psfs |
Definition at line 236 of file observation.py.
| lsst.scarlet.lite.observation.Observation.variance = _set_image_like(variance, bands, bbox) |
Definition at line 231 of file observation.py.
| lsst.scarlet.lite.observation.Observation.weights = _set_image_like(weights, bands, bbox) |
Definition at line 232 of file observation.py.