ArrayAnimatorWCS#
- class mpl_animators.ArrayAnimatorWCS(
- data,
- wcs,
- slices,
- coord_params=None,
- ylim='dynamic',
- ylabel=None,
- clip_interval: Unit('%') = None,
- **kwargs,
Bases:
ArrayAnimatorAnimate an array with associated
BaseLowLevelWCSobject.The following keyboard shortcuts are defined in the viewer:
‘left’: previous step on active slider.
‘right’: next step on active slider.
‘top’: change the active slider up one.
‘bottom’: change the active slider down one.
‘p’: play/pause active slider.
- Parameters:
data (
numpy.ndarray) – The data to be visualized.wcs (
astropy.wcs.wcsapi.BaseLowLevelWCS) – The world coordinate object associated with the array.slices (
tupleorlist) – A list specifying which axes of the array should be plotted on which axes. The list should be the same length as the number of pixel dimensions with'x'and (optionally)'y'in the elements corresponding to the axes to be plotted. If only'x'is present a line plot will be drawn. All other elements should be0.coord_params (
dict, optional) –This dict allows you to override
WCSAxesparameters for each world coordinate. The keys of this dictionary should be a value which can be looked up inWCSAxes.coords(i.e.em.wlorhpln) and the values should be a dict which supports the following keys, and passes their values to the associatedWCSAxesmethods.format_unit:set_format_unitmajor_formatter:set_major_formatteraxislabel:set_axislabelgrid:grid(The value should be a dict of keyword arguments togrid()orTrue).ticks:dictorboolthe keyword arguments to theset_ticksmethod, orFalseto display no ticks for this coord.
ylim (
tupleorstr, optional) – The yaxis limits to use when drawing a line plot, if ‘fixed’ then use the global data limits, if ‘dynamic’ then set the y limit for each frame individually (meaning the y limits change as you animate).ylabel (
string, optional) – The yaxis label to use when drawing a line plot. Setting the label on the y-axis on an image plot should be done viacoord_params.clip_interval (two-element
Quantity, optional) – If provided, the data for each step will be clipped to the percentile interval bounded by the two numbers.
Attributes Summary
Return data for 2D plotting, transposed if needed.
Methods Summary
plot_start_image(ax)Abstract method for plotting first slice of array.
Set up a line plot.
Setup an image plot.
update_plot(val, artist, slider)Update the plot when a slider changes.
update_plot_1d(val, line, slider)Update the line plot.
update_plot_2d(val, im, slider)Update the image plot.
Attributes Documentation
- data_transposed#
Return data for 2D plotting, transposed if needed.
Methods Documentation
- plot_start_image(ax)[source]#
Abstract method for plotting first slice of array.
Must exist here but be defined in subclass.
- plot_start_image_1d(ax)[source]#
Set up a line plot.
When plotting with WCSAxes, we always plot against pixel coordinate.