SpectraPlotter

class sitelle.plot.SpectraPlotter(axis, original_cube, fit_cube, plot_axis, projection=None, residual=True, **kwargs)

An interactive Spectra Plotter. A map is displayed, and clicking on a pixel displays the corresponding spectra contained inside, as well as the fit and the residual. Its an augmentation of Interactive1DPlotter.

plot_axis

Axes – The matplotlib axes on which to plot. If None, a new one will be created.

axis

1D ndarray – The spectra axis

original_cube

3D ndarray – The datacube where the original spectra are stored

fit_cube

3D ndarray – The datacube where the fitted spectra are stored

residual

bool – If True, residuals will be displayed

projection

astropy.wcs.WCS, Optional – a WCS projection to plot the map on

args

Arguments to be passed to matplotlib.pyplot.plot() when plotting 1D data.

kwargs

dict – Keyword arguments to be passed to matplotlib.pyplot.plot() when plotting 1D data.

figure

Figure – The figure on which we listen for event (the 2D map)

Note

The code is far from optimized, and is in parts outdated (not updated since v0.1)

Methods Summary

connect(figure) Connect the 1D plotter to a given figure (the 2D map), to listen for specific events (press and motion)
disconnect() Disconnect all the stored connection ids
on_motion(event) Defines the behavior for a motion event.
on_press(event) Defines the behavior for a press event.

Methods Documentation

connect(figure)

Connect the 1D plotter to a given figure (the 2D map), to listen for specific events (press and motion)

Parameters:figure (Figure) – The figure containing the plot.
disconnect()

Disconnect all the stored connection ids

on_motion(event)

Defines the behavior for a motion event. Here, we display a rectangular patch around the pixel above which the mouse stands, the value of the pixel in the 2D map as well as the physical position (RA/DEC) if projection has been provided.

on_press(event)

Defines the behavior for a press event. Here, we display the data contained in the z dimesion of the cube at the [x,y] position corresponding to the press.