LSST Applications g013ef56533+d2224463a4,g199a45376c+0ba108daf9,g19c4beb06c+9f335b2115,g1fd858c14a+2459ca3e43,g210f2d0738+2d3d333a78,g262e1987ae+abbb004f04,g2825c19fe3+eedc38578d,g29ae962dfc+0cb55f06ef,g2cef7863aa+aef1011c0b,g35bb328faa+8c5ae1fdc5,g3fd5ace14f+19c3a54948,g47891489e3+501a489530,g4cdb532a89+a047e97985,g511e8cfd20+ce1f47b6d6,g53246c7159+8c5ae1fdc5,g54cd7ddccb+890c8e1e5d,g5fd55ab2c7+951cc3f256,g64539dfbff+2d3d333a78,g67b6fd64d1+501a489530,g67fd3c3899+2d3d333a78,g74acd417e5+0ea5dee12c,g786e29fd12+668abc6043,g87389fa792+8856018cbb,g89139ef638+501a489530,g8d7436a09f+5ea4c44d25,g8ea07a8fe4+81eaaadc04,g90f42f885a+34c0557caf,g9486f8a5af+165c016931,g97be763408+d5e351dcc8,gbf99507273+8c5ae1fdc5,gc2a301910b+2d3d333a78,gca7fc764a6+501a489530,gce8aa8abaa+8c5ae1fdc5,gd7ef33dd92+501a489530,gdab6d2f7ff+0ea5dee12c,ge410e46f29+501a489530,geaed405ab2+e3b4b2a692,gf9a733ac38+8c5ae1fdc5,w.2025.41
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.