pypeit.display.ginga_plugins module

Pluging for ginga that allows the value of a wavelength map to be displayed for any image.

class pypeit.display.ginga_plugins.SlitImage(wav_np=None, **kwargs)[source]

Bases: AstroImage

Custom image type for a 2D slit image.

This is a child of ginga’s AstroImage and primarily enables the display and cross-image registration of the slit wavelengths.

TODO: Also include the slit/order spatial position?

Parameters:
info_xy(data_x, data_y, settings)[source]

Function to show info for data.

Parameters:
  • data_x (float) – image x coordinate

  • data_y (float) – image y coordinate

  • settings (ginga.misc.Settings.SettingGroup) – ginga settings group

Returns:

info – Metadata for this coordinate

Return type:

ginga.misc.Bunch.Bunch

class pypeit.display.ginga_plugins.SlitWavelength(fv)[source]

Bases: GlobalPlugin

ginga plugin that enables display and registration of slit wavelength coordinates for a 2D slit image.

See the documentation for ginga GlobalPlugin.

load_buffer(imname, chname, img_buf, dims, dtype, header, wav_buf, wav_dtype, metadata)[source]

Load and display the 2D slit image.

Parameters:
  • imname (str) – Name to use for the image in Ginga

  • chname (str) – Channel in which to load the image

  • img_buf (bytes) – Image data, as a buffer

  • dims (tuple) – Image dimensions in pixels, typically (height, width)

  • dtype (str) – numpy data type of encoding (e.g. ‘float32’)

  • header (dict) – Fits file header as a dictionary

  • wav_buf (bytes) – Wavelength image data, as a buffer. Ultimate 2D shape once parsed must match the input image data.

  • wav_dtype (str) – numpy data type of wav_buf array encoding (e.g. ‘float32’)

  • metadata (dict) – other metadata about image to attach to image

Returns:

status – Load status number. Currently always returns 0.

Return type:

int

Notes

  • Get array dims: data.shape

  • Get array dtype: str(data.dtype)

  • Make a string from a numpy array: buf = grc.Blob(data.tobytes())