LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
LSST Data Management Base Package
|
Classes | |
class | AsinhPercentileNorm |
class | LinearPercentileNorm |
Functions | |
np.ndarray | channels_to_rgb (int channels) |
np.ndarray | img_to_3channel (np.ndarray img, np.ndarray|None channel_map=None, float fill_value=0) |
np.ndarray | img_to_rgb (np.ndarray|Image img, np.ndarray|None channel_map=None, float fill_value=0, Mapping|None norm=None, np.ndarray|None mask=None) |
matplotlib.pyplot.Figure | show_likelihood (Blend blend, tuple[float, float]|None figsize=None, **kwargs) |
_add_markers (Source src, tuple[float, float, float, float] extent, matplotlib.pyplot.Axes ax, bool add_markers, bool add_boxes, dict marker_kwargs, dict box_kwargs) | |
show_observation (Observation observation, Mapping|None norm=None, np.ndarray|None channel_map=None, Sequence|None centers=None, str|None psf_scaling=None, tuple[float, float]|None figsize=None) | |
matplotlib.pyplot.Figure | show_scene (Blend blend, Mapping|None norm=None, np.ndarray|None channel_map=None, bool show_model=True, bool show_observed=False, bool show_rendered=False, bool show_residual=False, bool add_labels=True, bool add_boxes=False, tuple[float, float]|None figsize=None, bool linear=True, bool use_flux=False, dict|None box_kwargs=None) |
tuple[int, int, int, int] | get_extent (Box bbox) |
matplotlib.pyplot.Figure | show_sources (Blend blend, list[Source]|None sources=None, Mapping|None norm=None, np.ndarray|None channel_map=None, bool show_model=True, bool show_observed=False, bool show_rendered=False, bool show_spectrum=True, tuple[float, float]|None figsize=None, bool model_mask=True, bool add_markers=True, bool add_boxes=False, bool use_flux=False) |
matplotlib.pyplot.Figure | compare_spectra (bool use_flux=True, bool use_template=True, **list[Source] all_sources) |
Variables | |
float | panel_size = 4.0 |
|
protected |
Add markers to a plot. Parameters ---------- src: The source to mark on the plot. extent: The extent of the source. ax: The axis of the plot. add_markers: Whether or not to add an "x" at the center of the source. add_boxes: Whether or not to draw a box around the entire source. marker_kwargs: Any kwargs to pass to the ``ax.plot`` when drawing the marker. box_kwargs: Any kwargs to pass to `~matplotlib.patches.Rectangle` when creating the source box.
Definition at line 286 of file display.py.
np.ndarray lsst.scarlet.lite.display.channels_to_rgb | ( | int | channels | ) |
Get the linear mapping of multiple channels to RGB channels The mapping created here assumes the channels are ordered in wavelength direction, starting with the shortest wavelength. The mapping seeks to produce a relatively even weights for across all channels. It does not consider e.g. signal-to-noise variations across channels or human perception. Parameters ---------- channels: Number of channels (in range(0,7)). Returns ------- channel_map: Array (3, `channels`) to map onto RGB.
Definition at line 41 of file display.py.
matplotlib.pyplot.Figure lsst.scarlet.lite.display.compare_spectra | ( | bool | use_flux = True, |
bool | use_template = True, | ||
**list[Source] | all_sources ) |
Compare spectra from multiple different deblending results of the same sources. Parameters ---------- use_flux: Whether or not to show the re-distributed flux version of the model. use_template: Whether or not to show the scarlet model templates. all_sources: The list of sources for each different deblending model.
Definition at line 782 of file display.py.
tuple[int, int, int, int] lsst.scarlet.lite.display.get_extent | ( | Box | bbox | ) |
Convert a `Box` into a list of bounds used in matplotlib Paramters --------- bbox: The box to convert into an extent list. Returns ------- extent: Tuple of coordinates that matplotlib requires for the extent of an image in ``imshow``.
Definition at line 595 of file display.py.
np.ndarray lsst.scarlet.lite.display.img_to_3channel | ( | np.ndarray | img, |
np.ndarray | None | channel_map = None, | ||
float | fill_value = 0 ) |
Convert multi-band image cube into 3 RGB channels Parameters ---------- img: This should be an array with dimensions (channels, height, width). channel_map: Linear mapping with dimensions (3, channels) fill_value: Value to use for any masked pixels. Returns ------- RGB: The input image converted into an RGB array that can be displayed with `matplotlib.imshow`.
Definition at line 166 of file display.py.
np.ndarray lsst.scarlet.lite.display.img_to_rgb | ( | np.ndarray | Image | img, |
np.ndarray | None | channel_map = None, | ||
float | fill_value = 0, | ||
Mapping | None | norm = None, | ||
np.ndarray | None | mask = None ) |
Convert images to normalized RGB. If normalized values are outside of the range [0..255], they will be truncated such as to preserve the corresponding color. Parameters ---------- img: This should be an array with dimensions (channels, height, width). channel_map: Linear mapping with dimensions (3, channels) fill_value: Value to use for any masked pixels. norm: Norm to use for mapping in the allowed range [0..255]. If ``norm=None``, `LinearPercentileNorm` will be used. mask: A [0,1] binary mask to apply over the top of the image, where pixels with mask==1 are masked out. Returns ------- rgb: RGB values with dimensions (3, height, width) and dtype uint8
Definition at line 216 of file display.py.
matplotlib.pyplot.Figure lsst.scarlet.lite.display.show_likelihood | ( | Blend | blend, |
tuple[float, float] | None | figsize = None, | ||
** | kwargs ) |
Display a plot of the likelihood in each iteration for a blend Parameters ---------- blend: The blend to generate the likelihood plot for. figsize: The size of the figure. kwargs: Keyword arguements passed to `blend.log_likelihood`. Returns ------- fig: The figure containing the log-likelihood plot.
Definition at line 259 of file display.py.
lsst.scarlet.lite.display.show_observation | ( | Observation | observation, |
Mapping | None | norm = None, | ||
np.ndarray | None | channel_map = None, | ||
Sequence | None | centers = None, | ||
str | None | psf_scaling = None, | ||
tuple[float, float] | None | figsize = None ) |
Plot observation in standardized form. Parameters ---------- observation: The observation to show. norm: An ``astropy.visualization.lupton_rgb.Mapping`` to map the colors. channel_map: A mapping to convert the multiband image into an RGB image. centers: A list of source centers to mark on the plot. If `centers` is ``None`` then no markers are added. psf_scaling: Scaling to use to display the PSF. If `psf_scaling` is ``None`` then the PSF is not displayed. If `psf_scaling` is "native", then the PSF is displayed with no scaling. If `psf_scaling` is "same", then the PSF is normalzied using the brightest pixel in each band. figsize: The size of the output figure. If not size is specified then the figsize is calculated automatically based on the number of objects shown.
Definition at line 329 of file display.py.
matplotlib.pyplot.Figure lsst.scarlet.lite.display.show_scene | ( | Blend | blend, |
Mapping | None | norm = None, | ||
np.ndarray | None | channel_map = None, | ||
bool | show_model = True, | ||
bool | show_observed = False, | ||
bool | show_rendered = False, | ||
bool | show_residual = False, | ||
bool | add_labels = True, | ||
bool | add_boxes = False, | ||
tuple[float, float] | None | figsize = None, | ||
bool | linear = True, | ||
bool | use_flux = False, | ||
dict | None | box_kwargs = None ) |
Plot all sources to recreate the scene. The functions provides a fast way of evaluating the quality of the entire model, i.e. the combination of all sources that seek to fit the observation. Parameters ---------- blend: The blend containing the observatons and sources to plot. norm: Norm to compress image intensity to the range [0,255]. channel_map: Linear mapping with dimensions (3, channels). show_model: Whether the model is shown in the model frame. show_observed: Whether the observation is shown. show_rendered: Whether the model, rendered to match the observation, is shown. show_residual: Whether the residuals between rendered model and observation is shown. add_labels: Whether each source is labeled with its numerical index in the source list. add_boxes: Whether each source box is shown. figsize: Size of the final figure. linear: Whether or not to display the scene in a single line (`True`) or on multiple lines (`False`). use_flux: Whether to show the flux redistributed model (`source.flux`) or the model itself (`source.get_model()`) for each source. box_kwargs: Keyword arguments to create boxes (`matplotlib.patches.Rectangle`) around sources, if `add_boxes == True`. Returns ------- fig: The figure that is generated based on the parameters.
Definition at line 424 of file display.py.
matplotlib.pyplot.Figure lsst.scarlet.lite.display.show_sources | ( | Blend | blend, |
list[Source] | None | sources = None, | ||
Mapping | None | norm = None, | ||
np.ndarray | None | channel_map = None, | ||
bool | show_model = True, | ||
bool | show_observed = False, | ||
bool | show_rendered = False, | ||
bool | show_spectrum = True, | ||
tuple[float, float] | None | figsize = None, | ||
bool | model_mask = True, | ||
bool | add_markers = True, | ||
bool | add_boxes = False, | ||
bool | use_flux = False ) |
Plot individual source models The functions provides a fast way of evaluating the quality of individual sources. Parameters ---------- blend: The blend that contains the sources. sources: The list of sources to plot. If `sources` is `None` then all of the sources in `blend` are displayed. norm: Norm to compress image intensity to the range [0,255]. channel_map: Linear mapping with dimensions (3, channels). show_model: Whether the model is shown in the model frame. show_observed: Whether the observation is shown. show_rendered: Whether the model, rendered to match the observation, is shown. show_spectrum: Whether or not to show a plot for the spectrum of each component in each source. figsize: Size of the final figure. model_mask: Whether pixels with no flux in a model are masked. add_markers: Whether all of the sources are marked in each plot. add_boxes: Whether each source box is shown. use_flux: Whether to show the flux redistributed model (`source.flux`) or the model itself (`source.get_model()`) for each source. Returns ------- fig: The figure that is generated based on the parameters.
Definition at line 612 of file display.py.
float lsst.scarlet.lite.display.panel_size = 4.0 |
Definition at line 38 of file display.py.