:py:mod:`main` ============== .. py:module:: main .. autoapi-nested-parse:: Module for analysis of SMS data from HDF5 files Bertus van Heerden and Joshua Botha University of Pretoria 2020 Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: main.MainWindow Functions ~~~~~~~~~ .. autoapisummary:: main.display_on main.display_reset main.main Attributes ~~~~~~~~~~ .. autoapisummary:: main.__docformat__ main.SMS_VERSION main.main_window_file main.logger .. py:data:: __docformat__ :value: "'NumPy'" .. py:data:: SMS_VERSION :value: "'0.7.7'" .. py:data:: main_window_file .. py:data:: logger :value: "'main'" .. py:class:: MainWindow Bases: :py:obj:`PyQt5.QtWidgets.QMainWindow`, :py:obj:`UI_Main_Window` Class for Full SMS application that returns QMainWindow object. This class uses a *.ui that is automatically converted to a *.py script upon exectution. .. py:attribute:: threadpool .. py:attribute:: active_threads :value: '[]' .. py:attribute:: confidence_index .. py:attribute:: settings_dialog .. py:attribute:: settings .. py:attribute:: intensity_controller .. py:attribute:: lifetime_controller .. py:attribute:: grouping_controller .. py:attribute:: spectra_controller .. py:attribute:: raster_scan_controller .. py:attribute:: antibunch_controller .. py:attribute:: filtering_controller .. py:attribute:: treemodel .. py:attribute:: _root_was_checked :value: 'False' .. py:attribute:: part_nodes :value: '[]' .. py:attribute:: part_index :value: '[]' .. py:attribute:: tauparam :value: 'None' .. py:attribute:: ampparam :value: 'None' .. py:attribute:: shift :value: 'None' .. py:attribute:: decaybg :value: 'None' .. py:attribute:: irfbg :value: 'None' .. py:attribute:: start :value: 'None' .. py:attribute:: end :value: 'None' .. py:attribute:: addopt :value: 'None' .. py:attribute:: progress .. py:attribute:: current_progress .. py:attribute:: data_loaded :value: 'False' .. py:attribute:: irf_loaded :value: 'False' .. py:attribute:: current_dataset :value: 'None' .. py:attribute:: current_particle :value: 'None' .. py:attribute:: lock :value: 'None' .. py:method:: after_show() .. py:method:: sums_file_check() -> bool .. py:method:: calc_store_sums() -> None Check if the all_sums.pickle file exists, and if it doesn't creates it .. py:method:: gui_export_current() .. py:method:: gui_export_selected() .. py:method:: gui_export_all() .. py:method:: gui_select_groups_changed(chb_changed) .. py:method:: act_detect_remove_bursts_current() .. py:method:: act_detect_remove_bursts_selected() .. py:method:: act_detect_remove_bursts_all() .. py:method:: act_remove_bursts_current() .. py:method:: act_remove_bursts_selected() .. py:method:: act_remove_bursts_all() .. py:method:: act_restore_bursts_current() .. py:method:: act_restore_bursts_selected() .. py:method:: act_restore_bursts_all() .. py:method:: set_bin_size(bin_size: int) .. py:method:: act_open_settings_dialog() .. py:method:: act_filtering_and_normalization_dialog() .. py:method:: gui_group_use_roi() .. py:method:: act_open_h5() Allows the user to point to a h5 file and then starts a thread that reads and loads the file. .. py:method:: act_save_selected() " Saves selected particles into a new HDF5 file. .. py:method:: act_save_analysis() .. py:method:: act_trim() Used to trim the 'dead' part of a trace as defined by two parameters. .. py:method:: act_switch_all() .. py:method:: act_switch_selected() .. py:method:: act_set_startpoint() .. py:method:: set_startpoint(irf_data=None, start=None) .. py:method:: add_dataset(dataset_node) .. py:method:: add_node(particle_node, num) .. py:method:: add_all_nodes(all_nodes) .. py:method:: tree_view_clicked(model_index) .. py:method:: tree_view_key_press(event) .. py:method:: act_select_all(*args, **kwargs) .. py:method:: act_invert_selection(*args, **kwargs) .. py:method:: act_deselect_all(*args, **kwargs) .. py:method:: tab_change(active_tab_index: int) .. py:method:: update_int_gui() .. py:method:: card_selected() -> None .. py:method:: selection_changed() -> None .. py:method:: display_data(current=None, prev=None, combocard=False, is_global_group=False) -> None Displays the intensity trace and the histogram of the current particle. Directly called by the tree signal currentChanged, thus the two arguments. :param current: The index of the current selected particle as defined by QtCore.QModelIndex. :type current: QtCore.QModelIndex :param prev: The index of the previous selected particle as defined by QtCore.QModelIndex. :type prev: QtCore.QModelIndex :param combocard: True if called due to selecting other TCSPC card. :type combocard: bool .. py:method:: status_message(message: str) -> None Updates the status bar with the provided message argument. :param message: The message that is to be displayed in the status bar. :type message: str .. py:method:: start_progress(max_num: int = None) -> None Sets the maximum value of the progress bar before use. reset parameter can be optionally set to False to prevent the setting of the progress bar value to 0. :param max_num: The number of iterations or steps that the complete process is made up of. :type max_num: int .. py:method:: set_progress(progress_value: int) -> None Sets the maximum value of the progress bar before use. reset parameter can be optionally set to False to prevent the setting of the progress bar value to 0. :param progress_value: The number of iterations or steps that the complete process is made up of. :type progress_value: int .. py:method:: update_progress(value: Union[int, float] = None) -> None Used to update the progress bar by an increment of one. If at maximum sets progress bars visibility to False .. py:method:: end_progress() .. py:method:: tree2particle(identifier) Returns the particle dataset for the identifier given. The identifier could be the number of the particle of the datasetnode value. :param identifier: The integer number or a datasetnode object of the particle in question. .. py:method:: tree2dataset() -> smsh5.H5dataset Returns the H5dataset object of the file loaded. :rtype: smsh5.H5dataset .. py:method:: set_data_loaded() .. py:method:: open_save_file_version_outdated() .. py:method:: open_file_thread_complete(thread: threads.ProcessThread = None, irf=False) -> None Is called as soon as all of the threads have finished. .. py:method:: set_export_options() .. py:method:: select_all_export_options() .. py:method:: select_all_plots_export_options() .. py:method:: select_all_dataframes_export_options() .. py:method:: open_file_error(err: Exception) .. py:method:: detect_remove_bursts(mode: str = None) -> None .. py:method:: remove_bursts(mode: str = None, confirm: bool = True) -> None .. py:method:: restore_bursts(mode: str = None) -> None .. py:method:: run_parallel_cpa(particle) .. py:method:: switching_frequency(all_selected: str = None) Calculates and exports the accumulated switching frequency of either all the particles, or only the selected. :param all_selected: Possible values are 'all' (default) or 'selected'. :type all_selected: {'all', 'selected'} .. py:method:: get_checked() .. py:method:: get_checked_nums() .. py:method:: get_checked_particles() .. py:method:: set_particle_check_state(particle_number: int, set_checked: bool) .. py:method:: set_level_resolved() .. py:method:: gui_plot_intensity_clicked(new_value) .. py:method:: gui_plot_lifetime_clicked(new_value) .. py:method:: gui_export(mode: str = None) .. py:method:: convert_file_dialog() .. py:method:: range_selection() .. py:method:: reset_gui() Sets the GUI elements to enabled if it should be accessible. .. py:method:: close_file() .. py:method:: error_handler(e: Exception) .. py:function:: display_on() .. py:function:: display_reset() .. py:function:: main() Creates QApplication and runs MainWindow().