Image Display tools#

Image display tools.

lsst.cst image plot tools Next modules are available: - displays: Display available for image plotting. - interactors: Extra layers to add to a image display. - options: Options available for image plotting.

class lsst.cst.image_display.BoxInteract(image_display, options=BoxInteractOptions(color='red'))#

Interactive plot with a selectable box tool to show extra information.

Parameters:
  • options (BoxInteractOptions, Optional) – Box plot options.

  • image_display (ImageDisplay) –

options#

alias of BoxInteractOptions

show()#

Show interactive display.

class lsst.cst.image_display.CalExpImageDisplay(cal_exp_data, title=None, xlabel='X', ylabel='Y', show_detections=True, options=ImageOptions(cmap=None, height=600, padding=0.01, fontsize={'title': 16, 'xlabel': 14, 'ylabel': 14, 'ticks': 12}, toolbar_position='right', show_grid=True, tools=[], width=700, xaxis='bottom', yaxis='left'))#
Plot using Calexp data, includes the

image and also the sources.

Parameters:
  • cal_exp_data (CalExpData) – cal exp data to be plot

  • title (str, Optional) – Plot title. Default value: CalExpId information.

  • xlabel (str, Optional) – Plot xlabel. Default value: ‘X’.

  • ylabel (str, Optional) – Plot ylabel. Default value: ‘Y’.

  • show_detections (bool, Optional) – True if detections should be added to the plot. Default value: True.

  • image_options (ImageOptions, Optional) – Image options.

  • options (ImageOptions, default: ImageOptions(cmap=None, height=600, padding=0.01, fontsize={'title': 16, 'xlabel': 14, 'ylabel': 14, 'ticks': 12}, toolbar_position='right', show_grid=True, tools=[], width=700, xaxis='bottom', yaxis='left')) –

delete()#

Delete underlying image.

property image#

Underlying image.

Returns:

image – Underlying image used to create the plot.

Return type:

np.ndarray

options#

alias of ImageOptions

rasterize()#

Rasterize the image.

render()#

Render the image.

show()#

Show the image.

property transformed_image#

Underlying transformed image.

Returns:

image – Underlying transformed image shown in the plot.

Return type:

np.ndarray

class lsst.cst.image_display.HoverSources(image_display, sources, options=PointsOptions(fill_color=None, size=9, color='darkorange', marker='circle'))#

Interactive display including the sources.

Parameters:
  • options (PointsOptions, Optional) – Display points options.

  • image_display (ImageDisplay) –

  • sources (Tuple[Series]) –

options#

alias of PointsOptions

show()#

Show interactive display.

class lsst.cst.image_display.ImageArrayDisplay(image, bounds, title=None, xlabel='X', ylabel='Y', options=ImageOptions(cmap=None, height=600, padding=0.01, fontsize={'title': 16, 'xlabel': 14, 'ylabel': 14, 'ticks': 12}, toolbar_position='right', show_grid=True, tools=[], width=700, xaxis='bottom', yaxis='left'))#

Plot for an array as an image.

Parameters:
  • image (numpy.ndarray) – 1D image array to be show in the plot.

  • title (str) – title of the plot.

  • xlabel (str) – label for the x coordinates.

  • ylabel (str) – label for the y coordinates.

  • options (Options) – Options for the underlying plot object.

  • bounds (tuple[float]) –

property image#

Underlying image.

Returns:

image – Underlying image used to create the plot.

Return type:

np.ndarray

options#

alias of ImageOptions

rasterize()#

Rasterize the image.

render()#

Render the image.

show()#

Show the image.

property transformed_image#

Underlying transformed image.

Returns:

image – Underlying transformed image shown in the plot.

Return type:

np.ndarray

class lsst.cst.image_display.ImageDisplay#

Plot interface image.

delete()#

Delete underlying image.

static from_cal_exp_data(cal_exp_data, title=None, xlabel='X', ylabel='Y', show_detections=True, image_options=ImageOptions(cmap=None, height=600, padding=0.01, fontsize={'title': 16, 'xlabel': 14, 'ylabel': 14, 'ticks': 12}, toolbar_position='right', show_grid=True, tools=[], width=700, xaxis='bottom', yaxis='left'))#

Create a Plot class for CalExpData.

Parameters:
  • cal_exp_data (CalExpData) – exposure instance returned from butler.

  • title (str) – title of the plot.

  • xlabel (str) – label for the x coordinates.

  • ylabel (str) – label for the y coordinates.

  • image_options (ImageOptions) – Options for the underlying plot object.

  • sources_options (PointsOptions) – Options for the underlying sources plot object.

  • show_detections (bool, default: True) –

Returns:

results – Plot instance for the exposureF including sources.

Return type:

Plot

static from_image_array(image, bounds, title='No title', xlabel='X', ylabel='Y', image_options=ImageOptions(cmap=None, height=600, padding=0.01, fontsize={'title': 16, 'xlabel': 14, 'ylabel': 14, 'ticks': 12}, toolbar_position='right', show_grid=True, tools=[], width=700, xaxis='bottom', yaxis='left'))#

Create a Plot class for the exposureF image.

Parameters:
  • image (numpy.array) – image to be plotted.

  • bounds (tuple[float]) – image bounds.

  • title (str) – title of the plot.

  • xlabel (str) – label for the x coordinates.

  • ylabel (str) – label for the y coordinates.

  • image_options (ImageOptions) – Options for the underlying plot object.

Returns:

results – Plot instance for the exposureF

Return type:

Plot

abstract property image#

Underlying image.

Returns:

image – Underlying image used to create the plot.

Return type:

np.ndarray

abstract rasterize()#

Rasterize the image.

abstract render()#

Render the image.

abstract show()#

Show the image.

property transformed_image#

Underlying transformed image.

Returns:

image – Underlying transformed image shown in the plot.

Return type:

np.ndarray

class lsst.cst.image_display.OnClickInteract(image_display, options=OnClickInteractOptions(color='white', marker='x', size=20))#

Interactive display with a tap tool to show extra information.

Parameters:
options#

alias of OnClickInteractOptions

show()#

Show interactive display.

class lsst.cst.image_display.RGBImageDisplay(image, title='Untitled', xlabel='X', ylabel='Y', options=ImageOptions(cmap=None, height=600, padding=0.01, fontsize={'title': 16, 'xlabel': 14, 'ylabel': 14, 'ticks': 12}, toolbar_position='right', show_grid=True, tools=[], width=700, xaxis='bottom', yaxis='left'))#

Plot RGB image.

Parameters:
  • image (numpy.ndarray) – 3D image array to be show in the plot.

  • title (str) – title of the plot.

  • xlabel (str) – label for the x coordinates.

  • ylabel (str) – label for the y coordinates.

  • options (Options) – Options for the underlying plot object.

image()#

Underlying image.

Returns:

image – Underlying image used to create the plot.

Return type:

np.ndarray

rasterize()#

Rasterize the image.

render()#

Render the image.

show()#

Show the image.