pypeit.core.gui.gui_util module
GUI utilities
- class pypeit.core.gui.gui_util.Pointer(ax, **kwargs)[source]
Bases:
AxesWidget
A pointer widget
- Parameters:
ax (matplotlib.image.AxesImage) – Returned object after running
matplotlib.pyplot.imshow
plotting an image to point within.kwargs (dict) – Passed directly to
matplotlib.widgets.Cursor
.
- _event_update(event, event_type)[source]
Update the pointer position
- Parameters:
event (matplotlib.backend_bases.Event) – Key (or mouse) or button event instance.
event_type (
str
) – Type of event. Must be ‘key’ or ‘button’.
- build_help()[source]
Register the help dialog. Any action already assigned to the ‘?’ key will be removed!
- disconnect(action)[source]
Remove the action from the register.
- Parameters:
action (
str
) – The keyword for the event action to remove
- print_help(pos)[source]
Print the help dialog.
This is an event call-back function that must accept an array-like object giving the pointer coordinates.
- Parameters:
pos (array-like) – List with x and y position of the cursor at the time of the window event.
- register(action, func, descr=None)[source]
Register a function to associate with a specific button or key press.
All functions must have the same calling sequence (see
_set_event()
), which is that they only accept a tuple with the coordinates of the cursor when the event occurred.
- class pypeit.core.gui.gui_util.UpdateableImage(images, image_plot, slider)[source]
Bases:
object
Provides an interface to change the Z range of an image and toggle between a set of images.
- Parameters:
images (numpy.ndarray,
list
) – One or more images to plot. The images should have the same shape.image_plot (matplotlib.image.AxesImage) – Object returned by matplotlib.pyplot.imshow.
slider (
UpdateableRangeSlider
) – Slider used to adjust the image plot limits.
- next_image(*args)[source]
Got to the next image in the list.
All arguments to this function are accepted but ignored. The reason is because this is the function passed to matplotlib.widgets.Button.on_clicked, but this function does not need any of the input from the
Button
event.
- class pypeit.core.gui.gui_util.UpdateableRangeSlider(ax, label, valmin, valmax, valinit=None, valfmt=None, closedmin=True, closedmax=True, dragging=True, valstep=None, orientation='horizontal', track_color='lightgrey', handle_style=None, **kwargs)[source]
Bases:
RangeSlider
A range slider.
This is virtually identical to the base class, but with a few customizations regarding where labels are placed (or removed).
See matplotlib.widgets.RangeSlider for the argument descriptions.