MDA File Viz#
MDA File Visualization Module
- Classes:
MDAFileVisualization: Main widget for displaying MDA file contents with tabbed interface MetadataSearchDialog: Dialog for searching within metadata text
- Key Features:
Tabbed interface for Data, Plot, Metadata, and 2D visualization
Integrated 1D and 2D plotting with ChartView and ChartView2D
Interactive controls for curve fitting, styling, and log scales
Metadata search functionality
Dynamic tab visibility based on data dimensionality
Persistent UI state management
- Dependencies:
PyQt6: GUI framework
mdaviz.chartview: 1D and 2D plotting widgets
mdaviz.data_table_view: Data table display
mdaviz.fit_models: Curve fitting functionality
mdaviz.utils: Utility functions for UI loading
- Usage:
The MDAFileVisualization widget is typically instantiated as part of the main application window and receives MDA file data through: - setTableData(): Sets the data table content from MDA file - setMetadata(): Sets the metadata text content - setPlot(): Sets the 1D plotting widget (ChartView) with data from user selections - set2DData(): Sets 2D data for multi-dimensional arrays - update2DPlot(): Updates 2D plots based on user selections in 2D controls
- class mdaviz.mda_file_viz.MDAFileVisualization(*args: Any, **kwargs: Any)[source]#
The panel to show the contents of a file.
- _updateTabWidgetMaxHeight()[source]#
Update the tab widget’s maximum height to match the plot height setting.
- clearContents(plot=True, data=True, metadata=True)[source]#
Clears content from the specified components of the visualization.
Parameters: - plot (bool, optional): If True, clears the plot content. Defaults to True. - data (bool, optional): If True, clears the data table content. Defaults to True. - metadata (bool, optional): If True, clears the metadata content. Defaults to True.
- onFileTabChanged(tab_index, file_path, file_data, selection_field)[source]#
Handle file tab changes and update 2D plot if on 2D tab.
- Parameters:
tab_index (int): Index of the newly selected file tab file_path (str): Path of the file associated with the new tab file_data (dict): Contains metadata and table data for the file selection_field (dict): Specifies the fields (POS/DET) selected for plotting
- onTabChanged(index)[source]#
Handle tab changes.
- Parameters:
index (int): Index of the newly selected tab
- set2DData(data)[source]#
Set 2D data for plotting.
- Parameters:
data (dict or None): 2D data dictionary with scanDict2D and metadata, or None to clear
- setMetadata(text, *args, **kwargs)[source]#
Set text content for the metadata display.
- Parameters:
text (str): Text content to display
- setPlot(plot_widget)[source]#
Set the plot widget for the visualization tab.
- Parameters:
plot_widget: The plot widget to add to the layout
- setTableData(data)[source]#
Set data for the data table view.
- Parameters:
data: Data to display in the table
- show1DControls(show: bool)[source]#
Show or hide 1D-specific controls by hiding/showing the entire curves widget.
- update2DTabVisibility(show_2d_tab=False)[source]#
Update 2D tab visibility based on data dimensions.
- Parameters:
show_2d_tab (bool): Whether to show the 2D tab