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:
wav_np (numpy.ndarray) – Wavelength map image
**kwargs – Keyword arguments for AstroImage
- 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 Gingachname (
str
) – Channel in which to load the imageimg_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 dictionarywav_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:
Notes
Get array dims: data.shape
Get array dtype: str(data.dtype)
Make a string from a numpy array: buf = grc.Blob(data.tobytes())