LSST Applications g042eb84c57+730a74494b,g04e9c324dd+8c5ae1fdc5,g134cb467dc+1f1e3e7524,g199a45376c+0ba108daf9,g1fd858c14a+fa7d31856b,g210f2d0738+f66ac109ec,g262e1987ae+83a3acc0e5,g29ae962dfc+d856a2cb1f,g2cef7863aa+aef1011c0b,g35bb328faa+8c5ae1fdc5,g3fd5ace14f+a1e0c9f713,g47891489e3+0d594cb711,g4d44eb3520+c57ec8f3ed,g4d7b6aa1c5+f66ac109ec,g53246c7159+8c5ae1fdc5,g56a1a4eaf3+fd7ad03fde,g64539dfbff+f66ac109ec,g67b6fd64d1+0d594cb711,g67fd3c3899+f66ac109ec,g6985122a63+0d594cb711,g74acd417e5+3098891321,g786e29fd12+668abc6043,g81db2e9a8d+98e2ab9f28,g87389fa792+8856018cbb,g89139ef638+0d594cb711,g8d7436a09f+80fda9ce03,g8ea07a8fe4+760ca7c3fc,g90f42f885a+033b1d468d,g97be763408+a8a29bda4b,g99822b682c+e3ec3c61f9,g9d5c6a246b+0d5dac0c3d,ga41d0fce20+9243b26dd2,gbf99507273+8c5ae1fdc5,gd7ef33dd92+0d594cb711,gdab6d2f7ff+3098891321,ge410e46f29+0d594cb711,geaed405ab2+c4bbc419c6,gf9a733ac38+8c5ae1fdc5,w.2025.38
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.