LSST Applications g0d33ba9806+b932483eba,g0fba68d861+d53f2a615d,g1e78f5e6d3+1e869f36eb,g1ec0fe41b4+f536777771,g1fd858c14a+d5f4961c99,g35bb328faa+fcb1d3bbc8,g4af146b050+2e821d8f6b,g4d2262a081+b02c98aa00,g53246c7159+fcb1d3bbc8,g5a012ec0e7+b20b785ecb,g60b5630c4e+b932483eba,g67b6fd64d1+4086c0989b,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g87b7deb4dc+7d8c31d03d,g8852436030+a639f189fc,g89139ef638+4086c0989b,g9125e01d80+fcb1d3bbc8,g94187f82dc+b932483eba,g989de1cb63+4086c0989b,g9f33ca652e+898eabdf38,g9f7030ddb1+b068313d7a,ga2b97cdc51+b932483eba,ga44b1db4f6+2bd830756e,gabe3b4be73+1e0a283bba,gabf8522325+fa80ff7197,gb1101e3267+f4f1608365,gb58c049af0+f03b321e39,gb89ab40317+4086c0989b,gcf25f946ba+a639f189fc,gd6cbbdb0b4+af3c3595f5,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+4078fef7e5,ge278dab8ac+d65b3c2b70,ge410e46f29+4086c0989b,gf67bdafdda+4086c0989b,gfe06eef73a+6e83fc67a4,v29.0.0.rc5
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) |
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.
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 367 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.
npt.DTypeLike lsst.scarlet.lite.observation.Observation.dtype | ( | self | ) |
The dtype of the observation is the dtype of the images
Definition at line 362 of file observation.py.
|
static |
Definition at line 375 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 357 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 352 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.