|
LSST Applications g00d0e8bbd7+8c5ae1fdc5,g013ef56533+603670b062,g083dd6704c+2e189452a7,g199a45376c+0ba108daf9,g1c5cce2383+bc9f6103a4,g1fd858c14a+cd69ed4fc1,g210f2d0738+c4742f2e9e,g262e1987ae+612fa42d85,g29ae962dfc+83d129e820,g2cef7863aa+aef1011c0b,g35bb328faa+8c5ae1fdc5,g3fd5ace14f+5eaa884f2a,g47891489e3+e32160a944,g53246c7159+8c5ae1fdc5,g5b326b94bb+dcc56af22d,g64539dfbff+c4742f2e9e,g67b6fd64d1+e32160a944,g74acd417e5+c122e1277d,g786e29fd12+668abc6043,g87389fa792+8856018cbb,g88cb488625+47d24e4084,g89139ef638+e32160a944,g8d7436a09f+d14b4ff40a,g8ea07a8fe4+b212507b11,g90f42f885a+e1755607f3,g97be763408+34be90ab8c,g98df359435+ec1fa61bf1,ga2180abaac+8c5ae1fdc5,ga9e74d7ce9+43ac651df0,gbf99507273+8c5ae1fdc5,gc2a301910b+c4742f2e9e,gca7fc764a6+e32160a944,gd7ef33dd92+e32160a944,gdab6d2f7ff+c122e1277d,gdb1e2cdc75+1b18322db8,ge410e46f29+e32160a944,ge41e95a9f2+c4742f2e9e,geaed405ab2+0d91c11c6d,w.2025.44
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.