LSST Applications g063fba187b+cac8b7c890,g0f08755f38+6aee506743,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+b4475c5878,g1dcb35cd9c+8f9bc1652e,g20f6ffc8e0+6aee506743,g217e2c1bcf+73dee94bd0,g28da252d5a+1f19c529b9,g2bbee38e9b+3f2625acfc,g2bc492864f+3f2625acfc,g3156d2b45e+6e55a43351,g32e5bea42b+1bb94961c2,g347aa1857d+3f2625acfc,g35bb328faa+a8ce1bb630,g3a166c0a6a+3f2625acfc,g3e281a1b8c+c5dd892a6c,g3e8969e208+a8ce1bb630,g414038480c+5927e1bc1e,g41af890bb2+8a9e676b2a,g7af13505b9+809c143d88,g80478fca09+6ef8b1810f,g82479be7b0+f568feb641,g858d7b2824+6aee506743,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+2903d499ea,gb58c049af0+d64f4d3760,gc28159a63d+3f2625acfc,gcab2d0539d+b12535109e,gcf0d15dbbd+46a3f46ba9,gda6a2b7d83+46a3f46ba9,gdaeeff99f8+1711a396fd,ge79ae78c31+3f2625acfc,gef2f8181fd+0a71e47438,gf0baf85859+c1f95f4921,gfa517265be+6aee506743,gfa999e8aa5+17cd334064,w.2024.51
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.