:py:mod:`pylbo.visualisation.eigenfunctions.eigfunc_interface` ============================================================== .. py:module:: pylbo.visualisation.eigenfunctions.eigfunc_interface Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: pylbo.visualisation.eigenfunctions.eigfunc_interface.EigenfunctionInterface Functions ~~~~~~~~~ .. autoapisummary:: pylbo.visualisation.eigenfunctions.eigfunc_interface.get_artist_data .. py:function:: get_artist_data(artist: matplotlib.pyplot.Artist) -> tuple[numpy.ndarray, numpy.ndarray] Returns the (x, y) coordinates of a given artist. :param artist: The artist to get the data from. :type artist: ~matplotlib.artist.Artist :returns: The (x, y) coordinates of the artist. :rtype: tuple[np.ndarray, np.ndarray] .. !! processed by numpydoc !! .. py:class:: EigenfunctionInterface(data, axis, spec_axis) .. py:method:: _check_data_is_present() Checks if the required data is present to draw for example eigenfunctions, is overloaded in subclasses. .. !! processed by numpydoc !! .. py:method:: _artist_has_valid_attributes(event) Checks if a given event has valid attributes, this prevents triggering the interface when clicking on legend items, for example. :param event: The pick event. :type event: ~matplotlib.backend_bases.PickEvent :returns: `True` if all conditions are met and callbacks can be connected, `False` otherwise. :rtype: bool .. !! processed by numpydoc !! .. py:method:: _clear_figure_and_selection() Clears the current figure, clears the dictionary of selected eigenvalues. .. !! processed by numpydoc !! .. py:method:: _switch_real_and_imaginary_part() Switches between the real and imaginary part of a given function. .. !! processed by numpydoc !! .. py:method:: _select_next_function() Increments the index of the currently selected function by 1. .. !! processed by numpydoc !! .. py:method:: _select_previous_function() Decrements the index of the currently selected function by 1. .. !! processed by numpydoc !! .. py:method:: _retransform_functions() Toggles a retransform of a function, for example an eigenfunction :math:`v_r \leftrightarrow rv_r`" .. !! processed by numpydoc !! .. py:method:: _print_selected_eigenvalues() Prints all selected eigenvalues to the console as an array. .. !! processed by numpydoc !! .. py:method:: _save_eigenvalue_selection() Saves all selected eigenvalues and their eigenfunctions as a list of dictionaries in a .npy file. Files can be loaded with the numpy load function. .. !! processed by numpydoc !! .. py:method:: _save_selection_indices() Saves the indices of all selected eigenvalues as an array in a .npy file. Files can be loaded with the numpy load function. .. !! processed by numpydoc !! .. py:method:: _print_nzeroes() Counts and prints the number of zeroes of the eigenfunctions for all selected eigenvalues on the plot, together with eigvals. .. !! processed by numpydoc !! .. py:method:: _get_label(ds, ev_idx, w) Returns the label used in the legend. In case of a data series, the datfile name is prepended. :param ds: The current dataset :type ds: ~pylbo.data_containers.LegolasDataSet :param ev_idx: The index of the current eigenvalue in the corresponding array :type ev_idx: int :param w: The eigenvalue to use in the label :type w: float, complex :returns: The label to use in the legend. :rtype: str .. !! processed by numpydoc !! .. py:method:: _get_title() :abstractmethod: Creates the title of a given plot, has to be overridden in a subclass. .. !! processed by numpydoc !! .. py:method:: get_selected_idxs() -> dict[pylbo.data_containers.LegolasDataContainer, dict[int, matplotlib.pyplot.Artist]] .. py:method:: get_name_of_drawn_eigenfunction() -> str .. py:method:: update_plot() :abstractmethod: Updates the plot when an event is triggered, clears and then redraws the functions. Rescaling of the axes is done automatically. Has to be overridden in a subclass. .. !! processed by numpydoc !! .. py:method:: on_point_pick(event) Determines what happens when an eigenvalue is clicked. :param event: The pick event. :type event: ~matplotlib.backend_bases.PickEvent .. !! processed by numpydoc !! .. py:method:: on_key_press(event) Determines what happens when a key is pressed. :param event: The key event. :type event: ~matplotlib.backend_bases.KeyEvent .. !! processed by numpydoc !! .. py:method:: on_left_click(event) Determines what happens when left-clicking an eigenvalue. :param event: The pick event. :type event: ~matplotlib.backend_bases.PickEvent .. !! processed by numpydoc !! .. py:method:: on_right_click(event) Determines what happens when right-clicking an eigenvalue. :param event: The pick event. :type event: ~matplotlib.backend_bases.PickEvent .. !! processed by numpydoc !! .. py:method:: _get_clicked_point_data(event) Retrieves the index (in the eigenvalue array), x data coordinate and y data coordinate of the eigenvalue nearest to the clicked point. :param event: The pick event. :type event: ~matplotlib.backend_bases.PickEvent :returns: * **idx** (*integer*) -- The index of the selected point in the eigenvalue array * **xdata** (*float*) -- The x data coordinate of the selected eigenvalue * **ydata** (*float*) -- The y data coordinate of the selected eigenvalue .. !! processed by numpydoc !! .. py:method:: _selected_point_has_eigenfunctions(ds, idx) Checks if the selected index has eigenfunctions associated with it, in the case of for example eigenfunction subsets this is not guaranteed. :param ds: The dataset associated with the given eigenvalue index :type ds: ~pylbo.data_containers.LegolasDataSet :param idx: The index of the selected eigenvalue :type idx: int :returns: Returns `True` if `idx` corresponds to an eigenvalue with eigenfunctions, `False` otherwise. :rtype: bool .. !! processed by numpydoc !! .. py:method:: _toggle_eigenfunction_subset_radius() .. py:method:: _mark_points_without_data_written() For dataseries, it is possible that not all datasets in the series have eigenfunctions associated with them. This routine will toggle a change in the opacity value for datapoints with no functions, so they are clearly distinguishable from those who do have them. .. !! processed by numpydoc !! .. py:method:: _display_tooltip() .. py:method:: _invert_continua(ds, ev_idx) Calculates the locations of resonance with the continua for a specific eigenmode. :param ef_idx: The number of the eigenvalue in the dataset. :type ef_idx: int :returns: * **r_inv** (*dict*) -- Dictionary of continua names and inverted resonance locations (float, or None if not in domain). * **labels** (*dict*) -- Dictionary containing the corresponding labels to be printed when drawing the locations of resonance. .. !! processed by numpydoc !! .. py:method:: _show_resonances(ds, ev_idx, color) Shows the locations of resonance with the continua. There is a different linestyle for every continuum. .. !! processed by numpydoc !!